From 43a749893084fbc451e90f418827b225e358e62d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Oct 2026 11:26:47 +0000 Subject: [PATCH 01/12] Initial plan From 3cbc8e022bae286a2bf5c6e34127220d43a8ad09 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Oct 2026 11:32:28 +0000 Subject: [PATCH 02/12] Adapt PHP specs to PHP 8 Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com> --- .../collection/{php-fpm7.rb => php-fpm8.rb} | 21 +- .../spec/collection/{php7.rb => php8.rb} | 14 +- .../spec/docker/php-apache-dev_spec.rb | 23 +- .../serverspec/spec/docker/php-apache_spec.rb | 23 +- tests/serverspec/spec/docker/php-dev_spec.rb | 16 +- .../spec/docker/php-nginx-dev_spec.rb | 23 +- .../serverspec/spec/docker/php-nginx_spec.rb | 24 +- .../spec/docker/php-official_spec.rb | 18 +- tests/serverspec/spec/docker/php_spec.rb | 18 +- tests/serverspec/spec/shared/php/fpm.rb | 27 +- tests/serverspec/spec/shared/php/modules.rb | 32 +-- tests/serverspec/spec/shared/php/test.rb | 24 +- tests/serverspec/spec/shared/php/version.rb | 12 +- tests/serverspec/spec/spec_config.rb | 25 -- tests/structure-test/php/5.6 | 1 - tests/structure-test/php/7.0 | 1 - tests/structure-test/php/7.1 | 1 - tests/structure-test/php/7.2/test.yaml | 231 ------------------ 18 files changed, 60 insertions(+), 474 deletions(-) rename tests/serverspec/spec/collection/{php-fpm7.rb => php-fpm8.rb} (66%) rename tests/serverspec/spec/collection/{php7.rb => php8.rb} (70%) delete mode 120000 tests/structure-test/php/5.6 delete mode 120000 tests/structure-test/php/7.0 delete mode 120000 tests/structure-test/php/7.1 delete mode 100644 tests/structure-test/php/7.2/test.yaml diff --git a/tests/serverspec/spec/collection/php-fpm7.rb b/tests/serverspec/spec/collection/php-fpm8.rb similarity index 66% rename from tests/serverspec/spec/collection/php-fpm7.rb rename to tests/serverspec/spec/collection/php-fpm8.rb index 6aeaae095..790ea8a10 100644 --- a/tests/serverspec/spec/collection/php-fpm7.rb +++ b/tests/serverspec/spec/collection/php-fpm8.rb @@ -1,9 +1,9 @@ -shared_examples 'collection::php-fpm7' do +shared_examples 'collection::php-fpm8' do include_examples 'php-fpm::layout' - include_examples 'php-fpm7::layout' + include_examples 'php-fpm8::layout' end -shared_examples 'collection::php-fpm7::public' do +shared_examples 'collection::php-fpm8::public' do # services include_examples 'php-fpm::listening::public' @@ -12,7 +12,7 @@ end -shared_examples 'collection::php-fpm7::local-only' do +shared_examples 'collection::php-fpm8::local-only' do # services include_examples 'php-fpm::listening::local-only' @@ -21,26 +21,25 @@ end -shared_examples 'collection::php-fpm7::webserver-test::development' do +shared_examples 'collection::php-fpm8::webserver-test::development' do include_examples 'php-fpm::modules' - include_examples 'php-fpm7::modules' + include_examples 'php-fpm8::modules' include_examples 'php-fpm::modules::development' include_examples 'php::fpm::test::sha1' include_examples 'php::fpm::test::php_ini_scanned_files' include_examples 'php::fpm::test::php_sapi_name' include_examples 'php::fpm::test::process_user_id' - include_examples 'php7::fpm::test::version' + include_examples 'php8::fpm::test::version' end -shared_examples 'collection::php-fpm7::webserver-test::production' do +shared_examples 'collection::php-fpm8::webserver-test::production' do include_examples 'php-fpm::modules' - include_examples 'php-fpm7::modules' + include_examples 'php-fpm8::modules' include_examples 'php-fpm::modules::production' include_examples 'php::fpm::test::sha1' include_examples 'php::fpm::test::php_ini_scanned_files' include_examples 'php::fpm::test::php_sapi_name' include_examples 'php::fpm::test::process_user_id' - include_examples 'php7::fpm::test::version' + include_examples 'php8::fpm::test::version' end - diff --git a/tests/serverspec/spec/collection/php7.rb b/tests/serverspec/spec/collection/php8.rb similarity index 70% rename from tests/serverspec/spec/collection/php7.rb rename to tests/serverspec/spec/collection/php8.rb index 614d4481f..44ba9fcff 100644 --- a/tests/serverspec/spec/collection/php7.rb +++ b/tests/serverspec/spec/collection/php8.rb @@ -1,9 +1,9 @@ -shared_examples 'collection::php7' do +shared_examples 'collection::php8' do include_examples 'php::layout' include_examples 'php::cli' - include_examples 'php7::cli::version' + include_examples 'php8::cli::version' include_examples 'php::modules' - include_examples 'php7::modules' + include_examples 'php8::modules' include_examples 'php::cli::configuration' include_examples 'php::cli::test::sha1' include_examples 'php::cli::test::php_ini_scanned_files' @@ -15,14 +15,14 @@ include_examples 'misc::ghostscript' end -shared_examples 'collection::php7::production' do - include_examples 'collection::php7' +shared_examples 'collection::php8::production' do + include_examples 'collection::php8' include_examples 'php::modules::production' include_examples 'php::cli::configuration::production' end -shared_examples 'collection::php7::development' do - include_examples 'collection::php7' +shared_examples 'collection::php8::development' do + include_examples 'collection::php8' include_examples 'php::modules::development' include_examples 'php::cli::configuration::development' end diff --git a/tests/serverspec/spec/docker/php-apache-dev_spec.rb b/tests/serverspec/spec/docker/php-apache-dev_spec.rb index 27cf09aac..547a58944 100644 --- a/tests/serverspec/spec/docker/php-apache-dev_spec.rb +++ b/tests/serverspec/spec/docker/php-apache-dev_spec.rb @@ -10,27 +10,14 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' if $testConfiguration[:php] == 8 - - if ($testConfiguration[:php] == 5) - include_examples 'collection::php5::development' - include_examples 'collection::php-fpm5' - include_examples 'collection::php-fpm5::public' - elsif ($testConfiguration[:php] == 8) - else - include_examples 'collection::php7::development' - include_examples 'collection::php-fpm7' - include_examples 'collection::php-fpm7::public' - end + include_examples 'php::modules::ftp_ssl' + include_examples 'collection::php8::development' + include_examples 'collection::php-fpm8' + include_examples 'collection::php-fpm8::public' include_examples 'collection::php-tools' include_examples 'collection::apache' - if ($testConfiguration[:php] == 5) - include_examples 'collection::php-fpm5::webserver-test::development' - elsif ($testConfiguration[:php] == 8) - else - include_examples 'collection::php-fpm7::webserver-test::development' - end + include_examples 'collection::php-fpm8::webserver-test::development' end diff --git a/tests/serverspec/spec/docker/php-apache_spec.rb b/tests/serverspec/spec/docker/php-apache_spec.rb index 5743644f2..d3ca35c34 100644 --- a/tests/serverspec/spec/docker/php-apache_spec.rb +++ b/tests/serverspec/spec/docker/php-apache_spec.rb @@ -10,26 +10,13 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' if $testConfiguration[:php] == 8 - - if ($testConfiguration[:php] == 5) - include_examples 'collection::php5::production' - include_examples 'collection::php-fpm5' - include_examples 'collection::php-fpm5::local-only' - elsif ($testConfiguration[:php] == 8) - else - include_examples 'collection::php7::production' - include_examples 'collection::php-fpm7' - include_examples 'collection::php-fpm7::local-only' - end + include_examples 'php::modules::ftp_ssl' + include_examples 'collection::php8::production' + include_examples 'collection::php-fpm8' + include_examples 'collection::php-fpm8::local-only' include_examples 'collection::apache' - if ($testConfiguration[:php] == 5) - include_examples 'collection::php-fpm5::webserver-test::production' - elsif ($testConfiguration[:php] == 8) - else - include_examples 'collection::php-fpm7::webserver-test::production' - end + include_examples 'collection::php-fpm8::webserver-test::production' end diff --git a/tests/serverspec/spec/docker/php-dev_spec.rb b/tests/serverspec/spec/docker/php-dev_spec.rb index c3b38c2ab..17fede686 100644 --- a/tests/serverspec/spec/docker/php-dev_spec.rb +++ b/tests/serverspec/spec/docker/php-dev_spec.rb @@ -10,18 +10,10 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' if $testConfiguration[:php] == 8 - - if ($testConfiguration[:php] == 5) - include_examples 'collection::php5::development' - include_examples 'collection::php-fpm5' - include_examples 'collection::php-fpm5::public' - elsif ($testConfiguration[:php] == 8) - else - include_examples 'collection::php7::development' - include_examples 'collection::php-fpm7' - include_examples 'collection::php-fpm7::public' - end + include_examples 'php::modules::ftp_ssl' + include_examples 'collection::php8::development' + include_examples 'collection::php-fpm8' + include_examples 'collection::php-fpm8::public' include_examples 'collection::php-tools' include_examples 'collection::development' diff --git a/tests/serverspec/spec/docker/php-nginx-dev_spec.rb b/tests/serverspec/spec/docker/php-nginx-dev_spec.rb index 7ce47bfe2..2696d6298 100644 --- a/tests/serverspec/spec/docker/php-nginx-dev_spec.rb +++ b/tests/serverspec/spec/docker/php-nginx-dev_spec.rb @@ -10,27 +10,14 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' if $testConfiguration[:php] == 8 - - if ($testConfiguration[:php] == 5) - include_examples 'collection::php5::development' - include_examples 'collection::php-fpm5' - include_examples 'collection::php-fpm5::public' - elsif ($testConfiguration[:php] == 8) - else - include_examples 'collection::php7::development' - include_examples 'collection::php-fpm7' - include_examples 'collection::php-fpm7::public' - end + include_examples 'php::modules::ftp_ssl' + include_examples 'collection::php8::development' + include_examples 'collection::php-fpm8' + include_examples 'collection::php-fpm8::public' include_examples 'collection::php-tools' include_examples 'collection::nginx' - if ($testConfiguration[:php] == 5) - include_examples 'collection::php-fpm5::webserver-test::development' - elsif ($testConfiguration[:php] == 8) - else - include_examples 'collection::php-fpm7::webserver-test::development' - end + include_examples 'collection::php-fpm8::webserver-test::development' end diff --git a/tests/serverspec/spec/docker/php-nginx_spec.rb b/tests/serverspec/spec/docker/php-nginx_spec.rb index d4c05b2fc..df8ca09df 100644 --- a/tests/serverspec/spec/docker/php-nginx_spec.rb +++ b/tests/serverspec/spec/docker/php-nginx_spec.rb @@ -10,26 +10,14 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' if $testConfiguration[:php] == 8 - - if ($testConfiguration[:php] == 5) - include_examples 'collection::php5::production' - include_examples 'collection::php-fpm5' - include_examples 'collection::php-fpm5::local-only' - elsif ($testConfiguration[:php] == 8) - else - include_examples 'collection::php7::production' - include_examples 'collection::php-fpm7' - include_examples 'collection::php-fpm7::local-only' - end + include_examples 'php::modules::ftp_ssl' + include_examples 'collection::php8::production' + include_examples 'collection::php-fpm8' + include_examples 'collection::php-fpm8::local-only' + include_examples 'php::cli::test::avif' include_examples 'collection::nginx' - if ($testConfiguration[:php] == 5) - include_examples 'collection::php-fpm5::webserver-test::production' - elsif ($testConfiguration[:php] == 8) - else - include_examples 'collection::php-fpm7::webserver-test::production' - end + include_examples 'collection::php-fpm8::webserver-test::production' end diff --git a/tests/serverspec/spec/docker/php-official_spec.rb b/tests/serverspec/spec/docker/php-official_spec.rb index 3be446158..f561271c7 100644 --- a/tests/serverspec/spec/docker/php-official_spec.rb +++ b/tests/serverspec/spec/docker/php-official_spec.rb @@ -10,18 +10,10 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' if $testConfiguration[:php] == 8 - - if ($testConfiguration[:php] == 5) - include_examples 'collection::php5::production' - include_examples 'collection::php-fpm5' - include_examples 'collection::php-fpm5::public' - elsif ($testConfiguration[:php] == 8) - include_examples 'php::cli::test::avif' - else - include_examples 'collection::php7::production' - include_examples 'collection::php-fpm7' - include_examples 'collection::php-fpm7::public' - end + include_examples 'php::modules::ftp_ssl' + include_examples 'collection::php8::production' + include_examples 'collection::php-fpm8' + include_examples 'collection::php-fpm8::public' + include_examples 'php::cli::test::avif' end diff --git a/tests/serverspec/spec/docker/php_spec.rb b/tests/serverspec/spec/docker/php_spec.rb index 3be446158..f561271c7 100644 --- a/tests/serverspec/spec/docker/php_spec.rb +++ b/tests/serverspec/spec/docker/php_spec.rb @@ -10,18 +10,10 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' if $testConfiguration[:php] == 8 - - if ($testConfiguration[:php] == 5) - include_examples 'collection::php5::production' - include_examples 'collection::php-fpm5' - include_examples 'collection::php-fpm5::public' - elsif ($testConfiguration[:php] == 8) - include_examples 'php::cli::test::avif' - else - include_examples 'collection::php7::production' - include_examples 'collection::php-fpm7' - include_examples 'collection::php-fpm7::public' - end + include_examples 'php::modules::ftp_ssl' + include_examples 'collection::php8::production' + include_examples 'collection::php-fpm8' + include_examples 'collection::php-fpm8::public' + include_examples 'php::cli::test::avif' end diff --git a/tests/serverspec/spec/shared/php/fpm.rb b/tests/serverspec/spec/shared/php/fpm.rb index dc961ce3a..56bb0cfbf 100644 --- a/tests/serverspec/spec/shared/php/fpm.rb +++ b/tests/serverspec/spec/shared/php/fpm.rb @@ -10,35 +10,12 @@ end end -shared_examples 'php-fpm5::layout' do - it "should have local php-fpm 5.x layout" do +shared_examples 'php-fpm8::layout' do + it "should have local php-fpm 8.x layout" do if $testConfiguration[:phpOfficialImage] expect(file("/usr/local/etc/php-fpm.d")).to be_symlink elsif os[:family] == 'redhat' expect(file("/etc/php-fpm.d")).to be_symlink - elsif ['debian', 'ubuntu'].include?(os[:family]) - expect(file("/etc/php5/fpm/pool.d")).to be_symlink - end - end -end - - -shared_examples 'php-fpm7::layout' do - it "should have local php-fpm 7.x layout" do - if $testConfiguration[:phpOfficialImage] - expect(file("/usr/local/etc/php-fpm.d")).to be_symlink - elsif os[:family] == 'redhat' - expect(file("/etc/php-fpm.d")).to be_symlink - elsif ['debian', 'ubuntu'].include?(os[:family]) - if (os[:family] == 'ubuntu' and os[:version] == '17.10') - expect(file("/etc/php/7.1/fpm/pool.d")).to be_symlink - elsif (os[:family] == 'ubuntu' and os[:version] == '18.04') - expect(file("/etc/php/7.2/fpm/pool.d")).to be_symlink - elsif (os[:family] == 'debian' and os[:version] == '10') - expect(file("/etc/php/7.3/fpm/pool.d")).to be_symlink - else - expect(file("/etc/php/7.0/fpm/pool.d")).to be_symlink - end end end end diff --git a/tests/serverspec/spec/shared/php/modules.rb b/tests/serverspec/spec/shared/php/modules.rb index c31fa720a..c96dd0efb 100644 --- a/tests/serverspec/spec/shared/php/modules.rb +++ b/tests/serverspec/spec/shared/php/modules.rb @@ -98,21 +98,7 @@ end end -shared_examples 'php5::modules' do - describe command('php -m') do - its(:stdout) { should contain('shmop') } - - if ( $testConfiguration[:phpRedis] ) - its(:stdout) { should contain('redis') } - else - its(:stdout) { should_not contain('redis') } - end - - its(:exit_status) { should eq 0 } - end -end - -shared_examples 'php7::modules' do +shared_examples 'php8::modules' do describe command('php -m') do its(:stdout) { should contain('Zend OPcache') } @@ -217,21 +203,7 @@ end end -shared_examples 'php-fpm5::modules' do - describe command('curl --insecure --silent --retry 10 --fail http://localhost/php-test.php?test=get_loaded_extensions') do - its(:stdout) { should contain('shmop') } - - if ( $testConfiguration[:phpRedis] ) - its(:stdout) { should contain('redis') } - else - its(:stdout) { should_not contain('redis') } - end - - its(:exit_status) { should eq 0 } - end -end - -shared_examples 'php-fpm7::modules' do +shared_examples 'php-fpm8::modules' do describe command('curl --insecure --silent --retry 10 --fail http://localhost/php-test.php?test=get_loaded_extensions') do its(:stdout) { should contain('Zend OPcache') } diff --git a/tests/serverspec/spec/shared/php/test.rb b/tests/serverspec/spec/shared/php/test.rb index f5013b15d..e1db58014 100644 --- a/tests/serverspec/spec/shared/php/test.rb +++ b/tests/serverspec/spec/shared/php/test.rb @@ -98,7 +98,7 @@ end end -shared_examples 'php5::fpm::test::version' do +shared_examples 'php8::fpm::test::version' do [ 'http://localhost/php-test.php?test=version', 'https://localhost/php-test.php?test=version' @@ -111,27 +111,7 @@ expect(cmd.stdout).not_to contain('PHP Warning') expect(cmd.stdout).not_to contain('Warning') expect(cmd.stdout).not_to contain('Fatal Error') - expect(cmd.stdout).to match %r!PHP 5\.[3-9]\.[0-9]{1,2}(-[^\(]*)?! - expect(cmd.exit_status).to eq 0 - end - end - end -end - -shared_examples 'php7::fpm::test::version' do - [ - 'http://localhost/php-test.php?test=version', - 'https://localhost/php-test.php?test=version' - ].each do |url| - describe url do - it "should have running and answering webserver", :retry => 20, :retry_wait => 3 do - cmd = command("curl --insecure --silent --retry 10 --fail #{url}") - expect(cmd.stdout).not_to contain('PHP Notice') - expect(cmd.stdout).not_to contain('Notice') - expect(cmd.stdout).not_to contain('PHP Warning') - expect(cmd.stdout).not_to contain('Warning') - expect(cmd.stdout).not_to contain('Fatal Error') - expect(cmd.stdout).to match %r!PHP (?:7|8)\.[0-9]\.[0-9]{1,2}(-[^\(]*)?! + expect(cmd.stdout).to match %r!PHP 8\.(?:[1-9][0-9]*)\.[0-9]+(-[^\(]*)?! expect(cmd.exit_status).to eq 0 end end diff --git a/tests/serverspec/spec/shared/php/version.rb b/tests/serverspec/spec/shared/php/version.rb index cb5906bd5..3d7e7bc43 100644 --- a/tests/serverspec/spec/shared/php/version.rb +++ b/tests/serverspec/spec/shared/php/version.rb @@ -1,14 +1,6 @@ -shared_examples 'php5::cli::version' do +shared_examples 'php8::cli::version' do describe command('php -v') do - its(:stdout) { should match %r!PHP 5\.[3-9]\.[0-9]{1,2}(-[^\(]*)? \(cli\)! } - - its(:exit_status) { should eq 0 } - end -end - -shared_examples 'php7::cli::version' do - describe command('php -v') do - its(:stdout) { should match %r!PHP (?:7|8)\.[0-9]\.[0-9]{1,2}(RC[0-9]|beta[0-9])?(-[^\(]*)? \(cli\)! } + its(:stdout) { should match %r!PHP 8\.(?:[1-9][0-9]*)\.[0-9]+(RC[0-9]|beta[0-9])?(-[^\(]*)? \(cli\)! } its(:exit_status) { should eq 0 } end diff --git a/tests/serverspec/spec/spec_config.rb b/tests/serverspec/spec/spec_config.rb index 2fd2ca8a5..188435ec6 100644 --- a/tests/serverspec/spec/spec_config.rb +++ b/tests/serverspec/spec/spec_config.rb @@ -35,37 +35,12 @@ $testConfiguration[:ansiblePath] = "/usr/local/bin" end -$testConfiguration[:php] = 7 $testConfiguration[:phpXdebug] = true $testConfiguration[:phpApcu] = true $testConfiguration[:phpRedis] = true $testConfiguration[:phpBlackfire] = false $testConfiguration[:phpOfficialImage] = false -if ((os[:family] == 'ubuntu' and os[:version] == '12.04') or - (os[:family] == 'ubuntu' and os[:version] == '14.04') or - (os[:family] == 'ubuntu' and os[:version] == '15.04') or - (os[:family] == 'ubuntu' and os[:version] == '15.10') or - (os[:family] == 'redhat' and os[:version] == '7') or - (os[:family] == 'debian' and os[:version] == '7') or - (os[:family] == 'debian' and os[:version] == '8') or - (ENV['DOCKER_TAG'].match('php5')) or - (ENV['DOCKER_TAG'].match('alpine-3')) or - (ENV['DOCKER_TAG'] =~ /^5\.[0-9]+/) - ) - $testConfiguration[:php] = 5 -end - -if ((ENV['DOCKER_TAG'].match('php7')) or - (ENV['DOCKER_TAG'] =~ /^7\.[0-9]+/) - ) - $testConfiguration[:php] = 7 -end - -if (ENV['DOCKER_TAG'] =~ /^8\.[0-9]+/) - $testConfiguration[:php] = 8 -end - if ENV['PHP_OFFICIAL'] and ENV['PHP_OFFICIAL'] == "1" $testConfiguration[:phpOfficialImage] = true end diff --git a/tests/structure-test/php/5.6 b/tests/structure-test/php/5.6 deleted file mode 120000 index be4cea5e2..000000000 --- a/tests/structure-test/php/5.6 +++ /dev/null @@ -1 +0,0 @@ -7.2 \ No newline at end of file diff --git a/tests/structure-test/php/7.0 b/tests/structure-test/php/7.0 deleted file mode 120000 index be4cea5e2..000000000 --- a/tests/structure-test/php/7.0 +++ /dev/null @@ -1 +0,0 @@ -7.2 \ No newline at end of file diff --git a/tests/structure-test/php/7.1 b/tests/structure-test/php/7.1 deleted file mode 120000 index be4cea5e2..000000000 --- a/tests/structure-test/php/7.1 +++ /dev/null @@ -1 +0,0 @@ -7.2 \ No newline at end of file diff --git a/tests/structure-test/php/7.2/test.yaml b/tests/structure-test/php/7.2/test.yaml deleted file mode 100644 index 46cd5a84c..000000000 --- a/tests/structure-test/php/7.2/test.yaml +++ /dev/null @@ -1,231 +0,0 @@ -schemaVersion: "2.0.0" - -metadataTest: -# base - entrypoint: ["/entrypoint"] - cmd: ["supervisord"] - envVars: - # bootstrap - - key: "LC_ALL" - value: "C.UTF-8" - - key: "LANG" - value: "C.UTF-8" - - key: "TERM" - value: "xterm" - # base - - key: "DOCKER_CONF_HOME" - value: "/opt/docker/" - - key: "LOG_STDOUT" - value: "" - - key: "LOG_STDERR" - value: "" - # base-app - - key: "APPLICATION_USER" - value: "application" - - key: "APPLICATION_GROUP" - value: "application" - - key: "APPLICATION_PATH" - value: "/app" - - key: "APPLICATION_UID" - value: "1000" - - key: "APPLICATION_GID" - value: "1000" - -fileExistenceTests: -# bootstrap - - name: 'apk add wrapper' - path: '/usr/local/bin/apk-install' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'apk upgrade wrapper' - path: '/usr/local/bin/apk-upgrade' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'apt-add-repository wrapper with auto cleanup' - path: '/usr/local/bin/apt-add-repository' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'apt-get install wrapper with auto cleanup' - path: '/usr/local/bin/apt-install' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'apt-get update wrapper for multiple apt-install runs' - path: '/usr/local/bin/apt-update' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'apt-get upgrade wrapper with auto cleanup' - path: '/usr/local/bin/apt-upgrade' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'yum install wrapper with auto cleanup' - path: '/usr/local/bin/yum-install' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'yum upgrade wrapper with auto cleanup' - path: '/usr/local/bin/yum-upgrade' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'Cleanup for docker images after package installations' - path: '/usr/local/bin/docker-image-cleanup' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'Gets information about the current docker images' - path: '/usr/local/bin/docker-image-info' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'Generates system locales' - path: '/usr/local/bin/generate-locales' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'Generates docker image info' - path: '/usr/local/bin/generate-dockerimage-info' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'Bootstrapping script' - path: '/usr/local/bin/docker-run-bootstrap' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'go-replace tool' - path: '/usr/local/bin/go-replace' - shouldExist: true - permissions: '-rwxr-xr-x' - - name: 'gosu tool' - path: '/sbin/gosu' - shouldExist: true - permissions: 'ugrwxr-xr-x' -# base - - name: 'bin: bootstrap script' - path: '/opt/docker/bin/bootstrap.sh' - shouldExist: true - permissions: '-rwxrwxrwx' - - name: 'bin: config script' - path: '/opt/docker/bin/config.sh' - shouldExist: true - permissions: '-rwxrwxrwx' - - name: 'bin: control script' - path: '/opt/docker/bin/control.sh' - shouldExist: true - permissions: '-rwxrwxrwx' - - name: 'bin: entrypoint script' - path: '/opt/docker/bin/entrypoint.sh' - shouldExist: true - permissions: '-rwxrwxrwx' - - name: 'bin: supervisor entrypoint script' - path: '/opt/docker/bin/service.d/supervisor.sh' - shouldExist: true - permissions: '-rwxrwxrwx' - - name: 'configfile: supervisor base' - path: '/opt/docker/etc/supervisor.conf' - shouldExist: true - permissions: '-rw-rw-rw-' - - name: 'configfile: supervisor service cron' - path: '/opt/docker/etc/supervisor.d/cron.conf' - shouldExist: true - permissions: '-rw-rw-rw-' - - name: 'configfile: supervisor service dnsmasq' - path: '/opt/docker/etc/supervisor.d/dnsmasq.conf' - shouldExist: true - permissions: '-rw-rw-rw-' - - name: 'configfile: supervisor service postfix' - path: '/opt/docker/etc/supervisor.d/postfix.conf' - shouldExist: true - permissions: '-rw-rw-rw-' - - name: 'configfile: supervisor service ssh' - path: '/opt/docker/etc/supervisor.d/ssh.conf' - shouldExist: true - permissions: '-rw-rw-rw-' - - name: 'configfile: supervisor service syslog' - path: '/opt/docker/etc/supervisor.d/syslog.conf' - shouldExist: true - permissions: '-rw-rw-rw-' - - name: 'configfile: logrotate' - path: '/opt/docker/etc/logrotate.d/syslog-ng' - shouldExist: true - permissions: '-rw-rw-rw-' - - name: 'configfile: syslog-ng' - path: '/opt/docker/etc/syslog-ng/syslog-ng.conf' - shouldExist: true - permissions: '-rw-rw-rw-' - - name: 'provisioning: cron' - path: '/opt/docker/provision/service.d/cron.sh' - shouldExist: false - - name: 'provisioning: dnsmasq' - path: '/opt/docker/provision/service.d/dnsmasq.sh' - shouldExist: true - permissions: '-rw-rw-rw-' - - name: 'provisioning: postfix' - path: '/opt/docker/provision/service.d/postfix.sh' - shouldExist: true - permissions: '-rw-rw-rw-' - - name: 'provisioning: ssh' - path: '/opt/docker/provision/service.d/ssh.sh' - shouldExist: true - permissions: '-rw-rw-rw-' - - name: 'provisioning: syslog' - path: '/opt/docker/provision/service.d/syslog.sh' - shouldExist: false -# base-app - - name: 'provision: add application user script was deleted after execution' - path: '/opt/docker/provision/bootstrap.d/10-user-application.sh' - shouldExist: false - - name: 'provision: set permission script was deleted after execution' - path: '/opt/docker/provision/bootstrap.d/20-app.sh' - shouldExist: false - - name: 'app folder exists' - path: '/app' - shouldExist: true - permissions: 'drwxr-xr-x' - uid: 1000 - gid: 1000 - -commandTests: -# base - - name: "supervisord" - command: "which" - args: ["supervisord"] - expectedOutput: ["/usr/bin/supervisord"] - - name: "wget" - command: "which" - args: ["wget"] - expectedOutput: ["/usr/bin/wget"] - - name: "curl" - command: "which" - args: ["curl"] - expectedOutput: ["/usr/bin/curl"] - - name: "zic" - command: "which" - args: ["zic"] - expectedOutput: ["/usr/sbin/zic"] -# base-app - - name: "application user and group exists" - command: "id" - args: ["application"] - expectedOutput: ['uid\=1000\(application\) gid\=1000\(application\) groups\=1000\(application\)'] - - name: "zip" - command: "which" - args: ["zip"] - expectedOutput: ["/usr/bin/zip"] - - name: "unzip" - command: "which" - args: ["unzip"] - expectedOutput: ["/usr/bin/unzip"] - - name: "nslookup" - command: "which" - args: ["nslookup"] - expectedOutput: ["/usr/bin/nslookup"] - - name: "ssh" - command: "which" - args: ["ssh"] - expectedOutput: ["/usr/bin/ssh"] - - name: "rsync" - command: "which" - args: ["rsync"] - expectedOutput: ["/usr/bin/rsync"] - - name: "git" - command: "which" - args: ["git"] - expectedOutput: ["/usr/bin/git"] - - name: "patch" - command: "which" - args: ["patch"] - expectedOutput: ["/usr/bin/patch"] From 0014f306e6a87d071a14324daaa005f9a317b04c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Oct 2026 11:35:59 +0000 Subject: [PATCH 03/12] Enforce PHP 8.1 test minimum Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com> --- tests/serverspec/spec/docker/php-nginx_spec.rb | 1 - tests/serverspec/spec/shared/php/configuration.rb | 8 -------- tests/structure-test/php/test.yaml | 5 ++++- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/tests/serverspec/spec/docker/php-nginx_spec.rb b/tests/serverspec/spec/docker/php-nginx_spec.rb index df8ca09df..f48cfa4aa 100644 --- a/tests/serverspec/spec/docker/php-nginx_spec.rb +++ b/tests/serverspec/spec/docker/php-nginx_spec.rb @@ -14,7 +14,6 @@ include_examples 'collection::php8::production' include_examples 'collection::php-fpm8' include_examples 'collection::php-fpm8::local-only' - include_examples 'php::cli::test::avif' include_examples 'collection::nginx' diff --git a/tests/serverspec/spec/shared/php/configuration.rb b/tests/serverspec/spec/shared/php/configuration.rb index 0b47cb8af..3d2e1041a 100644 --- a/tests/serverspec/spec/shared/php/configuration.rb +++ b/tests/serverspec/spec/shared/php/configuration.rb @@ -82,10 +82,6 @@ context php_config('opcache.max_accelerated_files') do its(:value) { should eq 7963 } end - - context php_config('opcache.fast_shutdown') do - its(:value) { should eq 1 } - end end end @@ -125,9 +121,5 @@ context php_config('opcache.max_accelerated_files') do its(:value) { should eq 7963 } end - - context php_config('opcache.fast_shutdown') do - its(:value) { should eq 1 } - end end end diff --git a/tests/structure-test/php/test.yaml b/tests/structure-test/php/test.yaml index 9d1ca021e..e95028bdc 100644 --- a/tests/structure-test/php/test.yaml +++ b/tests/structure-test/php/test.yaml @@ -35,6 +35,10 @@ fileContentTests: expectedContents: ['autostart = true'] commandTests: + - name: "PHP version is 8.1 or newer" + command: "php" + args: ["-v"] + expectedOutput: ['PHP 8\.[1-9][0-9]*\.'] - name: "fpm config test" command: "/usr/local/bin/php-fpm" args: ["-t"] @@ -125,4 +129,3 @@ commandTests: - "Zend OPcache" - "zip" - "zlib" - From 4df57ce2684358a807c95b8c79bdfad450cd8281 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Oct 2026 11:48:01 +0000 Subject: [PATCH 04/12] Restore PHP 8 shmop and Redis checks Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com> --- tests/serverspec/spec/shared/php/modules.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/serverspec/spec/shared/php/modules.rb b/tests/serverspec/spec/shared/php/modules.rb index c96dd0efb..dd3caf50a 100644 --- a/tests/serverspec/spec/shared/php/modules.rb +++ b/tests/serverspec/spec/shared/php/modules.rb @@ -100,10 +100,13 @@ shared_examples 'php8::modules' do describe command('php -m') do + its(:stdout) { should contain('shmop') } its(:stdout) { should contain('Zend OPcache') } if ( $testConfiguration[:phpRedis] ) its(:stdout) { should contain('redis') } + else + its(:stdout) { should_not contain('redis') } end its(:exit_status) { should eq 0 } @@ -205,6 +208,7 @@ shared_examples 'php-fpm8::modules' do describe command('curl --insecure --silent --retry 10 --fail http://localhost/php-test.php?test=get_loaded_extensions') do + its(:stdout) { should contain('shmop') } its(:stdout) { should contain('Zend OPcache') } if ( $testConfiguration[:phpRedis] ) From 716fe11d8b6fe1848b2d13fb05eaa62a9811ca4c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Oct 2026 11:55:51 +0000 Subject: [PATCH 05/12] Rename PHP version-specific specs Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com> --- .../collection/{php-fpm8.rb => php-fpm.rb} | 20 +++++++++---------- .../spec/collection/{php8.rb => php.rb} | 14 ++++++------- .../spec/docker/php-apache-dev_spec.rb | 8 ++++---- .../serverspec/spec/docker/php-apache_spec.rb | 8 ++++---- tests/serverspec/spec/docker/php-dev_spec.rb | 6 +++--- .../spec/docker/php-nginx-dev_spec.rb | 8 ++++---- .../serverspec/spec/docker/php-nginx_spec.rb | 8 ++++---- .../spec/docker/php-official_spec.rb | 6 +++--- tests/serverspec/spec/docker/php_spec.rb | 6 +++--- tests/serverspec/spec/shared/php/fpm.rb | 2 +- tests/serverspec/spec/shared/php/modules.rb | 4 ++-- tests/serverspec/spec/shared/php/test.rb | 2 +- tests/serverspec/spec/shared/php/version.rb | 2 +- 13 files changed, 47 insertions(+), 47 deletions(-) rename tests/serverspec/spec/collection/{php-fpm8.rb => php-fpm.rb} (64%) rename tests/serverspec/spec/collection/{php8.rb => php.rb} (69%) diff --git a/tests/serverspec/spec/collection/php-fpm8.rb b/tests/serverspec/spec/collection/php-fpm.rb similarity index 64% rename from tests/serverspec/spec/collection/php-fpm8.rb rename to tests/serverspec/spec/collection/php-fpm.rb index 790ea8a10..45cd91a68 100644 --- a/tests/serverspec/spec/collection/php-fpm8.rb +++ b/tests/serverspec/spec/collection/php-fpm.rb @@ -1,9 +1,9 @@ -shared_examples 'collection::php-fpm8' do +shared_examples 'collection::php-fpm' do include_examples 'php-fpm::layout' - include_examples 'php-fpm8::layout' + include_examples 'php-fpm::versioned::layout' end -shared_examples 'collection::php-fpm8::public' do +shared_examples 'collection::php-fpm::public' do # services include_examples 'php-fpm::listening::public' @@ -12,7 +12,7 @@ end -shared_examples 'collection::php-fpm8::local-only' do +shared_examples 'collection::php-fpm::local-only' do # services include_examples 'php-fpm::listening::local-only' @@ -21,25 +21,25 @@ end -shared_examples 'collection::php-fpm8::webserver-test::development' do +shared_examples 'collection::php-fpm::webserver-test::development' do include_examples 'php-fpm::modules' - include_examples 'php-fpm8::modules' + include_examples 'php-fpm::versioned::modules' include_examples 'php-fpm::modules::development' include_examples 'php::fpm::test::sha1' include_examples 'php::fpm::test::php_ini_scanned_files' include_examples 'php::fpm::test::php_sapi_name' include_examples 'php::fpm::test::process_user_id' - include_examples 'php8::fpm::test::version' + include_examples 'php::fpm::test::version' end -shared_examples 'collection::php-fpm8::webserver-test::production' do +shared_examples 'collection::php-fpm::webserver-test::production' do include_examples 'php-fpm::modules' - include_examples 'php-fpm8::modules' + include_examples 'php-fpm::versioned::modules' include_examples 'php-fpm::modules::production' include_examples 'php::fpm::test::sha1' include_examples 'php::fpm::test::php_ini_scanned_files' include_examples 'php::fpm::test::php_sapi_name' include_examples 'php::fpm::test::process_user_id' - include_examples 'php8::fpm::test::version' + include_examples 'php::fpm::test::version' end diff --git a/tests/serverspec/spec/collection/php8.rb b/tests/serverspec/spec/collection/php.rb similarity index 69% rename from tests/serverspec/spec/collection/php8.rb rename to tests/serverspec/spec/collection/php.rb index 44ba9fcff..6e88ffc79 100644 --- a/tests/serverspec/spec/collection/php8.rb +++ b/tests/serverspec/spec/collection/php.rb @@ -1,9 +1,9 @@ -shared_examples 'collection::php8' do +shared_examples 'collection::php' do include_examples 'php::layout' include_examples 'php::cli' - include_examples 'php8::cli::version' + include_examples 'php::cli::version' include_examples 'php::modules' - include_examples 'php8::modules' + include_examples 'php::modules::versioned' include_examples 'php::cli::configuration' include_examples 'php::cli::test::sha1' include_examples 'php::cli::test::php_ini_scanned_files' @@ -15,14 +15,14 @@ include_examples 'misc::ghostscript' end -shared_examples 'collection::php8::production' do - include_examples 'collection::php8' +shared_examples 'collection::php::production' do + include_examples 'collection::php' include_examples 'php::modules::production' include_examples 'php::cli::configuration::production' end -shared_examples 'collection::php8::development' do - include_examples 'collection::php8' +shared_examples 'collection::php::development' do + include_examples 'collection::php' include_examples 'php::modules::development' include_examples 'php::cli::configuration::development' end diff --git a/tests/serverspec/spec/docker/php-apache-dev_spec.rb b/tests/serverspec/spec/docker/php-apache-dev_spec.rb index 547a58944..f2f06eb6a 100644 --- a/tests/serverspec/spec/docker/php-apache-dev_spec.rb +++ b/tests/serverspec/spec/docker/php-apache-dev_spec.rb @@ -11,13 +11,13 @@ include_examples 'collection::base' include_examples 'collection::base-app' include_examples 'php::modules::ftp_ssl' - include_examples 'collection::php8::development' - include_examples 'collection::php-fpm8' - include_examples 'collection::php-fpm8::public' + include_examples 'collection::php::development' + include_examples 'collection::php-fpm' + include_examples 'collection::php-fpm::public' include_examples 'collection::php-tools' include_examples 'collection::apache' - include_examples 'collection::php-fpm8::webserver-test::development' + include_examples 'collection::php-fpm::webserver-test::development' end diff --git a/tests/serverspec/spec/docker/php-apache_spec.rb b/tests/serverspec/spec/docker/php-apache_spec.rb index d3ca35c34..106535154 100644 --- a/tests/serverspec/spec/docker/php-apache_spec.rb +++ b/tests/serverspec/spec/docker/php-apache_spec.rb @@ -11,12 +11,12 @@ include_examples 'collection::base' include_examples 'collection::base-app' include_examples 'php::modules::ftp_ssl' - include_examples 'collection::php8::production' - include_examples 'collection::php-fpm8' - include_examples 'collection::php-fpm8::local-only' + include_examples 'collection::php::production' + include_examples 'collection::php-fpm' + include_examples 'collection::php-fpm::local-only' include_examples 'collection::apache' - include_examples 'collection::php-fpm8::webserver-test::production' + include_examples 'collection::php-fpm::webserver-test::production' end diff --git a/tests/serverspec/spec/docker/php-dev_spec.rb b/tests/serverspec/spec/docker/php-dev_spec.rb index 17fede686..e8e348781 100644 --- a/tests/serverspec/spec/docker/php-dev_spec.rb +++ b/tests/serverspec/spec/docker/php-dev_spec.rb @@ -11,9 +11,9 @@ include_examples 'collection::base' include_examples 'collection::base-app' include_examples 'php::modules::ftp_ssl' - include_examples 'collection::php8::development' - include_examples 'collection::php-fpm8' - include_examples 'collection::php-fpm8::public' + include_examples 'collection::php::development' + include_examples 'collection::php-fpm' + include_examples 'collection::php-fpm::public' include_examples 'collection::php-tools' include_examples 'collection::development' diff --git a/tests/serverspec/spec/docker/php-nginx-dev_spec.rb b/tests/serverspec/spec/docker/php-nginx-dev_spec.rb index 2696d6298..c538ef350 100644 --- a/tests/serverspec/spec/docker/php-nginx-dev_spec.rb +++ b/tests/serverspec/spec/docker/php-nginx-dev_spec.rb @@ -11,13 +11,13 @@ include_examples 'collection::base' include_examples 'collection::base-app' include_examples 'php::modules::ftp_ssl' - include_examples 'collection::php8::development' - include_examples 'collection::php-fpm8' - include_examples 'collection::php-fpm8::public' + include_examples 'collection::php::development' + include_examples 'collection::php-fpm' + include_examples 'collection::php-fpm::public' include_examples 'collection::php-tools' include_examples 'collection::nginx' - include_examples 'collection::php-fpm8::webserver-test::development' + include_examples 'collection::php-fpm::webserver-test::development' end diff --git a/tests/serverspec/spec/docker/php-nginx_spec.rb b/tests/serverspec/spec/docker/php-nginx_spec.rb index f48cfa4aa..599ecd5d7 100644 --- a/tests/serverspec/spec/docker/php-nginx_spec.rb +++ b/tests/serverspec/spec/docker/php-nginx_spec.rb @@ -11,12 +11,12 @@ include_examples 'collection::base' include_examples 'collection::base-app' include_examples 'php::modules::ftp_ssl' - include_examples 'collection::php8::production' - include_examples 'collection::php-fpm8' - include_examples 'collection::php-fpm8::local-only' + include_examples 'collection::php::production' + include_examples 'collection::php-fpm' + include_examples 'collection::php-fpm::local-only' include_examples 'collection::nginx' - include_examples 'collection::php-fpm8::webserver-test::production' + include_examples 'collection::php-fpm::webserver-test::production' end diff --git a/tests/serverspec/spec/docker/php-official_spec.rb b/tests/serverspec/spec/docker/php-official_spec.rb index f561271c7..142870329 100644 --- a/tests/serverspec/spec/docker/php-official_spec.rb +++ b/tests/serverspec/spec/docker/php-official_spec.rb @@ -11,9 +11,9 @@ include_examples 'collection::base' include_examples 'collection::base-app' include_examples 'php::modules::ftp_ssl' - include_examples 'collection::php8::production' - include_examples 'collection::php-fpm8' - include_examples 'collection::php-fpm8::public' + include_examples 'collection::php::production' + include_examples 'collection::php-fpm' + include_examples 'collection::php-fpm::public' include_examples 'php::cli::test::avif' end diff --git a/tests/serverspec/spec/docker/php_spec.rb b/tests/serverspec/spec/docker/php_spec.rb index f561271c7..142870329 100644 --- a/tests/serverspec/spec/docker/php_spec.rb +++ b/tests/serverspec/spec/docker/php_spec.rb @@ -11,9 +11,9 @@ include_examples 'collection::base' include_examples 'collection::base-app' include_examples 'php::modules::ftp_ssl' - include_examples 'collection::php8::production' - include_examples 'collection::php-fpm8' - include_examples 'collection::php-fpm8::public' + include_examples 'collection::php::production' + include_examples 'collection::php-fpm' + include_examples 'collection::php-fpm::public' include_examples 'php::cli::test::avif' end diff --git a/tests/serverspec/spec/shared/php/fpm.rb b/tests/serverspec/spec/shared/php/fpm.rb index 56bb0cfbf..d281b626c 100644 --- a/tests/serverspec/spec/shared/php/fpm.rb +++ b/tests/serverspec/spec/shared/php/fpm.rb @@ -10,7 +10,7 @@ end end -shared_examples 'php-fpm8::layout' do +shared_examples 'php-fpm::versioned::layout' do it "should have local php-fpm 8.x layout" do if $testConfiguration[:phpOfficialImage] expect(file("/usr/local/etc/php-fpm.d")).to be_symlink diff --git a/tests/serverspec/spec/shared/php/modules.rb b/tests/serverspec/spec/shared/php/modules.rb index dd3caf50a..cbad785c3 100644 --- a/tests/serverspec/spec/shared/php/modules.rb +++ b/tests/serverspec/spec/shared/php/modules.rb @@ -98,7 +98,7 @@ end end -shared_examples 'php8::modules' do +shared_examples 'php::modules::versioned' do describe command('php -m') do its(:stdout) { should contain('shmop') } its(:stdout) { should contain('Zend OPcache') } @@ -206,7 +206,7 @@ end end -shared_examples 'php-fpm8::modules' do +shared_examples 'php-fpm::versioned::modules' do describe command('curl --insecure --silent --retry 10 --fail http://localhost/php-test.php?test=get_loaded_extensions') do its(:stdout) { should contain('shmop') } its(:stdout) { should contain('Zend OPcache') } diff --git a/tests/serverspec/spec/shared/php/test.rb b/tests/serverspec/spec/shared/php/test.rb index e1db58014..c7348d915 100644 --- a/tests/serverspec/spec/shared/php/test.rb +++ b/tests/serverspec/spec/shared/php/test.rb @@ -98,7 +98,7 @@ end end -shared_examples 'php8::fpm::test::version' do +shared_examples 'php::fpm::test::version' do [ 'http://localhost/php-test.php?test=version', 'https://localhost/php-test.php?test=version' diff --git a/tests/serverspec/spec/shared/php/version.rb b/tests/serverspec/spec/shared/php/version.rb index 3d7e7bc43..56f33d702 100644 --- a/tests/serverspec/spec/shared/php/version.rb +++ b/tests/serverspec/spec/shared/php/version.rb @@ -1,4 +1,4 @@ -shared_examples 'php8::cli::version' do +shared_examples 'php::cli::version' do describe command('php -v') do its(:stdout) { should match %r!PHP 8\.(?:[1-9][0-9]*)\.[0-9]+(RC[0-9]|beta[0-9])?(-[^\(]*)? \(cli\)! } From ef809261d318ee8c3c799f1a410e5aa3b06de0ce Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Oct 2026 12:22:45 +0000 Subject: [PATCH 06/12] Centralize baseline PHP checks Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com> --- tests/serverspec/spec/collection/php.rb | 2 ++ tests/serverspec/spec/docker/php-apache-dev_spec.rb | 1 - tests/serverspec/spec/docker/php-apache_spec.rb | 1 - tests/serverspec/spec/docker/php-dev_spec.rb | 1 - tests/serverspec/spec/docker/php-nginx-dev_spec.rb | 1 - tests/serverspec/spec/docker/php-nginx_spec.rb | 1 - tests/serverspec/spec/docker/php-official_spec.rb | 2 -- tests/serverspec/spec/docker/php_spec.rb | 2 -- 8 files changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/serverspec/spec/collection/php.rb b/tests/serverspec/spec/collection/php.rb index 6e88ffc79..914642ec3 100644 --- a/tests/serverspec/spec/collection/php.rb +++ b/tests/serverspec/spec/collection/php.rb @@ -2,10 +2,12 @@ include_examples 'php::layout' include_examples 'php::cli' include_examples 'php::cli::version' + include_examples 'php::modules::ftp_ssl' include_examples 'php::modules' include_examples 'php::modules::versioned' include_examples 'php::cli::configuration' include_examples 'php::cli::test::sha1' + include_examples 'php::cli::test::avif' include_examples 'php::cli::test::php_ini_scanned_files' include_examples 'php::cli::test::php_sapi_name' include_examples 'php::composer' diff --git a/tests/serverspec/spec/docker/php-apache-dev_spec.rb b/tests/serverspec/spec/docker/php-apache-dev_spec.rb index f2f06eb6a..f1c4edb91 100644 --- a/tests/serverspec/spec/docker/php-apache-dev_spec.rb +++ b/tests/serverspec/spec/docker/php-apache-dev_spec.rb @@ -10,7 +10,6 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' include_examples 'collection::php::development' include_examples 'collection::php-fpm' include_examples 'collection::php-fpm::public' diff --git a/tests/serverspec/spec/docker/php-apache_spec.rb b/tests/serverspec/spec/docker/php-apache_spec.rb index 106535154..7603ea456 100644 --- a/tests/serverspec/spec/docker/php-apache_spec.rb +++ b/tests/serverspec/spec/docker/php-apache_spec.rb @@ -10,7 +10,6 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' include_examples 'collection::php::production' include_examples 'collection::php-fpm' include_examples 'collection::php-fpm::local-only' diff --git a/tests/serverspec/spec/docker/php-dev_spec.rb b/tests/serverspec/spec/docker/php-dev_spec.rb index e8e348781..e15eae94c 100644 --- a/tests/serverspec/spec/docker/php-dev_spec.rb +++ b/tests/serverspec/spec/docker/php-dev_spec.rb @@ -10,7 +10,6 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' include_examples 'collection::php::development' include_examples 'collection::php-fpm' include_examples 'collection::php-fpm::public' diff --git a/tests/serverspec/spec/docker/php-nginx-dev_spec.rb b/tests/serverspec/spec/docker/php-nginx-dev_spec.rb index c538ef350..358c85a1c 100644 --- a/tests/serverspec/spec/docker/php-nginx-dev_spec.rb +++ b/tests/serverspec/spec/docker/php-nginx-dev_spec.rb @@ -10,7 +10,6 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' include_examples 'collection::php::development' include_examples 'collection::php-fpm' include_examples 'collection::php-fpm::public' diff --git a/tests/serverspec/spec/docker/php-nginx_spec.rb b/tests/serverspec/spec/docker/php-nginx_spec.rb index 599ecd5d7..8e458f157 100644 --- a/tests/serverspec/spec/docker/php-nginx_spec.rb +++ b/tests/serverspec/spec/docker/php-nginx_spec.rb @@ -10,7 +10,6 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' include_examples 'collection::php::production' include_examples 'collection::php-fpm' include_examples 'collection::php-fpm::local-only' diff --git a/tests/serverspec/spec/docker/php-official_spec.rb b/tests/serverspec/spec/docker/php-official_spec.rb index 142870329..f5bafaeaf 100644 --- a/tests/serverspec/spec/docker/php-official_spec.rb +++ b/tests/serverspec/spec/docker/php-official_spec.rb @@ -10,10 +10,8 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' include_examples 'collection::php::production' include_examples 'collection::php-fpm' include_examples 'collection::php-fpm::public' - include_examples 'php::cli::test::avif' end diff --git a/tests/serverspec/spec/docker/php_spec.rb b/tests/serverspec/spec/docker/php_spec.rb index 142870329..f5bafaeaf 100644 --- a/tests/serverspec/spec/docker/php_spec.rb +++ b/tests/serverspec/spec/docker/php_spec.rb @@ -10,10 +10,8 @@ include_examples 'collection::bootstrap' include_examples 'collection::base' include_examples 'collection::base-app' - include_examples 'php::modules::ftp_ssl' include_examples 'collection::php::production' include_examples 'collection::php-fpm' include_examples 'collection::php-fpm::public' - include_examples 'php::cli::test::avif' end From 3a33eb820d859f0e971e05cdbf1cc6a23b4d3d7b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Oct 2026 13:23:53 +0000 Subject: [PATCH 07/12] Restore relevant PHP structure-test coverage Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com> --- tests/structure-test/php/test.yaml | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tests/structure-test/php/test.yaml b/tests/structure-test/php/test.yaml index e95028bdc..022c2651c 100644 --- a/tests/structure-test/php/test.yaml +++ b/tests/structure-test/php/test.yaml @@ -2,6 +2,17 @@ schemaVersion: "2.0.0" metadataTest: exposedPorts: ["9000"] + envVars: + - key: "APPLICATION_USER" + value: "application" + - key: "APPLICATION_GROUP" + value: "application" + - key: "APPLICATION_PATH" + value: "/app" + - key: "APPLICATION_UID" + value: "1000" + - key: "APPLICATION_GID" + value: "1000" fileExistenceTests: - name: 'provision: set php version variable script was deleted after execution' @@ -25,6 +36,17 @@ fileExistenceTests: - name: 'supervisor: fpm starter exists' path: '/opt/docker/etc/supervisor.d/php-fpm.conf' shouldExist: true + - name: 'provision: add application user script was deleted after execution' + path: '/opt/docker/provision/bootstrap.d/10-user-application.sh' + shouldExist: false + - name: 'provision: set permission script was deleted after execution' + path: '/opt/docker/provision/bootstrap.d/20-app.sh' + shouldExist: false + - name: 'app folder exists and is owned by the application user' + path: '/app' + shouldExist: true + uid: 1000 + gid: 1000 fileContentTests: - name: 'supervisor: syslog service is enabled' @@ -35,6 +57,34 @@ fileContentTests: expectedContents: ['autostart = true'] commandTests: + - name: "zip" + command: "which" + args: ["zip"] + expectedOutput: ["/usr/bin/zip"] + - name: "unzip" + command: "which" + args: ["unzip"] + expectedOutput: ["/usr/bin/unzip"] + - name: "nslookup" + command: "which" + args: ["nslookup"] + expectedOutput: ["/usr/bin/nslookup"] + - name: "ssh" + command: "which" + args: ["ssh"] + expectedOutput: ["/usr/bin/ssh"] + - name: "rsync" + command: "which" + args: ["rsync"] + expectedOutput: ["/usr/bin/rsync"] + - name: "git" + command: "which" + args: ["git"] + expectedOutput: ["/usr/bin/git"] + - name: "patch" + command: "which" + args: ["patch"] + expectedOutput: ["/usr/bin/patch"] - name: "PHP version is 8.1 or newer" command: "php" args: ["-v"] From d9b47e8fde9e76eda8bd52ec0ccd037518a839a0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 1 Oct 2026 13:33:33 +0000 Subject: [PATCH 08/12] Add PHP base metadata structure assertions Co-authored-by: Kanti <471387+Kanti@users.noreply.github.com> --- tests/structure-test/php/test.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/structure-test/php/test.yaml b/tests/structure-test/php/test.yaml index 022c2651c..54261ad82 100644 --- a/tests/structure-test/php/test.yaml +++ b/tests/structure-test/php/test.yaml @@ -1,8 +1,22 @@ schemaVersion: "2.0.0" metadataTest: + entrypoint: ["/entrypoint"] + cmd: ["supervisord"] exposedPorts: ["9000"] envVars: + - key: "LC_ALL" + value: "C.UTF-8" + - key: "LANG" + value: "C.UTF-8" + - key: "TERM" + value: "xterm" + - key: "DOCKER_CONF_HOME" + value: "/opt/docker/" + - key: "LOG_STDOUT" + value: "" + - key: "LOG_STDERR" + value: "" - key: "APPLICATION_USER" value: "application" - key: "APPLICATION_GROUP" From 5489827a8aeafd11cfec45916b4ffd6e60b58f31 Mon Sep 17 00:00:00 2001 From: Matthias Vogel Date: Fri, 2 Oct 2026 12:13:28 +0200 Subject: [PATCH 09/12] [BUGFIX] Fix PHP 8.1 IMAP dependency and public development FPM listeners Retain libc-client2007e after build cleanup so PHP 8.1 can load IMAP. Include PHP 8.1 in the dedicated IMAP tests. Update every development FPM config to preserve public listening. Prevent later pool configs from restoring the localhost listener. Regenerate Dockerfiles and provisioning scripts from their sources. --- .../8.1-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../php-apache-dev/8.1/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../8.2-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../php-apache-dev/8.2/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../8.3-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../php-apache-dev/8.3/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../8.4-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../php-apache-dev/8.4/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../8.5-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../php-apache-dev/8.5/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../php-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- docker/php-dev/8.1/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../php-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- docker/php-dev/8.2/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../php-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- docker/php-dev/8.3/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../php-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- docker/php-dev/8.4/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../php-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- docker/php-dev/8.5/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../8.1-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- docker/php-nginx-dev/8.1/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../8.2-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- docker/php-nginx-dev/8.2/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../8.3-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- docker/php-nginx-dev/8.3/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../8.4-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- docker/php-nginx-dev/8.4/conf/provision/bootstrap.d/10-php.sh | 4 ++-- .../8.5-alpine/conf/provision/bootstrap.d/10-php.sh | 4 ++-- docker/php-nginx-dev/8.5/conf/provision/bootstrap.d/10-php.sh | 4 ++-- docker/php-official/8.1/Dockerfile | 1 + provisioning/php-dev/general/provision/bootstrap.d/10-php.sh | 4 ++-- template/Dockerfile/images/php.jinja2 | 2 +- tests/serverspec/spec/spec_config.rb | 2 +- 34 files changed, 65 insertions(+), 64 deletions(-) diff --git a/docker/php-apache-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-apache-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-apache-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-apache-dev/8.1/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache-dev/8.1/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-apache-dev/8.1/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-apache-dev/8.1/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-apache-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-apache-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-apache-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-apache-dev/8.2/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache-dev/8.2/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-apache-dev/8.2/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-apache-dev/8.2/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-apache-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-apache-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-apache-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-apache-dev/8.3/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache-dev/8.3/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-apache-dev/8.3/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-apache-dev/8.3/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-apache-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-apache-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-apache-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-apache-dev/8.4/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache-dev/8.4/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-apache-dev/8.4/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-apache-dev/8.4/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-apache-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-apache-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-apache-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-apache-dev/8.5/conf/provision/bootstrap.d/10-php.sh b/docker/php-apache-dev/8.5/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-apache-dev/8.5/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-apache-dev/8.5/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-dev/8.1/conf/provision/bootstrap.d/10-php.sh b/docker/php-dev/8.1/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-dev/8.1/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-dev/8.1/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-dev/8.2/conf/provision/bootstrap.d/10-php.sh b/docker/php-dev/8.2/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-dev/8.2/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-dev/8.2/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-dev/8.3/conf/provision/bootstrap.d/10-php.sh b/docker/php-dev/8.3/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-dev/8.3/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-dev/8.3/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-dev/8.4/conf/provision/bootstrap.d/10-php.sh b/docker/php-dev/8.4/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-dev/8.4/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-dev/8.4/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-dev/8.5/conf/provision/bootstrap.d/10-php.sh b/docker/php-dev/8.5/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-dev/8.5/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-dev/8.5/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-nginx-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-nginx-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-nginx-dev/8.1-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-nginx-dev/8.1/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx-dev/8.1/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-nginx-dev/8.1/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-nginx-dev/8.1/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-nginx-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-nginx-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-nginx-dev/8.2-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-nginx-dev/8.2/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx-dev/8.2/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-nginx-dev/8.2/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-nginx-dev/8.2/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-nginx-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-nginx-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-nginx-dev/8.3-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-nginx-dev/8.3/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx-dev/8.3/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-nginx-dev/8.3/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-nginx-dev/8.3/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-nginx-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-nginx-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-nginx-dev/8.4-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-nginx-dev/8.4/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx-dev/8.4/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-nginx-dev/8.4/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-nginx-dev/8.4/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-nginx-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-nginx-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-nginx-dev/8.5-alpine/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-nginx-dev/8.5/conf/provision/bootstrap.d/10-php.sh b/docker/php-nginx-dev/8.5/conf/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/docker/php-nginx-dev/8.5/conf/provision/bootstrap.d/10-php.sh +++ b/docker/php-nginx-dev/8.5/conf/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/docker/php-official/8.1/Dockerfile b/docker/php-official/8.1/Dockerfile index 3c2d82437..eb9ea7de3 100644 --- a/docker/php-official/8.1/Dockerfile +++ b/docker/php-official/8.1/Dockerfile @@ -106,6 +106,7 @@ RUN set -x \ libpng16-16 \ libmcrypt4 \ libzip4 \ + libc-client2007e \ # Dev and headers libavif-dev \ libjpeg62-turbo-dev \ diff --git a/provisioning/php-dev/general/provision/bootstrap.d/10-php.sh b/provisioning/php-dev/general/provision/bootstrap.d/10-php.sh index 852567f85..59b4f08b8 100644 --- a/provisioning/php-dev/general/provision/bootstrap.d/10-php.sh +++ b/provisioning/php-dev/general/provision/bootstrap.d/10-php.sh @@ -18,7 +18,7 @@ else # listen on public IPv6 port go-replace --mode=line --regex \ -s '^[\s;]*listen[\s]*=' -r 'listen = [::]:9000' \ - -- /opt/docker/etc/php/fpm/pool.d/application.conf \ - /opt/docker/etc/php/fpm/php-fpm.conf + --path=/opt/docker/etc/php/fpm/ \ + --path-pattern='*.conf' fi diff --git a/template/Dockerfile/images/php.jinja2 b/template/Dockerfile/images/php.jinja2 index f9a1af398..f2abcda45 100644 --- a/template/Dockerfile/images/php.jinja2 +++ b/template/Dockerfile/images/php.jinja2 @@ -33,7 +33,7 @@ libpng16-16 \ libmcrypt4 \ libzip4 \ -{%- if version == '8.2' or version == '8.3' %} +{%- if version == '8.1' or version == '8.2' or version == '8.3' %} libc-client2007e \ {%- endif %} # Dev and headers diff --git a/tests/serverspec/spec/spec_config.rb b/tests/serverspec/spec/spec_config.rb index 9aac5d8ec..d82312f36 100644 --- a/tests/serverspec/spec/spec_config.rb +++ b/tests/serverspec/spec/spec_config.rb @@ -40,7 +40,7 @@ $testConfiguration[:phpRedis] = true $testConfiguration[:phpBlackfire] = false $testConfiguration[:phpOfficialImage] = false -$testConfiguration[:phpImap] = !!(ENV['DOCKER_TAG'] =~ /^8\.[23](-|$)/) +$testConfiguration[:phpImap] = !!(ENV['DOCKER_TAG'] =~ /^8\.[123](-|$)/) if ENV['PHP_OFFICIAL'] and ENV['PHP_OFFICIAL'] == "1" $testConfiguration[:phpOfficialImage] = true From 4c866c161d1fd4d3be702881e4f239ef6ad9acd8 Mon Sep 17 00:00:00 2001 From: Matthias Vogel Date: Fri, 2 Oct 2026 12:50:23 +0200 Subject: [PATCH 10/12] Add PHP extension coverage and Debian YAML support Assert installed PHP extensions in CLI and FPM so missing modules are detected by Serverspec and structure tests. Keep IMAP version guards and reuse the structure-test module list for both SAPIs. Install and enable YAML in Debian PHP images, retain its runtime library after build cleanup, and regenerate the PHP 8.1-8.5 Dockerfiles. Validation: 207 focused Serverspec examples and 87 structure checks passed across Debian PHP 8.1/8.5 and Alpine PHP 8.5. --- docker/php-official/8.1/Dockerfile | 5 +++ docker/php-official/8.2/Dockerfile | 5 +++ docker/php-official/8.3/Dockerfile | 5 +++ docker/php-official/8.4/Dockerfile | 5 +++ docker/php-official/8.5/Dockerfile | 5 +++ template/Dockerfile/images/php.jinja2 | 5 +++ tests/serverspec/spec/shared/php/modules.rb | 38 ++++++++++++++++++--- tests/structure-test/php/test.yaml | 17 ++++++++- 8 files changed, 80 insertions(+), 5 deletions(-) diff --git a/docker/php-official/8.1/Dockerfile b/docker/php-official/8.1/Dockerfile index eb9ea7de3..6074944e0 100644 --- a/docker/php-official/8.1/Dockerfile +++ b/docker/php-official/8.1/Dockerfile @@ -106,6 +106,7 @@ RUN set -x \ libpng16-16 \ libmcrypt4 \ libzip4 \ + libyaml-0-2 \ libc-client2007e \ # Dev and headers libavif-dev \ @@ -131,6 +132,7 @@ RUN set -x \ librabbitmq-dev \ libmagick++-dev \ libgmp-dev \ + libyaml-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ && unzip master.zip \ @@ -184,6 +186,7 @@ RUN set -x \ && pecl install protobuf-4.33.5 \ && pecl install xmlrpc-1.0.0RC3 \ && pecl install vips \ + && pecl install yaml \ && pecl install redis \ && pecl install mongodb \ && echo extension=apcu.so > /usr/local/etc/php/conf.d/apcu.ini \ @@ -194,6 +197,7 @@ RUN set -x \ && echo extension=mongodb.so > /usr/local/etc/php/conf.d/mongodb.ini \ && echo extension=memcached.so > /usr/local/etc/php/conf.d/memcached.ini \ && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ + && echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \ && echo extension=xmlrpc.so > /usr/local/etc/php/conf.d/xmlrpc.ini \ # Uninstall dev and header packages && apt-get purge -y -f --force-yes \ @@ -217,6 +221,7 @@ RUN set -x \ librabbitmq-dev \ libmagick++-dev \ libgmp-dev \ + libyaml-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer1 --1 \ diff --git a/docker/php-official/8.2/Dockerfile b/docker/php-official/8.2/Dockerfile index 60832e904..56b23a928 100644 --- a/docker/php-official/8.2/Dockerfile +++ b/docker/php-official/8.2/Dockerfile @@ -106,6 +106,7 @@ RUN set -x \ libpng16-16 \ libmcrypt4 \ libzip4 \ + libyaml-0-2 \ libc-client2007e \ # Dev and headers libavif-dev \ @@ -131,6 +132,7 @@ RUN set -x \ librabbitmq-dev \ libmagick++-dev \ libgmp-dev \ + libyaml-dev \ libssl-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ @@ -186,6 +188,7 @@ RUN set -x \ && pecl install protobuf \ && pecl install xmlrpc-1.0.0RC3 \ && pecl install vips \ + && pecl install yaml \ && pecl install redis \ && pecl install mongodb \ && echo extension=apcu.so > /usr/local/etc/php/conf.d/apcu.ini \ @@ -196,6 +199,7 @@ RUN set -x \ && echo extension=mongodb.so > /usr/local/etc/php/conf.d/mongodb.ini \ && echo extension=memcached.so > /usr/local/etc/php/conf.d/memcached.ini \ && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ + && echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \ && echo extension=xmlrpc.so > /usr/local/etc/php/conf.d/xmlrpc.ini \ # Uninstall dev and header packages && apt-get purge -y -f --force-yes \ @@ -219,6 +223,7 @@ RUN set -x \ librabbitmq-dev \ libmagick++-dev \ libgmp-dev \ + libyaml-dev \ libssl-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ diff --git a/docker/php-official/8.3/Dockerfile b/docker/php-official/8.3/Dockerfile index d6fedee3a..f36323278 100644 --- a/docker/php-official/8.3/Dockerfile +++ b/docker/php-official/8.3/Dockerfile @@ -106,6 +106,7 @@ RUN set -x \ libpng16-16 \ libmcrypt4 \ libzip4 \ + libyaml-0-2 \ libc-client2007e \ # Dev and headers libavif-dev \ @@ -131,6 +132,7 @@ RUN set -x \ librabbitmq-dev \ libmagick++-dev \ libgmp-dev \ + libyaml-dev \ libssl-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ @@ -186,6 +188,7 @@ RUN set -x \ && pecl install protobuf \ && pecl install xmlrpc-1.0.0RC3 \ && pecl install vips \ + && pecl install yaml \ && pecl install redis \ && pecl install mongodb \ && echo extension=apcu.so > /usr/local/etc/php/conf.d/apcu.ini \ @@ -196,6 +199,7 @@ RUN set -x \ && echo extension=mongodb.so > /usr/local/etc/php/conf.d/mongodb.ini \ && echo extension=memcached.so > /usr/local/etc/php/conf.d/memcached.ini \ && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ + && echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \ && echo extension=xmlrpc.so > /usr/local/etc/php/conf.d/xmlrpc.ini \ # Uninstall dev and header packages && apt-get purge -y -f --force-yes \ @@ -219,6 +223,7 @@ RUN set -x \ librabbitmq-dev \ libmagick++-dev \ libgmp-dev \ + libyaml-dev \ libssl-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ diff --git a/docker/php-official/8.4/Dockerfile b/docker/php-official/8.4/Dockerfile index 421233301..95a78d9ca 100644 --- a/docker/php-official/8.4/Dockerfile +++ b/docker/php-official/8.4/Dockerfile @@ -106,6 +106,7 @@ RUN set -x \ libpng16-16 \ libmcrypt4 \ libzip4 \ + libyaml-0-2 \ # Dev and headers libavif-dev \ libjpeg62-turbo-dev \ @@ -130,6 +131,7 @@ RUN set -x \ librabbitmq-dev \ libmagick++-dev \ libgmp-dev \ + libyaml-dev \ libssl-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ @@ -183,6 +185,7 @@ RUN set -x \ && pecl install protobuf \ && pecl install xmlrpc-1.0.0RC3 \ && pecl install vips \ + && pecl install yaml \ && pecl install redis \ && pecl install mongodb \ && echo extension=apcu.so > /usr/local/etc/php/conf.d/apcu.ini \ @@ -193,6 +196,7 @@ RUN set -x \ && echo extension=mongodb.so > /usr/local/etc/php/conf.d/mongodb.ini \ && echo extension=memcached.so > /usr/local/etc/php/conf.d/memcached.ini \ && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ + && echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \ && echo extension=xmlrpc.so > /usr/local/etc/php/conf.d/xmlrpc.ini \ # Uninstall dev and header packages && apt-get purge -y -f --force-yes \ @@ -216,6 +220,7 @@ RUN set -x \ librabbitmq-dev \ libmagick++-dev \ libgmp-dev \ + libyaml-dev \ libssl-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ diff --git a/docker/php-official/8.5/Dockerfile b/docker/php-official/8.5/Dockerfile index 095371531..2bf88ab40 100644 --- a/docker/php-official/8.5/Dockerfile +++ b/docker/php-official/8.5/Dockerfile @@ -106,6 +106,7 @@ RUN set -x \ libpng16-16 \ libmcrypt4 \ libzip4 \ + libyaml-0-2 \ # Dev and headers libavif-dev \ libjpeg62-turbo-dev \ @@ -130,6 +131,7 @@ RUN set -x \ librabbitmq-dev \ libmagick++-dev \ libgmp-dev \ + libyaml-dev \ libssl-dev \ # Install guetzli && wget https://github.com/google/guetzli/archive/master.zip \ @@ -182,6 +184,7 @@ RUN set -x \ && pecl install protobuf \ && pecl install xmlrpc-1.0.0RC3 \ && pecl install vips \ + && pecl install yaml \ && pecl install redis \ && pecl install mongodb \ && echo extension=apcu.so > /usr/local/etc/php/conf.d/apcu.ini \ @@ -192,6 +195,7 @@ RUN set -x \ && echo extension=mongodb.so > /usr/local/etc/php/conf.d/mongodb.ini \ && echo extension=memcached.so > /usr/local/etc/php/conf.d/memcached.ini \ && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ + && echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \ && echo extension=xmlrpc.so > /usr/local/etc/php/conf.d/xmlrpc.ini \ # Uninstall dev and header packages && apt-get purge -y -f --force-yes \ @@ -215,6 +219,7 @@ RUN set -x \ librabbitmq-dev \ libmagick++-dev \ libgmp-dev \ + libyaml-dev \ libssl-dev \ && rm -f /usr/local/etc/php-fpm.d/zz-docker.conf \ && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer2 \ diff --git a/template/Dockerfile/images/php.jinja2 b/template/Dockerfile/images/php.jinja2 index f2abcda45..7a27302cc 100644 --- a/template/Dockerfile/images/php.jinja2 +++ b/template/Dockerfile/images/php.jinja2 @@ -33,6 +33,7 @@ libpng16-16 \ libmcrypt4 \ libzip4 \ + libyaml-0-2 \ {%- if version == '8.1' or version == '8.2' or version == '8.3' %} libc-client2007e \ {%- endif %} @@ -60,6 +61,7 @@ librabbitmq-dev \ libmagick++-dev \ libgmp-dev \ + libyaml-dev \ {%- if version == '8.2' or version == '8.3' or version == '8.4' or version == '8.5' %} libssl-dev \ {%- endif %} @@ -131,6 +133,7 @@ {%- endif %} && pecl install xmlrpc-1.0.0RC3 \ && pecl install vips \ + && pecl install yaml \ && pecl install redis \ && pecl install mongodb \ && echo extension=apcu.so > /usr/local/etc/php/conf.d/apcu.ini \ @@ -141,6 +144,7 @@ && echo extension=mongodb.so > /usr/local/etc/php/conf.d/mongodb.ini \ && echo extension=memcached.so > /usr/local/etc/php/conf.d/memcached.ini \ && echo extension=vips.so > /usr/local/etc/php/conf.d/vips.ini \ + && echo extension=yaml.so > /usr/local/etc/php/conf.d/yaml.ini \ && echo extension=xmlrpc.so > /usr/local/etc/php/conf.d/xmlrpc.ini \ # Uninstall dev and header packages && apt-get purge -y -f --force-yes \ @@ -164,6 +168,7 @@ librabbitmq-dev \ libmagick++-dev \ libgmp-dev \ + libyaml-dev \ {%- if version == '8.2' or version == '8.3' or version == '8.4' or version == '8.5' %} libssl-dev \ {%- endif %} diff --git a/tests/serverspec/spec/shared/php/modules.rb b/tests/serverspec/spec/shared/php/modules.rb index cbad785c3..a14878e64 100644 --- a/tests/serverspec/spec/shared/php/modules.rb +++ b/tests/serverspec/spec/shared/php/modules.rb @@ -4,6 +4,7 @@ shared_examples 'php::modules' do describe command('php -m') do + its(:stdout) { should contain('amqp') } its(:stdout) { should contain('bcmath') } its(:stdout) { should contain('bz2') } its(:stdout) { should contain('calendar') } @@ -13,26 +14,38 @@ its(:stdout) { should contain('date') } its(:stdout) { should contain('dom') } its(:stdout) { should contain('exif') } + its(:stdout) { should contain('excimer') } + its(:stdout) { should contain('FFI') } its(:stdout) { should contain('fileinfo') } its(:stdout) { should contain('filter') } its(:stdout) { should contain('ftp') } its(:stdout) { should contain('gettext') } + its(:stdout) { should contain('gmp') } its(:stdout) { should contain('hash') } its(:stdout) { should contain('iconv') } + its(:stdout) { should contain('imagick') } + its(:stdout) { should contain('imap') } if $testConfiguration[:phpImap] + its(:stdout) { should contain('intl') } its(:stdout) { should contain('json') } - #its(:stdout) { should contain('ldap') } + its(:stdout) { should contain('ldap') } its(:stdout) { should contain('libxml') } its(:stdout) { should contain('mbstring') } + its(:stdout) { should contain('memcached') } + its(:stdout) { should contain('mongodb') } its(:stdout) { should contain('mysqli') } its(:stdout) { should contain('mysqlnd') } its(:stdout) { should contain('openssl') } + its(:stdout) { should contain('opentelemetry') } its(:stdout) { should contain('pcntl') } its(:stdout) { should contain('pcre') } its(:stdout) { should contain('PDO') } its(:stdout) { should contain('pdo_mysql') } + its(:stdout) { should contain('pdo_pgsql') } its(:stdout) { should contain('pdo_sqlite') } + its(:stdout) { should contain('pgsql') } its(:stdout) { should contain('Phar') } its(:stdout) { should contain('posix') } + its(:stdout) { should contain('protobuf') } its(:stdout) { should contain('Reflection') } its(:stdout) { should contain('session') } its(:stdout) { should contain('SimpleXML') } @@ -45,11 +58,13 @@ its(:stdout) { should contain('sysvsem') } its(:stdout) { should contain('sysvshm') } its(:stdout) { should contain('tokenizer') } + its(:stdout) { should contain('vips') } its(:stdout) { should contain('xml') } its(:stdout) { should contain('xmlreader') } - #its(:stdout) { should contain('xmlrpc') } + its(:stdout) { should contain('xmlrpc') } its(:stdout) { should contain('xmlwriter') } its(:stdout) { should contain('xsl') } + its(:stdout) { should contain('yaml') } its(:stdout) { should contain('zip') } its(:stdout) { should contain('zlib') } its(:stdout) { should contain('gd') } @@ -119,6 +134,7 @@ shared_examples 'php-fpm::modules' do describe command('curl --insecure --silent --retry 10 --fail http://localhost/php-test.php?test=get_loaded_extensions') do + its(:stdout) { should contain('amqp') } its(:stdout) { should contain('bcmath') } its(:stdout) { should contain('bz2') } its(:stdout) { should contain('calendar') } @@ -128,26 +144,38 @@ its(:stdout) { should contain('date') } its(:stdout) { should contain('dom') } its(:stdout) { should contain('exif') } + its(:stdout) { should contain('excimer') } + its(:stdout) { should contain('FFI') } its(:stdout) { should contain('fileinfo') } its(:stdout) { should contain('filter') } its(:stdout) { should contain('ftp') } its(:stdout) { should contain('gettext') } + its(:stdout) { should contain('gmp') } its(:stdout) { should contain('hash') } its(:stdout) { should contain('iconv') } + its(:stdout) { should contain('imagick') } + its(:stdout) { should contain('imap') } if $testConfiguration[:phpImap] + its(:stdout) { should contain('intl') } its(:stdout) { should contain('json') } - #its(:stdout) { should contain('ldap') } + its(:stdout) { should contain('ldap') } its(:stdout) { should contain('libxml') } its(:stdout) { should contain('mbstring') } + its(:stdout) { should contain('memcached') } + its(:stdout) { should contain('mongodb') } its(:stdout) { should contain('mysqli') } its(:stdout) { should contain('mysqlnd') } its(:stdout) { should contain('openssl') } + its(:stdout) { should contain('opentelemetry') } #its(:stdout) { should_not contain('pcntl') } # disabled by fpm its(:stdout) { should contain('pcre') } its(:stdout) { should contain('PDO') } its(:stdout) { should contain('pdo_mysql') } + its(:stdout) { should contain('pdo_pgsql') } its(:stdout) { should contain('pdo_sqlite') } + its(:stdout) { should contain('pgsql') } its(:stdout) { should contain('Phar') } its(:stdout) { should contain('posix') } + its(:stdout) { should contain('protobuf') } its(:stdout) { should contain('Reflection') } its(:stdout) { should contain('session') } its(:stdout) { should contain('SimpleXML') } @@ -160,11 +188,13 @@ its(:stdout) { should contain('sysvsem') } its(:stdout) { should contain('sysvshm') } its(:stdout) { should contain('tokenizer') } + its(:stdout) { should contain('vips') } its(:stdout) { should contain('xml') } its(:stdout) { should contain('xmlreader') } - # its(:stdout) { should contain('xmlrpc') } + its(:stdout) { should contain('xmlrpc') } its(:stdout) { should contain('xmlwriter') } its(:stdout) { should contain('xsl') } + its(:stdout) { should contain('yaml') } its(:stdout) { should contain('zip') } its(:stdout) { should contain('zlib') } its(:stdout) { should contain('gd') } diff --git a/tests/structure-test/php/test.yaml b/tests/structure-test/php/test.yaml index 54261ad82..7e4a9d69d 100644 --- a/tests/structure-test/php/test.yaml +++ b/tests/structure-test/php/test.yaml @@ -59,6 +59,7 @@ fileExistenceTests: - name: 'app folder exists and is owned by the application user' path: '/app' shouldExist: true + permissions: 'drwxr-xr-x' uid: 1000 gid: 1000 @@ -134,7 +135,8 @@ commandTests: - name: "php modules" command: "php" args: ["-m"] - expectedOutput: + expectedOutput: &phpModules + - "amqp" - "apcu" - "bcmath" - "bz2" @@ -145,22 +147,28 @@ commandTests: - "date" - "dom" - "exif" + - "excimer" + - "FFI" - "fileinfo" - "filter" - "ftp" - "gd" - "gettext" + - "gmp" - "hash" - "iconv" + - "imagick" - "intl" - "json" - "ldap" - "libxml" - "mbstring" - "memcached" + - "mongodb" - "mysqli" - "mysqlnd" - "openssl" + - "opentelemetry" - "pcntl" - "pcre" - "PDO" @@ -170,6 +178,7 @@ commandTests: - "pgsql" - "Phar" - "posix" + - "protobuf" - "readline" - "redis" - "Reflection" @@ -185,11 +194,17 @@ commandTests: - "sysvsem" - "sysvshm" - "tokenizer" + - "vips" - "xml" - "xmlreader" - "xmlrpc" - "xmlwriter" - "xsl" + - "yaml" - "Zend OPcache" - "zip" - "zlib" + - name: "fpm modules" + command: "/usr/local/bin/php-fpm" + args: ["-m"] + expectedOutput: *phpModules From 614253048e37b87d4ae358e2e2e21f78b056838a Mon Sep 17 00:00:00 2001 From: Matthias Vogel Date: Fri, 2 Oct 2026 13:23:38 +0200 Subject: [PATCH 11/12] Verify PHP minor versions against Docker tags Derive the expected CLI and FPM versions from DOCKER_TAG so images running the wrong PHP minor version fail their version checks. Support Alpine tag suffixes and preserve existing prerelease matching. Validation: 92 matcher cases passed. Matching and mismatched tags were verified against Debian PHP 8.1 and Alpine PHP 8.5 through CLI and HTTP/HTTPS FPM checks. --- tests/serverspec/spec/shared/php/test.rb | 2 +- tests/serverspec/spec/shared/php/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/serverspec/spec/shared/php/test.rb b/tests/serverspec/spec/shared/php/test.rb index dd7d57d4d..45a50fa39 100644 --- a/tests/serverspec/spec/shared/php/test.rb +++ b/tests/serverspec/spec/shared/php/test.rb @@ -126,7 +126,7 @@ expect(cmd.stdout).not_to contain('PHP Warning') expect(cmd.stdout).not_to contain('Warning') expect(cmd.stdout).not_to contain('Fatal Error') - expect(cmd.stdout).to match %r!PHP 8\.(?:[1-9][0-9]*)\.[0-9]+(-[^\(]*)?! + expect(cmd.stdout).to match %r!PHP #{Regexp.escape(ENV.fetch('DOCKER_TAG').split('-', 2).first)}\.[0-9]+(-[^\(]*)?! expect(cmd.exit_status).to eq 0 end end diff --git a/tests/serverspec/spec/shared/php/version.rb b/tests/serverspec/spec/shared/php/version.rb index 56f33d702..aaaa62ae5 100644 --- a/tests/serverspec/spec/shared/php/version.rb +++ b/tests/serverspec/spec/shared/php/version.rb @@ -1,6 +1,6 @@ shared_examples 'php::cli::version' do describe command('php -v') do - its(:stdout) { should match %r!PHP 8\.(?:[1-9][0-9]*)\.[0-9]+(RC[0-9]|beta[0-9])?(-[^\(]*)? \(cli\)! } + its(:stdout) { should match %r!PHP #{Regexp.escape(ENV.fetch('DOCKER_TAG').split('-', 2).first)}\.[0-9]+(RC[0-9]|beta[0-9])?(-[^\(]*)? \(cli\)! } its(:exit_status) { should eq 0 } end From a8cffc75106b2c1c56d83cd2839b06224a09d682 Mon Sep 17 00:00:00 2001 From: Matthias Vogel Date: Fri, 2 Oct 2026 14:03:17 +0200 Subject: [PATCH 12/12] Restore final PHP image provisioning checks Restore coverage lost when the PHP 7.2 structure suite was removed. Check that enabled-service installers are deleted, optional installers remain in the base PHP image, and bootstrap helpers stay executable. Keep the zic check Debian-only and use current file permissions without duplicating assertions already covered by shared Serverspec tests. Validation: 329 focused Serverspec examples and 102 structure checks passed on Debian and Alpine, including helper checks on a development image. --- tests/serverspec/spec/shared/php/layout.rb | 12 ++++++++++++ tests/structure-test/php/test.yaml | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/tests/serverspec/spec/shared/php/layout.rb b/tests/serverspec/spec/shared/php/layout.rb index 21a37c6ea..9405f2c1a 100644 --- a/tests/serverspec/spec/shared/php/layout.rb +++ b/tests/serverspec/spec/shared/php/layout.rb @@ -36,6 +36,13 @@ [ "/opt/docker/bin/service.d/php-fpm.sh", "/opt/docker/bin/service.d/php-fpm.d/10-init.sh", + "/usr/local/bin/apt-add-repository", + "/usr/local/bin/apt-update", + "/usr/local/bin/docker-image-cleanup", + "/usr/local/bin/generate-locales", + "/usr/local/bin/generate-dockerimage-info", + "/usr/local/bin/docker-run-bootstrap", + "/sbin/gosu", ].each do |file| describe file("#{file}") do # Type check @@ -62,4 +69,9 @@ it { should be_executable.by('others') } end end + + describe file('/usr/sbin/zic'), :if => os[:family] == 'debian' do + it { should be_file } + it { should be_executable } + end end diff --git a/tests/structure-test/php/test.yaml b/tests/structure-test/php/test.yaml index 7e4a9d69d..4ae5937d0 100644 --- a/tests/structure-test/php/test.yaml +++ b/tests/structure-test/php/test.yaml @@ -35,6 +35,12 @@ fileExistenceTests: - name: 'provision: set permission script was deleted after execution' path: '/opt/docker/provision/bootstrap.d/11-php-conf.sh' shouldExist: false + - name: 'provision: cron installer was deleted after enabling the service' + path: '/opt/docker/provision/service.d/cron.sh' + shouldExist: false + - name: 'provision: syslog installer was deleted after enabling the service' + path: '/opt/docker/provision/service.d/syslog.sh' + shouldExist: false - name: 'provision: fpm config was created' path: '/opt/docker/etc/php/fpm/php-fpm.conf' shouldExist: true @@ -50,6 +56,18 @@ fileExistenceTests: - name: 'supervisor: fpm starter exists' path: '/opt/docker/etc/supervisor.d/php-fpm.conf' shouldExist: true + - name: 'provision: dnsmasq installer is retained' + path: '/opt/docker/provision/service.d/dnsmasq.sh' + shouldExist: true + permissions: '-rw-r--r--' + - name: 'provision: postfix installer is retained' + path: '/opt/docker/provision/service.d/postfix.sh' + shouldExist: true + permissions: '-rw-r--r--' + - name: 'provision: ssh installer is retained' + path: '/opt/docker/provision/service.d/ssh.sh' + shouldExist: true + permissions: '-rw-r--r--' - name: 'provision: add application user script was deleted after execution' path: '/opt/docker/provision/bootstrap.d/10-user-application.sh' shouldExist: false