diff options
author | Matt Wrock <matt@mattwrock.com> | 2016-09-19 15:20:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-19 15:20:09 -0700 |
commit | ca81ec7593e970d578fbca470862ad7bcf1a1667 (patch) | |
tree | 4b7943ff0e893834284f330be8a1cbc853fcff95 | |
parent | f2a047d222cd620d66394d092eea5f92c503ac67 (diff) | |
parent | 459b0157eec9aaaf03881abca64b8f4d12156c03 (diff) | |
download | chef-ca81ec7593e970d578fbca470862ad7bcf1a1667.tar.gz |
Merge pull request #5342 from chef/GROUP
cleanup groups at the start of the tests
-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 |