Jan Tojnar
4 years ago
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
3 changed files with
33 additions and
0 deletions
-
nixos/release-combined.nix
-
nixos/tests/php/default.nix
-
nixos/tests/php/httpd.nix
|
|
@ -117,6 +117,7 @@ in rec { |
|
|
|
(onFullSupported "nixos.tests.openssh") |
|
|
|
(onFullSupported "nixos.tests.pantheon") |
|
|
|
(onFullSupported "nixos.tests.php.fpm") |
|
|
|
(onFullSupported "nixos.tests.php.httpd") |
|
|
|
(onFullSupported "nixos.tests.php.pcre") |
|
|
|
(onFullSupported "nixos.tests.plasma5") |
|
|
|
(onFullSupported "nixos.tests.predictable-interface-names.predictableNetworkd") |
|
|
|
|
|
@ -3,5 +3,6 @@ |
|
|
|
pkgs ? import ../../.. { inherit system config; } |
|
|
|
}: { |
|
|
|
fpm = import ./fpm.nix { inherit system pkgs; }; |
|
|
|
httpd = import ./httpd.nix { inherit system pkgs; }; |
|
|
|
pcre = import ./pcre.nix { inherit system pkgs; }; |
|
|
|
} |
|
|
@ -0,0 +1,31 @@ |
|
|
|
import ../make-test-python.nix ({pkgs, ...}: { |
|
|
|
name = "php-httpd-test"; |
|
|
|
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ etu ]; |
|
|
|
|
|
|
|
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"; |
|
|
|
}; |
|
|
|
}; |
|
|
|
enablePHP = true; |
|
|
|
}; |
|
|
|
}; |
|
|
|
testScript = { ... }: '' |
|
|
|
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" |
|
|
|
|
|
|
|
# Check so we have database and some other extensions loaded |
|
|
|
for ext in ["json", "opcache", "pdo_mysql", "pdo_pgsql", "pdo_sqlite"]: |
|
|
|
assert ext in response, f"Missing {ext} extension" |
|
|
|
''; |
|
|
|
}) |