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