test(service): add tests on Php services
This commit is contained in:
parent
59f648c067
commit
baeac04bd9
50
test/integration/default/controls/service_spec.rb
Normal file
50
test/integration/default/controls/service_spec.rb
Normal file
@ -0,0 +1,50 @@
|
||||
control 'Php service' do
|
||||
title 'should be running and enabled'
|
||||
|
||||
def test_debian
|
||||
describe service('php5.6-fpm') do
|
||||
it { should be_enabled }
|
||||
it { should be_running }
|
||||
end
|
||||
|
||||
describe service('php7.3-fpm') do
|
||||
it { should be_enabled }
|
||||
it { should be_running }
|
||||
end
|
||||
end
|
||||
|
||||
def test_ubuntu
|
||||
describe service(pkg_name) do
|
||||
it { should be_enabled }
|
||||
it { should be_running }
|
||||
end
|
||||
end
|
||||
|
||||
def test_redhat
|
||||
describe service('php') do
|
||||
it { should be_enabled }
|
||||
it { should be_running }
|
||||
end
|
||||
end
|
||||
|
||||
def test_suse
|
||||
describe service('php5') do
|
||||
it { should be_enabled }
|
||||
it { should be_running }
|
||||
end
|
||||
end
|
||||
|
||||
case os[:family]
|
||||
when 'debian'
|
||||
case os[:name]
|
||||
when 'ubuntu'
|
||||
test_ubuntu
|
||||
when 'debian'
|
||||
test_debian
|
||||
end
|
||||
when 'redhat', 'fedora'
|
||||
test_redhat
|
||||
when 'suse'
|
||||
test_suse
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user