Skip to content

Commit c0ec46d

Browse files
committed
php on el9 requires different inspec tests
Signed-off-by: Mike van Goor <mvangoor@schubergphilis.com>
1 parent fe36c83 commit c0ec46d

File tree

4 files changed

+36
-9
lines changed

4 files changed

+36
-9
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ jobs:
3131
- debian-12
3232
- fedora-latest
3333
- opensuse-leap-15
34+
- oraclelinux-8
35+
- oraclelinux-9
3436
- rockylinux-8
3537
- rockylinux-9
3638
- ubuntu-2004
@@ -39,16 +41,16 @@ jobs:
3941
- basic-site
4042
- default
4143
- mod-auth-cas
42-
- mod-php
44+
- php
4345
- module-template
4446
- mod-wsgi
4547
- ports
4648
- ssl
4749
- install-override
4850
exclude:
51+
# TODO: disabled due to https://github.com/chef/chef/pull/13691
4952
- os: amazonlinux-2023
5053
suite: mod-wsgi
51-
# TODO: disabled due to https://github.com/chef/chef/pull/13691
5254
- os: opensuse-leap-15
5355
suite: mod-wsgi
5456
steps:

kitchen.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@ platforms:
1616
- name: almalinux-8
1717
- name: almalinux-9
1818
- name: amazonlinux-2023
19-
- name: centos-stream-8
2019
- name: centos-stream-9
21-
- name: debian-10
2220
- name: debian-11
2321
- name: debian-12
22+
- name: fedora-latest
2423
- name: opensuse-leap-15
24+
- name: oraclelinux-8
25+
- name: oraclelinux-9
2526
- name: rockylinux-8
2627
- name: rockylinux-9
27-
- name: ubuntu-18.04
2828
- name: ubuntu-20.04
2929
- name: ubuntu-22.04
30+
- name: ubuntu-24.04
3031

3132
suites:
3233
- name: default
@@ -47,7 +48,7 @@ suites:
4748
- name: module_template
4849
run_list:
4950
- recipe[test::module_template]
50-
- name: mod_php
51+
- name: php
5152
run_list:
5253
- recipe[test::php]
5354
- name: mod_wsgi

test/integration/mod_php/controls/default.rb renamed to test/integration/php/controls/default.rb

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@
66
impact 1
77
desc 'php module should be enabled with config'
88

9-
describe command('apachectl -M') do
10-
its('stdout') { should match(/php/) }
9+
if os['family'] == 'redhat' && os['release'].to_i >= 9
10+
describe command('httpd -M') do
11+
its('stdout') { should match(/proxy_fcgi/) }
12+
end
13+
else
14+
describe command('apachectl -M') do
15+
its('stdout') { should match(/php/) }
16+
end
1117
end
1218

1319
case os['family']
@@ -21,6 +27,24 @@
2127
it { should exist }
2228
its('content') { should match %r{SetHandler application/x-httpd-php} }
2329
end
30+
when 'redhat'
31+
if os['release'].to_i >= 9
32+
describe service('php-fpm') do
33+
it { should be_installed }
34+
it { should be_enabled }
35+
it { should be_running }
36+
end
37+
38+
describe file('/etc/httpd/conf-available/custom_php_pool.conf') do
39+
it { should exist }
40+
its('content') { should match %r{proxy:unix:/var/run/php.*-fpm.sock|fcgi://localhost} }
41+
end
42+
else
43+
describe file('/etc/httpd/mods-available/php.conf') do
44+
it { should exist }
45+
its('content') { should match %r{SetHandler application/x-httpd-php} }
46+
end
47+
end
2448
else
2549
describe file('/etc/httpd/mods-available/php.conf') do
2650
it { should exist }

test/integration/mod_php/inspec.yml renamed to test/integration/php/inspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: apache2-mod-php
2+
name: apache2-php
33
title: Integration tests for apache2 cookbook
44
summary: This InSpec profile contains integration tests for apache2 cookbook
55
supports:

0 commit comments

Comments
 (0)