diff --git a/nixos/tests/php/default.nix b/nixos/tests/php/default.nix index ee7a3b56a3e..6ecaed24604 100644 --- a/nixos/tests/php/default.nix +++ b/nixos/tests/php/default.nix @@ -1,8 +1,9 @@ -{ system ? builtins.currentSystem, - config ? {}, - pkgs ? import ../../.. { inherit system config; } +{ system ? builtins.currentSystem +, config ? {} +, pkgs ? import ../../.. { inherit system config; } +, php ? pkgs.php }: { - fpm = import ./fpm.nix { inherit system pkgs; }; - httpd = import ./httpd.nix { inherit system pkgs; }; - pcre = import ./pcre.nix { inherit system pkgs; }; + fpm = import ./fpm.nix { inherit system pkgs php; }; + httpd = import ./httpd.nix { inherit system pkgs php; }; + pcre = import ./pcre.nix { inherit system pkgs php; }; } diff --git a/nixos/tests/php/fpm.nix b/nixos/tests/php/fpm.nix index 9ad515ebdde..f84394ccea4 100644 --- a/nixos/tests/php/fpm.nix +++ b/nixos/tests/php/fpm.nix @@ -1,5 +1,5 @@ -import ../make-test-python.nix ({pkgs, lib, ...}: { - name = "php-fpm-nginx-test"; +import ../make-test-python.nix ({pkgs, lib, php, ...}: { + name = "php-${php.version}-fpm-nginx-test"; meta.maintainers = lib.teams.php.members; machine = { config, lib, pkgs, ... }: { @@ -25,6 +25,7 @@ import ../make-test-python.nix ({pkgs, lib, ...}: { services.phpfpm.pools."foobar" = { user = "nginx"; + phpPackage = php; settings = { "listen.group" = "nginx"; "listen.mode" = "0600"; @@ -44,7 +45,7 @@ import ../make-test-python.nix ({pkgs, lib, ...}: { # Check so we get an evaluated PHP back response = machine.succeed("curl -fvvv -s http://127.0.0.1:80/") - assert "PHP Version ${pkgs.php.version}" in response, "PHP version not detected" + assert "PHP Version ${php.version}" in response, "PHP version not detected" # Check so we have database and some other extensions loaded for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]: diff --git a/nixos/tests/php/httpd.nix b/nixos/tests/php/httpd.nix index 27ea7a24e3a..a5ca9b3c5d1 100644 --- a/nixos/tests/php/httpd.nix +++ b/nixos/tests/php/httpd.nix @@ -1,5 +1,5 @@ -import ../make-test-python.nix ({pkgs, lib, ...}: { - name = "php-httpd-test"; +import ../make-test-python.nix ({pkgs, lib, php, ...}: { + name = "php-${php.version}-httpd-test"; meta.maintainers = lib.teams.php.members; machine = { config, lib, pkgs, ... }: { @@ -14,6 +14,7 @@ import ../make-test-python.nix ({pkgs, lib, ...}: { index = "index.php index.html"; }; }; + phpPackage = php; enablePHP = true; }; }; @@ -22,7 +23,7 @@ import ../make-test-python.nix ({pkgs, lib, ...}: { # Check so we get an evaluated PHP back response = machine.succeed("curl -fvvv -s http://127.0.0.1:80/") - assert "PHP Version ${pkgs.php.version}" in response, "PHP version not detected" + assert "PHP Version ${php.version}" in response, "PHP version not detected" # Check so we have database and some other extensions loaded for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]: diff --git a/nixos/tests/php/pcre.nix b/nixos/tests/php/pcre.nix index 3ea19304bff..97572f63af3 100644 --- a/nixos/tests/php/pcre.nix +++ b/nixos/tests/php/pcre.nix @@ -1,7 +1,7 @@ let testString = "can-use-subgroups"; -in import ../make-test-python.nix ({lib, ...}: { - name = "php-httpd-pcre-jit-test"; +in import ../make-test-python.nix ({lib, php, ...}: { + name = "php-${php.version}-httpd-pcre-jit-test"; meta.maintainers = lib.teams.php.members; machine = { lib, pkgs, ... }: { @@ -9,6 +9,7 @@ in import ../make-test-python.nix ({lib, ...}: { services.httpd = { enable = true; adminAddr = "please@dont.contact"; + phpPackage = php; enablePHP = true; phpOptions = "pcre.jit = true"; extraConfig = let