diff options
author | Matt Wrock <matt@mattwrock.com> | 2016-09-19 14:58:10 -0700 |
---|---|---|
committer | Matt Wrock <matt@mattwrock.com> | 2016-09-19 14:58:10 -0700 |
commit | 459b0157eec9aaaf03881abca64b8f4d12156c03 (patch) | |
tree | de26e07b3867e9ea7d3efff122ed93f8b718707e | |
parent | ed21f8cff3d816394fb50258e1ea27ac2fc89a5a (diff) | |
download | chef-459b0157eec9aaaf03881abca64b8f4d12156c03.tar.gz |
clean up users left from terminated builds and use explicid UIDs and GIDs
-rw-r--r-- | spec/functional/resource/group_spec.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/functional/resource/group_spec.rb b/spec/functional/resource/group_spec.rb index aa5a29f92c..31f9933546 100644 --- a/spec/functional/resource/group_spec.rb +++ b/spec/functional/resource/group_spec.rb @@ -99,8 +99,12 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte usr end - def create_user(username) - user(username).run_action(:create) if ! windows_domain_user?(username) + def create_user(username, uid = nil) + if ! windows_domain_user?(username) + user_to_create = user(username) + user_to_create.uid(uid) if uid + user_to_create.run_action(:create) + end # TODO: User should exist end @@ -169,8 +173,11 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte describe "when the users exist" do before do + high_uid = 30000 (spec_members).each do |member| - create_user(member) + remove_user(member) + create_user(member, high_uid) + high_uid += 1 end end @@ -296,6 +303,7 @@ describe Chef::Resource::Group, :requires_root_or_running_windows, :not_supporte group = Chef::Resource::Group.new(group_name, run_context) group.members(included_members) group.excluded_members(excluded_members) + group.gid(30000) unless ohai[:platform_family] == "mac_os_x" group end |