Skip to content

Commit

Permalink
php on el9 requires different inspec tests
Browse files Browse the repository at this point in the history
Signed-off-by: Mike van Goor <[email protected]>
  • Loading branch information
mvangoor committed Jul 31, 2024
1 parent fe36c83 commit 4da2137
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,23 @@ jobs:
- debian-12
- fedora-latest
- opensuse-leap-15
- oraclelinux-8
- oraclelinux-9
- rockylinux-8
- rockylinux-9
- ubuntu-2004
- ubuntu-2204
- ubuntu-2404
suite:
- basic-site
- default
- mod-auth-cas
- mod-php
- php
- module-template
- mod-wsgi
- ports
- ssl
- install-override
exclude:
- os: amazonlinux-2023
suite: mod-wsgi
# TODO: disabled due to https://github.com/chef/chef/pull/13691
- os: opensuse-leap-15
suite: mod-wsgi
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down
9 changes: 5 additions & 4 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ platforms:
- name: almalinux-8
- name: almalinux-9
- name: amazonlinux-2023
- name: centos-stream-8
- name: centos-stream-9
- name: debian-10
- name: debian-11
- name: debian-12
- name: fedora-latest
- name: opensuse-leap-15
- name: oraclelinux-8
- name: oraclelinux-9
- name: rockylinux-8
- name: rockylinux-9
- name: ubuntu-18.04
- name: ubuntu-20.04
- name: ubuntu-22.04
- name: ubuntu-24.04

suites:
- name: default
Expand All @@ -47,7 +48,7 @@ suites:
- name: module_template
run_list:
- recipe[test::module_template]
- name: mod_php
- name: php
run_list:
- recipe[test::php]
- name: mod_wsgi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
impact 1
desc 'php module should be enabled with config'

describe command('apachectl -M') do
its('stdout') { should match(/php/) }
if os['family'] == 'redhat' && os['version'].to_i >= 9
describe command('httpd -M') do
its('stdout') { should match(/proxy_fcgi/) }
end
else
describe command('apachectl -M') do
its('stdout') { should match(/php/) }
end
end

case os['family']
Expand All @@ -21,6 +27,24 @@
it { should exist }
its('content') { should match %r{SetHandler application/x-httpd-php} }
end
when 'redhat'
if os['release'].to_i >= 9
describe service('php-fpm') do
it { should be_installed }
it { should be_enabled }
it { should be_running }
end

describe file('/etc/httpd/conf-available/custom_php_pool.conf') do
it { should exist }
its('content') { should match %r{proxy:unix:/var/run/php.*-fpm.sock|fcgi://localhost} }
end
else
describe file('/etc/httpd/mods-available/php.conf') do
it { should exist }
its('content') { should match %r{SetHandler application/x-httpd-php} }
end
end
else
describe file('/etc/httpd/mods-available/php.conf') do
it { should exist }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: apache2-mod-php
name: apache2-php
title: Integration tests for apache2 cookbook
summary: This InSpec profile contains integration tests for apache2 cookbook
supports:
Expand Down

0 comments on commit 4da2137

Please sign in to comment.