improvement: add etc_group support for centos and add integration test

This commit is contained in:
Christoph Hartmann 2015-11-27 14:04:16 +01:00 committed by Dominik Richter
parent 63a868ea42
commit 2c8a8ccb25
2 changed files with 14 additions and 1 deletions

View file

@ -37,7 +37,7 @@ class EtcGroup < Inspec.resource(1)
# skip resource if it is not supported on current OS
return skip_resource 'The `etc_group` resource is not supported on your OS.' \
unless %w{ubuntu debian redhat fedora arch darwin freebsd}.include?(inspec.os[:family])
unless %w{ubuntu debian redhat fedora centos arch darwin freebsd}.include?(inspec.os[:family])
end
def groups(filter = nil)

View file

@ -0,0 +1,13 @@
# encoding: utf-8
if os.unix?
describe etc_group do
its('gids') { should_not contain_duplicates }
its('groups') { should include 'root' }
its('users') { should include 'root' }
end
describe etc_group.where(name: 'root') do
its('users') { should include 'root' }
end
end