From 1a5d3070ac825a080f21013364f01928e0920076 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Sun, 1 Dec 2019 00:50:55 +0100 Subject: nixosTests.matomo: port to python --- nixos/tests/matomo.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'nixos') diff --git a/nixos/tests/matomo.nix b/nixos/tests/matomo.nix index 4efa65a7b6de..2bea237c8bdd 100644 --- a/nixos/tests/matomo.nix +++ b/nixos/tests/matomo.nix @@ -1,7 +1,7 @@ { system ? builtins.currentSystem, config ? { } , pkgs ? import ../.. { inherit system config; } }: -with import ../lib/testing.nix { inherit system pkgs; }; +with import ../lib/testing-python.nix { inherit system pkgs; }; with pkgs.lib; let @@ -24,11 +24,16 @@ let }; testScript = '' - startAll; - $machine->waitForUnit("mysql.service"); - $machine->waitForUnit("phpfpm-matomo.service"); - $machine->waitForUnit("nginx.service"); - $machine->succeed("curl -sSfL http://localhost/ | grep 'Matomo[^<]*Installation'"); + start_all() + machine.wait_for_unit("mysql.service") + machine.wait_for_unit("phpfpm-matomo.service") + machine.wait_for_unit("nginx.service") + + # 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 '<title>Matomo[^<]*Installation'" + ) ''; }; in { -- cgit 1.4.1