You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# What should work, but isnt
options = {
assignment_re: /^\s*([^=]*?)\s*=\s*(.*?)\s*$/
}
output = file('/etc/sysctl.conf', options).content
describe parse_config(output) do
its('kernel.domainname') { should eq 'example.com' }
its('fs.suid_dumpable') { should eq '0' }
end
also, the same should work with parse_config_file:
options = {
assignment_re: /^\s*([^=]*?)\s*=\s*(.*?)\s*$/
}
describe parse_config_file('/etc/sysctl.conf', options) do
its('kernel.domainname') { should eq 'example.com' }
its('fs.suid_dumpable') { should eq '0' }
end
For now, we need to circumvent the issue #875 with the following code:
# What we need to do right now until # is fixed
describe parse_config_file('/etc/sysctl.conf', options).params['kernel.domainname'] do
it { should eq 'example.com' }
end
describe parse_config_file('/etc/sysctl.conf', options).params['fs.suid_dumpable'] do
it { should eq '0' }
end
parse_config error
I wanted to use the parse_config resource instead of a file resource to match content for
fs.suid_dumpable
in/etc/systctl.conf
. So I tried usingSee:
https://github.com/anniehedgpeth/ubuntu-14-cis-profile/blob/master/controls/4.rb#L22
But it gets this error
InSpec and Platform Version
InSpec version 0.28.1
MacOs 10.11.6
Replication Case
Run
kitchen verify
on this cookbook.Possible Solutions
notsomuch
Stacktrace
The text was updated successfully, but these errors were encountered: