-
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(config): add tests on Php config
- Loading branch information
1 parent
dc12a0b
commit 6555cf0
Showing
1 changed file
with
46 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,46 @@ | ||
control 'Php configuration' do | ||
title 'should match desired lines' | ||
|
||
def test_debian | ||
describe file('/etc/php/5.6/fpm/pool.d/radius-admin.conf') do | ||
its('content') { should include '[radius-admin]' } | ||
its('content') { should include 'php_admin_value[date.timezone] = Europe/Paris' } | ||
end | ||
|
||
describe file('/etc/php/7.3/fpm/pool.d/ldap-admin.conf') do | ||
its('content') { should include '[ldap-admin]' } | ||
its('content') { should include 'php_admin_value[date.timezone] = Europe/Paris' } | ||
end | ||
|
||
describe file('/etc/php/5.6/fpm/php.ini') do | ||
its('content') { should include 'date.timezone = Europe/Paris' } | ||
end | ||
|
||
describe file('/etc/php/7.3/fpm/php.ini') do | ||
its('content') { should include 'date.timezone = Europe/Paris' } | ||
end | ||
end | ||
|
||
def test_ubuntu | ||
end | ||
|
||
def test_redhat | ||
end | ||
|
||
def test_suse | ||
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 |