From 364ef833cc779ec55f6ced80c1cea635af896790 Mon Sep 17 00:00:00 2001 From: Eric Veiras Galisson Date: Thu, 12 Jul 2018 12:48:52 +0200 Subject: [PATCH] adding Inspec tests for raw content jobs --- test/integration/default/controls/jobs.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/integration/default/controls/jobs.rb b/test/integration/default/controls/jobs.rb index 11d8a50..dc59bde 100644 --- a/test/integration/default/controls/jobs.rb +++ b/test/integration/default/controls/jobs.rb @@ -51,3 +51,21 @@ describe file('/etc/logrotate.d/syslog') do its('content') { should include 'sharedscripts' } end +describe file('/etc/logrotate.d/nginx') 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/*.log' } + its('content') { should include 'weekly' } + its('content') { should include 'missingok' } + its('content') { should include 'compress' } + its('content') { should include 'delaycompress' } + its('content') { should include 'prerotate' } + its('content') { should include 'if [ -d /etc/logrotate.d/httpd-prerotate ]; then \\' } + its('content') { should include ' run-parts /etc/logrotate.d/httpd-prerotate; \\' } + its('content') { should include ' fi \\' } + its('content') { should include 'postrotate' } + its('content') { should include ' invoke-rc.d nginx rotate >/dev/null 2>&1' } + +end