diff options
Diffstat (limited to 'nixos/tests/php/httpd.nix')
-rw-r--r-- | nixos/tests/php/httpd.nix | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/nixos/tests/php/httpd.nix b/nixos/tests/php/httpd.nix index 1092e0ecadd..36d90e72d7d 100644 --- a/nixos/tests/php/httpd.nix +++ b/nixos/tests/php/httpd.nix @@ -1,19 +1,22 @@ -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, ... }: { services.httpd = { enable = true; adminAddr = "admin@phpfpm"; - virtualHosts."phpfpm" = let - testdir = pkgs.writeTextDir "web/index.php" "<?php phpinfo();"; - in { - documentRoot = "${testdir}/web"; - locations."/" = { - index = "index.php index.html"; + virtualHosts."phpfpm" = + let + testdir = pkgs.writeTextDir "web/index.php" "<?php phpinfo();"; + in + { + documentRoot = "${testdir}/web"; + locations."/" = { + index = "index.php index.html"; + }; }; - }; + phpPackage = php; enablePHP = true; }; }; @@ -21,8 +24,8 @@ import ../make-test-python.nix ({pkgs, lib, ...}: { machine.wait_for_unit("httpd.service") # Check so we get an evaluated PHP back - response = machine.succeed("curl -vvv -s http://127.0.0.1:80/") - assert "PHP Version ${pkgs.php.version}" in response, "PHP version not detected" + response = machine.succeed("curl -fvvv -s http://127.0.0.1:80/") + 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"]: |