summary refs log tree commit diff
diff options
context:
space:
mode:
authorElis Hirwing <elis@hirwing.se>2021-02-27 19:39:26 +0100
committerElis Hirwing <elis@hirwing.se>2021-02-28 12:37:05 +0100
commitc6f0a1db39eae371e81c4c46541e59dce828580a (patch)
treefc1ac7402e7a9cabcab7a21f092f13f899779112
parentac8a8fe2fafa244b14f640083008464e37096c9b (diff)
downloadnixpkgs-c6f0a1db39eae371e81c4c46541e59dce828580a.tar
nixpkgs-c6f0a1db39eae371e81c4c46541e59dce828580a.tar.gz
nixpkgs-c6f0a1db39eae371e81c4c46541e59dce828580a.tar.bz2
nixpkgs-c6f0a1db39eae371e81c4c46541e59dce828580a.tar.lz
nixpkgs-c6f0a1db39eae371e81c4c46541e59dce828580a.tar.xz
nixpkgs-c6f0a1db39eae371e81c4c46541e59dce828580a.tar.zst
nixpkgs-c6f0a1db39eae371e81c4c46541e59dce828580a.zip
nixos/tests/php: Declare php package used instead of just using default
-rw-r--r--nixos/tests/php/default.nix13
-rw-r--r--nixos/tests/php/fpm.nix7
-rw-r--r--nixos/tests/php/httpd.nix7
-rw-r--r--nixos/tests/php/pcre.nix5
4 files changed, 18 insertions, 14 deletions
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