1# This test runs basic munin setup with node and cron job running on the same
2# machine.
3
4import ./make-test-python.nix (
5 { pkgs, ... }:
6 {
7 name = "munin";
8 meta = with pkgs.lib.maintainers; {
9 maintainers = [ domenkozar ];
10 };
11
12 nodes = {
13 one =
14 { config, ... }:
15 {
16 services = {
17 munin-node = {
18 enable = true;
19 # disable a failing plugin to prevent irrelevant error message, see #23049
20 disabledPlugins = [ "apc_nis" ];
21 };
22 munin-cron = {
23 enable = true;
24 hosts = ''
25 [${config.networking.hostName}]
26 address localhost
27 '';
28 };
29 };
30
31 # increase the systemd timer interval so it fires more often
32 systemd.timers.munin-cron.timerConfig.OnCalendar = pkgs.lib.mkForce "*:*:0/10";
33 };
34 };
35
36 testScript = ''
37 start_all()
38
39 with subtest("ensure munin-node starts and listens on 4949"):
40 one.wait_for_unit("munin-node.service")
41 one.wait_for_open_port(4949)
42
43 with subtest("ensure munin-cron output is correct"):
44 one.wait_for_file("/var/lib/munin/one/one-uptime-uptime-g.rrd")
45 one.wait_for_file("/var/www/munin/one/index.html")
46 one.wait_for_file("/var/www/munin/one/one/diskstat_iops_vda-day.png", timeout=60)
47 '';
48 }
49)