mirror of
https://github.com/inspec/inspec
synced 2024-11-10 15:14:23 +00:00
improvement: add etc_group support for centos and add integration test
This commit is contained in:
parent
63a868ea42
commit
2c8a8ccb25
2 changed files with 14 additions and 1 deletions
|
@ -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)
|
||||
|
|
13
test/integration/test/integration/default/etc_group.rb
Normal file
13
test/integration/test/integration/default/etc_group.rb
Normal 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
|
Loading…
Reference in a new issue