Skip to content

Commit

Permalink
test(jobs): add a monthly job test
Browse files Browse the repository at this point in the history
  • Loading branch information
javierbertoli committed Mar 27, 2022
1 parent b6cc8a9 commit 957e689
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ logrotate:
- notifempty
- create 640 root adm
- sharedscripts
a_monthly_job:
path:
- /tmp/var/log/a_service/*.log
config:
- monthly
- missingok
- rotate 12
- compress
- delaycompress
- notifempty
- create 640 root adm
- sharedscripts
syslog:
path:
- /var/log/cron
Expand Down
16 changes: 16 additions & 0 deletions test/integration/default/controls/jobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,19 @@
its('content') { should include 'postrotate' }
its('content') { should include 'kill -USR1 $(cat /var/run/nginx_high_traf.pid)' }
end

describe file('/etc/logrotate.d/a_monthly_job') do
it { should be_file }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
its('mode') { should cmp '0644' }
its('content') { should include '/var/log/a_service/*.log' }
its('content') { should include 'monthly' }
its('content') { should include 'rotate 12' }
its('content') { should include 'missingok' }
its('content') { should include 'compress' }
its('content') { should include 'delaycompress' }
its('content') { should include 'notifempty' }
its('content') { should include 'sharedscripts' }
end

0 comments on commit 957e689

Please sign in to comment.