From 0dc95728bac36c3711009e0611b7b31c402a959e Mon Sep 17 00:00:00 2001 From: Elis Hirwing Date: Tue, 31 Mar 2020 19:06:04 +0200 Subject: nixos/php: Move the pcre tests to the php test attribute --- nixos/release-combined.nix | 2 +- nixos/release-small.nix | 4 ++-- nixos/tests/all-tests.nix | 1 - nixos/tests/php-pcre.nix | 40 ---------------------------------------- nixos/tests/php/default.nix | 1 + nixos/tests/php/pcre.nix | 37 +++++++++++++++++++++++++++++++++++++ 6 files changed, 41 insertions(+), 44 deletions(-) delete mode 100644 nixos/tests/php-pcre.nix create mode 100644 nixos/tests/php/pcre.nix (limited to 'nixos') diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index 9377a931a75ed..b23c17a1b6962 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -112,7 +112,7 @@ in rec { "nixos.tests.nfs4.simple.x86_64-linux" "nixos.tests.openssh.x86_64-linux" "nixos.tests.pantheon.x86_64-linux" - "nixos.tests.php-pcre.x86_64-linux" + "nixos.tests.php.x86_64-linux" "nixos.tests.plasma5.x86_64-linux" "nixos.tests.predictable-interface-names.predictableNetworkd.x86_64-linux" "nixos.tests.predictable-interface-names.predictable.x86_64-linux" diff --git a/nixos/release-small.nix b/nixos/release-small.nix index 2a15073b6698c..d78788d053154 100644 --- a/nixos/release-small.nix +++ b/nixos/release-small.nix @@ -40,7 +40,7 @@ in rec { nat nfs3 openssh - php-pcre + php predictable-interface-names proxy simple; @@ -108,7 +108,7 @@ in rec { "nixos.tests.nat.standalone.x86_64-linux" "nixos.tests.nfs3.simple.x86_64-linux" "nixos.tests.openssh.x86_64-linux" - "nixos.tests.php-pcre.x86_64-linux" + "nixos.tests.php.x86_64-linux" "nixos.tests.predictable-interface-names.predictable.x86_64-linux" "nixos.tests.predictable-interface-names.predictableNetworkd.x86_64-linux" "nixos.tests.predictable-interface-names.unpredictable.x86_64-linux" diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index e003372ef9d43..1f8f0d49a850e 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -241,7 +241,6 @@ in pgjwt = handleTest ./pgjwt.nix {}; pgmanage = handleTest ./pgmanage.nix {}; php = handleTest ./php {}; - php-pcre = handleTest ./php-pcre.nix {}; plasma5 = handleTest ./plasma5.nix {}; plotinus = handleTest ./plotinus.nix {}; postgis = handleTest ./postgis.nix {}; diff --git a/nixos/tests/php-pcre.nix b/nixos/tests/php-pcre.nix deleted file mode 100644 index d5c22e0582a0c..0000000000000 --- a/nixos/tests/php-pcre.nix +++ /dev/null @@ -1,40 +0,0 @@ - -let testString = "can-use-subgroups"; in - -import ./make-test-python.nix ({ ...}: { - name = "php-httpd-pcre-jit-test"; - machine = { lib, pkgs, ... }: { - time.timeZone = "UTC"; - services.httpd = { - enable = true; - adminAddr = "please@dont.contact"; - enablePHP = true; - phpOptions = "pcre.jit = true"; - extraConfig = - let - testRoot = pkgs.writeText "index.php" - '' - - ''; - in - '' - Alias / ${testRoot}/ - - - Require all granted - - ''; - }; - }; - testScript = { ... }: - '' - machine.wait_for_unit("httpd.service") - # Ensure php evaluation by matching on the var_dump syntax - assert 'string(${toString (builtins.stringLength testString)}) "${testString}"' in machine.succeed( - "curl -vvv -s http://127.0.0.1:80/index.php" - ) - ''; -}) diff --git a/nixos/tests/php/default.nix b/nixos/tests/php/default.nix index c5735bd664d79..9ab14f722d087 100644 --- a/nixos/tests/php/default.nix +++ b/nixos/tests/php/default.nix @@ -3,4 +3,5 @@ pkgs ? import ../../.. { inherit system config; } }: { fpm = import ./fpm.nix { inherit system pkgs; }; + pcre = import ./pcre.nix { inherit system pkgs; }; } diff --git a/nixos/tests/php/pcre.nix b/nixos/tests/php/pcre.nix new file mode 100644 index 0000000000000..56a87778579f0 --- /dev/null +++ b/nixos/tests/php/pcre.nix @@ -0,0 +1,37 @@ +let + testString = "can-use-subgroups"; +in import ../make-test-python.nix ({ ...}: { + name = "php-httpd-pcre-jit-test"; + machine = { lib, pkgs, ... }: { + time.timeZone = "UTC"; + services.httpd = { + enable = true; + adminAddr = "please@dont.contact"; + enablePHP = true; + phpOptions = "pcre.jit = true"; + extraConfig = let + testRoot = pkgs.writeText "index.php" + '' + + Require all granted + + ''; + }; + }; + testScript = { ... }: + '' + machine.wait_for_unit("httpd.service") + # Ensure php evaluation by matching on the var_dump syntax + assert 'string(${toString (builtins.stringLength testString)}) "${testString}"' in machine.succeed( + "curl -vvv -s http://127.0.0.1:80/index.php" + ) + ''; +}) -- cgit 1.4.1