at 22.05-pre 1.3 kB view raw
1{ system ? builtins.currentSystem, config ? { } 2, pkgs ? import ../.. { inherit system config; } }: 3 4with import ../lib/testing-python.nix { inherit system pkgs; }; 5with pkgs.lib; 6 7let 8 matomoTest = package: 9 makeTest { 10 machine = { config, pkgs, ... }: { 11 services.matomo = { 12 package = package; 13 enable = true; 14 nginx = { 15 forceSSL = false; 16 enableACME = false; 17 }; 18 }; 19 services.mysql = { 20 enable = true; 21 package = pkgs.mariadb; 22 }; 23 services.nginx.enable = true; 24 }; 25 26 testScript = '' 27 start_all() 28 machine.wait_for_unit("mysql.service") 29 machine.wait_for_unit("phpfpm-matomo.service") 30 machine.wait_for_unit("nginx.service") 31 32 # without the grep the command does not produce valid utf-8 for some reason 33 with subtest("welcome screen loads"): 34 machine.succeed( 35 "curl -sSfL http://localhost/ | grep '<title>Matomo[^<]*Installation'" 36 ) 37 ''; 38 }; 39in { 40 matomo = matomoTest pkgs.matomo // { 41 name = "matomo"; 42 meta.maintainers = with maintainers; [ florianjacob kiwi mmilata ]; 43 }; 44 matomo-beta = matomoTest pkgs.matomo-beta // { 45 name = "matomo-beta"; 46 meta.maintainers = with maintainers; [ florianjacob kiwi mmilata ]; 47 }; 48}