Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,6 @@ jobs:
- ports
- ssl
- install-override
exclude:
- os: amazonlinux-2023
suite: mod-wsgi
- os: ubuntu-2404
suite: php
- os: opensuse-leap-15
suite: mod-auth-cas
- os: opensuse-leap-15
suite: wsgi
- os: opensuse-leap-15
suite: mod-wsgi
- os: debian-13
suite: php

steps:
- name: Check out code
Expand Down
14 changes: 8 additions & 6 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,10 @@ def apache_mod_php_filename
'libphp7.3.so'
elsif platform?('debian') && node['platform_version'].to_i == 11
'libphp7.4.so'
elsif platform?('debian') && node['platform_version'].to_i >= 12
elsif platform?('debian') && node['platform_version'].to_i == 12
'libphp8.2.so'
elsif platform?('debian') && node['platform_version'].to_i >= 13
'libphp8.4.so'
elsif platform?('ubuntu') && node['platform_version'].to_f == 18.04
'libphp7.2.so'
elsif platform?('ubuntu') && node['platform_version'].to_f == 20.04
Expand Down Expand Up @@ -470,7 +472,7 @@ def apache_mod_wsgi_package
case node['platform_family']
when 'debian'
'libapache2-mod-wsgi-py3'
when 'rhel', 'fedora'
when 'rhel', 'fedora', 'amazon'
# TODO: Remove when we no longer support RHEL 7
node['platform_version'].to_i >= 8 ? 'python3-mod_wsgi' : 'mod_wsgi'
when 'suse'
Expand All @@ -479,7 +481,7 @@ def apache_mod_wsgi_package
end

def apache_mod_wsgi_filename
if platform_family?('rhel', 'fedora') && node['platform_version'].to_i >= 8
if platform_family?('rhel', 'fedora', 'amazon') && node['platform_version'].to_i >= 8
'mod_wsgi_python3.so'
else
'mod_wsgi.so'
Expand All @@ -497,11 +499,11 @@ def apache_mod_auth_cas_install_method

def apache_mod_auth_cas_devel_packages
if platform_family?('rhel', 'amazon', 'fedora')
%w(openssl-devel libcurl-devel pcre-devel libtool)
%w(openssl-devel libcurl-devel pcre2-devel libtool)
elsif platform_family?('debian')
%w(libssl-dev libcurl4-openssl-dev libpcre++-dev libtool)
%w(libssl-dev libcurl4-openssl-dev libpcre2-dev libtool)
elsif platform_family?('suse')
%w(libopenssl-devel libcurl-devel pcre-devel libtool)
%w(libopenssl-devel libcurl-devel pcre2-devel libtool)
end
end
end
Expand Down
12 changes: 6 additions & 6 deletions spec/libraries/mod_auth_cas_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,37 +67,37 @@ class DummyClass < Chef::Node
context 'redhat 8' do
let(:platform_family) { 'rhel' }
let(:platform_version) { '8' }
it { expect(subject.apache_mod_auth_cas_devel_packages).to eq %w(openssl-devel libcurl-devel pcre-devel libtool) }
it { expect(subject.apache_mod_auth_cas_devel_packages).to eq %w(openssl-devel libcurl-devel pcre2-devel libtool) }
end

context 'redhat 7' do
let(:platform_family) { 'rhel' }
let(:platform_version) { '7' }
it { expect(subject.apache_mod_auth_cas_devel_packages).to eq %w(openssl-devel libcurl-devel pcre-devel libtool) }
it { expect(subject.apache_mod_auth_cas_devel_packages).to eq %w(openssl-devel libcurl-devel pcre2-devel libtool) }
end

context 'debian' do
let(:platform_family) { 'debian' }
let(:platform_version) { '11' }
it { expect(subject.apache_mod_auth_cas_devel_packages).to eq %w(libssl-dev libcurl4-openssl-dev libpcre++-dev libtool) }
it { expect(subject.apache_mod_auth_cas_devel_packages).to eq %w(libssl-dev libcurl4-openssl-dev libpcre2-dev libtool) }
end

context 'ubuntu' do
let(:platform_family) { 'debian' }
let(:platform_version) { '22.04' }
it { expect(subject.apache_mod_auth_cas_devel_packages).to eq %w(libssl-dev libcurl4-openssl-dev libpcre++-dev libtool) }
it { expect(subject.apache_mod_auth_cas_devel_packages).to eq %w(libssl-dev libcurl4-openssl-dev libpcre2-dev libtool) }
end

context 'amazonlinux' do
let(:platform_family) { 'amazon' }
let(:platform_version) { '2023' }
it { expect(subject.apache_mod_auth_cas_devel_packages).to eq %w(openssl-devel libcurl-devel pcre-devel libtool) }
it { expect(subject.apache_mod_auth_cas_devel_packages).to eq %w(openssl-devel libcurl-devel pcre2-devel libtool) }
end

context 'suse' do
let(:platform_family) { 'suse' }
let(:platform_version) { '15.1' }
it { expect(subject.apache_mod_auth_cas_devel_packages).to eq %w(libopenssl-devel libcurl-devel pcre-devel libtool) }
it { expect(subject.apache_mod_auth_cas_devel_packages).to eq %w(libopenssl-devel libcurl-devel pcre2-devel libtool) }
end
end
end
92 changes: 92 additions & 0 deletions spec/libraries/mod_php_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
require 'spec_helper'

RSpec.describe Apache2::Cookbook::Helpers do
class DummyClass < Chef::Node
include Apache2::Cookbook::Helpers
end

subject { DummyClass.new }

describe '#apache_mod_php_filename' do
before do
allow(subject).to receive(:[]).with('platform_family').and_return(platform_family)
allow(subject).to receive(:[]).with(:platform_family).and_return(platform_family)
allow(subject).to receive(:[]).with('platform_version').and_return(platform_version)
allow(subject).to receive(:[]).with('platform').and_return(platform)
allow(subject).to receive(:[]).with(:platform).and_return(platform)
end

context 'debian 12' do
let(:platform_family) { 'debian' }
let(:platform) { 'debian' }
let(:platform_version) { '12' }
it { expect(subject.apache_mod_php_filename).to eq 'libphp8.2.so' }
end

context 'debian 13' do
let(:platform_family) { 'debian' }
let(:platform) { 'debian' }
let(:platform_version) { '13' }
it { expect(subject.apache_mod_php_filename).to eq 'libphp8.4.so' }
end

context 'ubuntu 22.04' do
let(:platform_family) { 'debian' }
let(:platform) { 'ubuntu' }
let(:platform_version) { '22.04' }
it { expect(subject.apache_mod_php_filename).to eq 'libphp8.1.so' }
end

context 'ubuntu 24.04' do
let(:platform_family) { 'debian' }
let(:platform) { 'ubuntu' }
let(:platform_version) { '24.04' }
it { expect(subject.apache_mod_php_filename).to eq 'libphp8.3.so' }
end

context 'opensuse 15.5' do
let(:platform_family) { 'suse' }
let(:platform) { 'opensuse' }
let(:platform_version) { '15.5' }
it { expect(subject.apache_mod_php_filename).to eq 'mod_php8.so' }
end
end

describe '#apache_mod_php_modulename' do
before do
allow(subject).to receive(:[]).with('platform_family').and_return(platform_family)
allow(subject).to receive(:[]).with(:platform_family).and_return(platform_family)
allow(subject).to receive(:[]).with('platform_version').and_return(platform_version)
allow(subject).to receive(:[]).with('platform').and_return(platform)
allow(subject).to receive(:[]).with(:platform).and_return(platform)
end

context 'debian 12' do
let(:platform_family) { 'debian' }
let(:platform) { 'debian' }
let(:platform_version) { '12' }
it { expect(subject.apache_mod_php_modulename).to eq 'php_module' }
end

context 'debian 13' do
let(:platform_family) { 'debian' }
let(:platform) { 'debian' }
let(:platform_version) { '13' }
it { expect(subject.apache_mod_php_modulename).to eq 'php_module' }
end

context 'ubuntu 22.04' do
let(:platform_family) { 'debian' }
let(:platform) { 'ubuntu' }
let(:platform_version) { '22.04' }
it { expect(subject.apache_mod_php_modulename).to eq 'php_module' }
end

context 'ubuntu 24.04' do
let(:platform_family) { 'debian' }
let(:platform) { 'ubuntu' }
let(:platform_version) { '24.04' }
it { expect(subject.apache_mod_php_modulename).to eq 'php_module' }
end
end
end
8 changes: 4 additions & 4 deletions spec/libraries/mod_wsgi_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DummyClass < Chef::Node
context 'amazonlinux' do
let(:platform_family) { 'amazon' }
let(:platform_version) { '2023' }
it { expect(subject.apache_mod_wsgi_package).to eq nil }
it { expect(subject.apache_mod_wsgi_package).to eq 'python3-mod_wsgi' }
end

context 'suse' do
Expand Down Expand Up @@ -82,10 +82,10 @@ class DummyClass < Chef::Node
it { expect(subject.apache_mod_wsgi_filename).to eq 'mod_wsgi.so' }
end

context 'amazonlinux' do
context 'amazonlinux 2023' do
let(:platform_family) { 'amazon' }
let(:platform_version) { '2' }
it { expect(subject.apache_mod_wsgi_filename).to eq 'mod_wsgi.so' }
let(:platform_version) { '2023' }
it { expect(subject.apache_mod_wsgi_filename).to eq 'mod_wsgi_python3.so' }
end

context 'suse' do
Expand Down
Loading