1
0
Fork 0
mirror of synced 2024-12-22 06:01:08 -05:00
formula-logrotate/test/integration/default/controls/base.rb
2018-11-14 17:27:15 -03:00

40 lines
782 B
Ruby

# encoding: utf-8
title 'Test logrotate installation'
case os[:name]
when 'redhat', 'centos', 'fedora'
pkg = 'cronie'
else
pkg = 'logrotate'
end
describe package(pkg) do
it { should be_installed }
end
describe file('/etc/logrotate.conf') do
it { should exist }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
its('mode') { should cmp '0644' }
end
describe file('/etc/logrotate.d') do
it { should be_directory }
it { should be_owned_by 'root' }
it { should be_grouped_into 'root' }
its('mode') { should cmp '0755' }
end
case os[:name]
when 'redhat', 'centos', 'fedora'
service = 'crond'
else
service = 'cron'
end
describe service(service) do
it { should be_installed }
it { should be_enabled }
it { should be_running }
end