-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(service): add tests on Php services
- Loading branch information
1 parent
59f648c
commit baeac04
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |