2015-12-21 18:25:34 +00:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2016-08-03 15:41:27 +00:00
|
|
|
if ENV['DOCKER']
|
|
|
|
STDERR.puts "\033[1;33mTODO: Not running #{__FILE__.split("/").last} because we are running in docker\033[0m"
|
|
|
|
return
|
|
|
|
end
|
2016-05-10 17:23:11 +00:00
|
|
|
|
|
|
|
# lets define our own group
|
2016-01-28 13:51:54 +00:00
|
|
|
root_group = 'root'
|
|
|
|
|
2016-09-01 16:27:00 +00:00
|
|
|
if os[:name] == 'aix'
|
2016-01-28 13:51:54 +00:00
|
|
|
root_group = 'system'
|
2016-09-01 16:27:00 +00:00
|
|
|
elsif os[:name] == 'freebsd'
|
2016-01-28 13:51:54 +00:00
|
|
|
root_group = 'wheel'
|
2016-09-01 16:27:00 +00:00
|
|
|
elsif os[:name] == 'suse'
|
|
|
|
root_group = 'sfcb'
|
2016-01-28 13:51:54 +00:00
|
|
|
elsif os.solaris?
|
|
|
|
root_group = 'sys'
|
|
|
|
end
|
2015-12-21 18:25:34 +00:00
|
|
|
|
|
|
|
if os.unix?
|
|
|
|
describe etc_group do
|
|
|
|
its('gids') { should_not contain_duplicates }
|
|
|
|
its('groups') { should include root_group }
|
|
|
|
its('users') { should include 'root' }
|
|
|
|
end
|
|
|
|
|
2016-09-01 16:27:00 +00:00
|
|
|
puts "ROOT GROUP: " + root_group
|
2015-12-21 18:25:34 +00:00
|
|
|
describe etc_group.where(name: root_group) do
|
2016-09-01 16:27:00 +00:00
|
|
|
its('users') { should_not eq [] }
|
2015-12-21 18:25:34 +00:00
|
|
|
its('users') { should include 'root' }
|
|
|
|
end
|
|
|
|
end
|