3
0
Fork 0
forked from mirrors/nixpkgs

nixos/tests/php: Declare php package used instead of just using default

This commit is contained in:
Elis Hirwing 2021-02-27 19:39:26 +01:00
parent ac8a8fe2fa
commit c6f0a1db39
No known key found for this signature in database
GPG key ID: D57EFA625C9A925F
4 changed files with 18 additions and 14 deletions

View file

@ -1,8 +1,9 @@
{ system ? builtins.currentSystem, { system ? builtins.currentSystem
config ? {}, , config ? {}
pkgs ? import ../../.. { inherit system config; } , pkgs ? import ../../.. { inherit system config; }
, php ? pkgs.php
}: { }: {
fpm = import ./fpm.nix { inherit system pkgs; }; fpm = import ./fpm.nix { inherit system pkgs php; };
httpd = import ./httpd.nix { inherit system pkgs; }; httpd = import ./httpd.nix { inherit system pkgs php; };
pcre = import ./pcre.nix { inherit system pkgs; }; pcre = import ./pcre.nix { inherit system pkgs php; };
} }

View file

@ -1,5 +1,5 @@
import ../make-test-python.nix ({pkgs, lib, ...}: { import ../make-test-python.nix ({pkgs, lib, php, ...}: {
name = "php-fpm-nginx-test"; name = "php-${php.version}-fpm-nginx-test";
meta.maintainers = lib.teams.php.members; meta.maintainers = lib.teams.php.members;
machine = { config, lib, pkgs, ... }: { machine = { config, lib, pkgs, ... }: {
@ -25,6 +25,7 @@ import ../make-test-python.nix ({pkgs, lib, ...}: {
services.phpfpm.pools."foobar" = { services.phpfpm.pools."foobar" = {
user = "nginx"; user = "nginx";
phpPackage = php;
settings = { settings = {
"listen.group" = "nginx"; "listen.group" = "nginx";
"listen.mode" = "0600"; "listen.mode" = "0600";
@ -44,7 +45,7 @@ import ../make-test-python.nix ({pkgs, lib, ...}: {
# Check so we get an evaluated PHP back # Check so we get an evaluated PHP back
response = machine.succeed("curl -fvvv -s http://127.0.0.1:80/") 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 # 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"]:

View file

@ -1,5 +1,5 @@
import ../make-test-python.nix ({pkgs, lib, ...}: { import ../make-test-python.nix ({pkgs, lib, php, ...}: {
name = "php-httpd-test"; name = "php-${php.version}-httpd-test";
meta.maintainers = lib.teams.php.members; meta.maintainers = lib.teams.php.members;
machine = { config, lib, pkgs, ... }: { machine = { config, lib, pkgs, ... }: {
@ -14,6 +14,7 @@ import ../make-test-python.nix ({pkgs, lib, ...}: {
index = "index.php index.html"; index = "index.php index.html";
}; };
}; };
phpPackage = php;
enablePHP = true; enablePHP = true;
}; };
}; };
@ -22,7 +23,7 @@ import ../make-test-python.nix ({pkgs, lib, ...}: {
# Check so we get an evaluated PHP back # Check so we get an evaluated PHP back
response = machine.succeed("curl -fvvv -s http://127.0.0.1:80/") 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 # 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"]:

View file

@ -1,7 +1,7 @@
let let
testString = "can-use-subgroups"; testString = "can-use-subgroups";
in import ../make-test-python.nix ({lib, ...}: { in import ../make-test-python.nix ({lib, php, ...}: {
name = "php-httpd-pcre-jit-test"; name = "php-${php.version}-httpd-pcre-jit-test";
meta.maintainers = lib.teams.php.members; meta.maintainers = lib.teams.php.members;
machine = { lib, pkgs, ... }: { machine = { lib, pkgs, ... }: {
@ -9,6 +9,7 @@ in import ../make-test-python.nix ({lib, ...}: {
services.httpd = { services.httpd = {
enable = true; enable = true;
adminAddr = "please@dont.contact"; adminAddr = "please@dont.contact";
phpPackage = php;
enablePHP = true; enablePHP = true;
phpOptions = "pcre.jit = true"; phpOptions = "pcre.jit = true";
extraConfig = let extraConfig = let