at master 1.5 kB view raw
1{ lib, ... }: 2{ 3 name = "matomo"; 4 5 nodes.machine = 6 { config, pkgs, ... }: 7 { 8 services.matomo = { 9 enable = true; 10 nginx = { 11 forceSSL = false; 12 enableACME = false; 13 }; 14 }; 15 services.mysql = { 16 enable = true; 17 package = pkgs.mariadb; 18 }; 19 services.nginx.enable = true; 20 }; 21 22 testScript = '' 23 start_all() 24 machine.wait_for_unit("mysql.service") 25 machine.wait_for_unit("phpfpm-matomo.service") 26 machine.wait_for_unit("nginx.service") 27 28 with subtest("matomo.js reachable via HTTP"): 29 machine.succeed("curl -sSfk http://machine/matomo.js") 30 31 with subtest("js/piwik.js reachable via HTTP"): 32 machine.succeed("curl -sSfk http://machine/js/piwik.js") 33 34 with subtest("matomo.php (API) reachable via HTTP"): 35 machine.succeed("curl -sSfk http://machine/matomo.php") 36 37 # without the grep the command does not produce valid utf-8 for some reason 38 with subtest("welcome screen loads"): 39 machine.succeed( 40 "curl -sSfL http://localhost/ | grep '<title>Matomo[^<]*Installation'" 41 ) 42 43 with subtest("killing the phpfpm process should trigger an automatic restart"): 44 machine.succeed("systemctl kill -s KILL phpfpm-matomo") 45 machine.sleep(1) 46 machine.wait_for_unit("phpfpm-matomo.service") 47 ''; 48 49 meta.maintainers = 50 with lib.maintainers; 51 [ 52 florianjacob 53 mmilata 54 twey 55 boozedog 56 ] 57 ++ lib.teams.flyingcircus.members; 58}