summary refs log tree commit diff
path: root/nixos/tests/web-servers/unit-php.nix
diff options
context:
space:
mode:
authorElis Hirwing <elis@hirwing.se>2020-05-30 18:52:41 +0200
committerElis Hirwing <elis@hirwing.se>2020-05-30 18:52:41 +0200
commita4bf2cc1666079b0d1d46cb059fe263bd56fd6ec (patch)
treec939700583afb98d0172bd75960d4cfbf5869050 /nixos/tests/web-servers/unit-php.nix
parentf75d62941d8ad616bfc334ae19d71a0a6677dd19 (diff)
downloadnixpkgs-a4bf2cc1666079b0d1d46cb059fe263bd56fd6ec.tar
nixpkgs-a4bf2cc1666079b0d1d46cb059fe263bd56fd6ec.tar.gz
nixpkgs-a4bf2cc1666079b0d1d46cb059fe263bd56fd6ec.tar.bz2
nixpkgs-a4bf2cc1666079b0d1d46cb059fe263bd56fd6ec.tar.lz
nixpkgs-a4bf2cc1666079b0d1d46cb059fe263bd56fd6ec.tar.xz
nixpkgs-a4bf2cc1666079b0d1d46cb059fe263bd56fd6ec.tar.zst
nixpkgs-a4bf2cc1666079b0d1d46cb059fe263bd56fd6ec.zip
unit: Expose PHP expressions used so it can easily be accessed for configs
Diffstat (limited to 'nixos/tests/web-servers/unit-php.nix')
-rw-r--r--nixos/tests/web-servers/unit-php.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/nixos/tests/web-servers/unit-php.nix b/nixos/tests/web-servers/unit-php.nix
index c6327a1f825..2a0a5bdaa5d 100644
--- a/nixos/tests/web-servers/unit-php.nix
+++ b/nixos/tests/web-servers/unit-php.nix
@@ -23,7 +23,10 @@ in {
               "user": "testuser",
               "group": "testgroup",
               "root": "${testdir}/www",
-              "index": "info.php"
+              "index": "info.php",
+              "options": {
+                "file": "${pkgs.unit.usedPhp74}/lib/php.ini"
+              }
             }
           }
         }
@@ -42,6 +45,13 @@ in {
   };
   testScript = ''
     machine.wait_for_unit("unit.service")
-    assert "PHP Version ${pkgs.php74.version}" in machine.succeed("curl -vvv -s http://127.0.0.1:9074/")
+
+    # Check so we get an evaluated PHP back
+    response = machine.succeed("curl -vvv -s http://127.0.0.1:9074/")
+    assert "PHP Version ${pkgs.unit.usedPhp74.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"
   '';
 })