From 459b0157eec9aaaf03881abca64b8f4d12156c03 Mon Sep 17 00:00:00 2001 From: Matt Wrock Date: Mon, 19 Sep 2016 14:58:10 -0700 Subject: clean up users left from terminated builds and use explicid UIDs and GIDs --- spec/functional/resource/group_spec.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'spec/functional') 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 -- cgit v1.2.1