diff options
Diffstat (limited to 'nixos/tests/php/fpm.nix')
-rw-r--r-- | nixos/tests/php/fpm.nix | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/nixos/tests/php/fpm.nix b/nixos/tests/php/fpm.nix index 9ad515ebdde06..b11f85d39cb6f 100644 --- a/nixos/tests/php/fpm.nix +++ b/nixos/tests/php/fpm.nix @@ -1,8 +1,10 @@ -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, ... }: { + environment.systemPackages = [ php ]; + services.nginx = { enable = true; @@ -10,7 +12,7 @@ import ../make-test-python.nix ({pkgs, lib, ...}: { testdir = pkgs.writeTextDir "web/index.php" "<?php phpinfo();"; in { root = "${testdir}/web"; - locations."~ \.php$".extraConfig = '' + locations."~ \\.php$".extraConfig = '' fastcgi_pass unix:${config.services.phpfpm.pools.foobar.socket}; fastcgi_index index.php; include ${pkgs.nginx}/conf/fastcgi_params; @@ -25,6 +27,7 @@ import ../make-test-python.nix ({pkgs, lib, ...}: { services.phpfpm.pools."foobar" = { user = "nginx"; + phpPackage = php; settings = { "listen.group" = "nginx"; "listen.mode" = "0600"; @@ -44,10 +47,11 @@ 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"]: + for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite", "apcu"]: assert ext in response, f"Missing {ext} extension" + machine.succeed(f'test -n "$(php -m | grep -i {ext})"') ''; }) |