From 69677b0c02623d4c4c7954e39c7225864abf9d87 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Fri, 14 Jan 2022 11:13:31 +0000 Subject: [PATCH] test(jobs): add `hourly` test --- test/integration/default/controls/jobs.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/integration/default/controls/jobs.rb b/test/integration/default/controls/jobs.rb index 9809394..a2d94e4 100644 --- a/test/integration/default/controls/jobs.rb +++ b/test/integration/default/controls/jobs.rb @@ -69,3 +69,22 @@ describe file('/etc/logrotate.d/nginx') do its('content') { should include 'postrotate' } its('content') { should include ' invoke-rc.d nginx rotate >/dev/null 2>&1' } end + +describe file('/etc/logrotate.hourly.d/nginx_high_traf') 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/nginx_high_traf/*.log' } + its('content') { should include 'hourly' } + its('content') { should include 'missingok' } + its('content') { should include 'rotate 720' } + its('content') { should include 'compress' } + its('content') { should include 'notifempty' } + its('content') { should include 'dateext' } + its('content') { should include 'dateformat .%Y-%m-%d-%H00' } + its('content') { should include 'olddir /var/log/nginx_high_traf/archive' } + its('content') { should include 'sharedscripts' } + its('content') { should include 'postrotate' } + its('content') { should include 'kill -USR1 $(cat /var/run/nginx_high_traf.pid)' } +end