瀏覽代碼

test(jobs): add a monthly job test

tags/v0.13.2
Javier Bértoli 2 年之前
父節點
當前提交
957e6897c0
共有 2 個檔案被更改,包括 28 行新增0 行删除
  1. +12
    -0
      pillar.example
  2. +16
    -0
      test/integration/default/controls/jobs.rb

+ 12
- 0
pillar.example 查看文件

@@ -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

+ 16
- 0
test/integration/default/controls/jobs.rb 查看文件

@@ -88,3 +88,19 @@ describe file('/etc/logrotate.hourly.d/nginx_high_traf') do
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


Loading…
取消
儲存