1
0
Fork 0
mirror of synced 2024-12-21 05:31:09 -05:00

test(base): update from template-formula and Arch Linux exclusion

This commit is contained in:
Imran Iqbal 2021-02-22 16:30:01 +00:00
parent b2e67d64fa
commit 09d4f5a034
No known key found for this signature in database
GPG key ID: 6D8629439D2B7819

View file

@ -2,15 +2,24 @@
title 'Test logrotate installation'
case os[:name]
when 'redhat', 'centos', 'fedora', 'amazon'
pkg = 'cronie'
control 'logrotate-pkg.pkg.installed' do
title 'The required package should be installed'
pkg =
case platform[:name]
when 'redhat', 'centos', 'fedora', 'amazon', 'oracle'
'cronie'
else
pkg = 'logrotate'
'logrotate'
end
describe package(pkg) do
it { should be_installed }
end
end
control 'logrotate-config.file.managed' do
title 'Verify the configuration file'
describe file('/etc/logrotate.conf') do
it { should exist }
@ -18,6 +27,10 @@ describe file('/etc/logrotate.conf') do
it { should be_grouped_into 'root' }
its('mode') { should cmp '0644' }
end
end
control 'logrotate-directory.file.directory' do
title 'Verify the `.d` directory'
describe file('/etc/logrotate.d') do
it { should be_directory }
@ -25,12 +38,22 @@ describe file('/etc/logrotate.d') do
it { should be_grouped_into 'root' }
its('mode') { should cmp '0755' }
end
end
case os[:name]
when 'redhat', 'centos', 'fedora', 'amazon'
service = 'crond'
control 'logrotate.service.running' do
title 'The service should be installed, enabled and running'
only_if('Disabled on Arch Linux') do
!%w[arch].include?(platform[:name])
end
service =
case platform[:name]
when 'redhat', 'centos', 'fedora', 'amazon', 'oracle'
'crond'
else
service = 'cron'
'cron'
end
describe service(service) do
@ -38,3 +61,4 @@ describe service(service) do
it { should be_enabled }
it { should be_running }
end
end