mirror of
https://github.com/saltstack-formulas/cron-formula.git
synced 2024-12-01 04:41:09 +01:00
27 lines
494 B
Ruby
27 lines
494 B
Ruby
# frozen_string_literal: true
|
|
|
|
control 'Cron service' do
|
|
title 'should be running and enabled'
|
|
|
|
service_name =
|
|
case os[:family]
|
|
when 'debian', 'suse'
|
|
'cron'
|
|
# Catch remaining `linux` platforms to identify by `name` at the end
|
|
when 'linux'
|
|
case os[:name]
|
|
when 'arch'
|
|
'cronie'
|
|
else
|
|
'crond'
|
|
end
|
|
else
|
|
'crond'
|
|
end
|
|
|
|
describe service(service_name) do
|
|
it { should be_enabled }
|
|
it { should be_running }
|
|
end
|
|
end
|