mirror of
https://github.com/inspec/inspec
synced 2024-11-16 01:38:03 +00:00
Merge pull request #1559 from chef/adamleff/add-crontab-example
Add additional example for matching crontab commands
This commit is contained in:
commit
3d551f977f
2 changed files with 10 additions and 0 deletions
|
@ -60,3 +60,9 @@ The following examples show how to use this InSpec audit resource.
|
|||
describe crontab.where({'hour' => '*', 'minute' => '*'}) do
|
||||
its('entries.length') { should cmp '0' }
|
||||
end
|
||||
|
||||
### Test that the logged-in user's crontab contains a single command that matches a mattern
|
||||
|
||||
describe crontab.where { command =~ /a partial command string/ } do
|
||||
its('entries.length') { should cmp 1 }
|
||||
end
|
||||
|
|
|
@ -21,6 +21,10 @@ module Inspec::Resources
|
|||
describe crontab.where({'hour' => '*', 'minute' => '*'}) do
|
||||
its('entries.length') { should cmp '0' }
|
||||
end
|
||||
|
||||
describe crontab.where { command =~ /a partial command string/ } do
|
||||
its('entries.length') { should cmp 1 }
|
||||
end
|
||||
"
|
||||
|
||||
attr_reader :params
|
||||
|
|
Loading…
Reference in a new issue