From a876e0067abe361d91f1ac93a28fd1c74c9991fc Mon Sep 17 00:00:00 2001 From: Oliver Schmidt Date: Tue, 14 Jan 2025 16:01:30 +0100 Subject: [PATCH] nixosTests.matomo: extend test coverage (cherry picked from commit fc6d9cc539f4bd0df99466dce003d141b17ae528) --- nixos/tests/matomo.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/nixos/tests/matomo.nix b/nixos/tests/matomo.nix index f4097db6805d..e944229dede8 100644 --- a/nixos/tests/matomo.nix +++ b/nixos/tests/matomo.nix @@ -37,11 +37,25 @@ let machine.wait_for_unit("phpfpm-matomo.service") machine.wait_for_unit("nginx.service") + with subtest("matomo.js reachable via HTTP"): + machine.succeed("curl -sSfk http://machine/matomo.js") + + with subtest("js/piwik.js reachable via HTTP"): + machine.succeed("curl -sSfk http://machine/js/piwik.js") + + with subtest("matomo.php (API) reachable via HTTP"): + machine.succeed("curl -sSfk http://machine/matomo.php") + # without the grep the command does not produce valid utf-8 for some reason with subtest("welcome screen loads"): machine.succeed( "curl -sSfL http://localhost/ | grep 'Matomo[^<]*Installation'" ) + + with subtest("killing the phpfpm process should trigger an automatic restart"): + machine.succeed("systemctl kill -s KILL phpfpm-matomo") + machine.sleep(1) + machine.wait_for_unit("phpfpm-matomo.service") ''; }; in