From 29e1f0d1691ee1b02dc9dd2af24a6f1b169a1f21 Mon Sep 17 00:00:00 2001 From: Elis Hirwing Date: Mon, 30 Mar 2020 22:07:05 +0200 Subject: [PATCH] nixos/php: Add tests for phpfpm This test checks that we evaluate PHP properly and that certain extensions are actually loaded. --- nixos/tests/all-tests.nix | 1 + nixos/tests/php/default.nix | 6 ++++ nixos/tests/php/fpm.nix | 55 +++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 nixos/tests/php/default.nix create mode 100644 nixos/tests/php/fpm.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index a84f2c5d261..e003372ef9d 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -240,6 +240,7 @@ in peerflix = handleTest ./peerflix.nix {}; 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 {}; diff --git a/nixos/tests/php/default.nix b/nixos/tests/php/default.nix new file mode 100644 index 00000000000..c5735bd664d --- /dev/null +++ b/nixos/tests/php/default.nix @@ -0,0 +1,6 @@ +{ system ? builtins.currentSystem, + config ? {}, + pkgs ? import ../../.. { inherit system config; } +}: { + fpm = import ./fpm.nix { inherit system pkgs; }; +} diff --git a/nixos/tests/php/fpm.nix b/nixos/tests/php/fpm.nix new file mode 100644 index 00000000000..e93a3183418 --- /dev/null +++ b/nixos/tests/php/fpm.nix @@ -0,0 +1,55 @@ +import ../make-test-python.nix ({pkgs, ...}: { + name = "php-fpm-nginx-test"; + meta.maintainers = with pkgs.stdenv.lib.maintainers; [ etu ]; + + machine = { config, lib, pkgs, ... }: { + services.nginx = { + enable = true; + + virtualHosts."phpfpm" = let + testdir = pkgs.writeTextDir "web/index.php" "