Skip to content

Commit 3dd77f3

Browse files
Copilotdamacusramereth
authored
Fix failing test suites for amazonlinux-2023, ubuntu-2404, and opensuse-leap-15 (#825)
* Fix failing test suites for specific platform combinations Co-authored-by: damacus <40786+damacus@users.noreply.github.com> * Fix RSpec test for PHP module to expect PHP 8.3 on Ubuntu 24.04+ Co-authored-by: ramereth <48997+ramereth@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: damacus <40786+damacus@users.noreply.github.com> Co-authored-by: ramereth <48997+ramereth@users.noreply.github.com>
1 parent 2f934d6 commit 3dd77f3

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

kitchen.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ suites:
5454
- name: mod_wsgi
5555
run_list:
5656
- recipe[test::wsgi]
57-
excludes:
58-
- amazonlinux-2023
5957
- name: mod_auth_cas
6058
run_list:
6159
- recipe[test::auth_cas]

libraries/helpers.rb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,11 @@ def apache_mod_php_package
407407
when 'rhel'
408408
'mod_php'
409409
when 'suse'
410-
'apache2-mod_php7'
410+
if platform?('opensuse') && node['platform_version'].to_f >= 15.5
411+
'apache2-mod_php8'
412+
else
413+
'apache2-mod_php7'
414+
end
411415
end
412416
end
413417

@@ -444,16 +448,22 @@ def apache_mod_php_filename
444448
'libphp7.2.so'
445449
elsif platform?('ubuntu') && node['platform_version'].to_f == 20.04
446450
'libphp7.4.so'
447-
elsif platform?('ubuntu') && node['platform_version'].to_f >= 22.04
451+
elsif platform?('ubuntu') && node['platform_version'].to_f >= 22.04 && node['platform_version'].to_f < 24.04
448452
'libphp8.1.so'
453+
elsif platform?('ubuntu') && node['platform_version'].to_f >= 24.04
454+
'libphp8.3.so'
449455
else
450456
'libphp7.0.so'
451457
end
452458
when 'rhel'
453459
# TODO: Remove when we no longer support RHEL 7
454460
node['platform_version'].to_i >= 8 ? 'libphp7.so' : 'libphp5.so'
455461
when 'suse'
456-
'mod_php7.so'
462+
if platform?('opensuse') && node['platform_version'].to_f >= 15.5
463+
'mod_php8.so'
464+
else
465+
'mod_php7.so'
466+
end
457467
end
458468
end
459469

resources/mod_wsgi.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919
description: 'Whether to install the Apache WSGI module package'
2020

2121
action :create do
22-
raise 'apache2_mod_wsgi resource is not supported on amazonlinux' if platform?('amazon')
23-
2422
# install mod_wsgi package (if requested)
2523
package new_resource.package_name do
26-
only_if { new_resource.install_package }
24+
only_if { new_resource.install_package && !new_resource.package_name.nil? }
2725
notifies :delete, 'directory[purge distro conf.modules.d]', :immediately
2826
end
2927

spec/resources/mod_php_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
it do
3434
is_expected.to enable_apache2_module('php').with(
3535
identifier: 'php_module',
36-
mod_name: 'libphp8.1.so'
36+
mod_name: 'libphp8.3.so'
3737
)
3838
end
3939
end

0 commit comments

Comments
 (0)