Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/tests/munin: port to python #74935

Merged
merged 1 commit into from
Dec 7, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions nixos/tests/munin.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This test runs basic munin setup with node and cron job running on the same
# machine.

import ./make-test.nix ({ pkgs, ...} : {
import ./make-test-python.nix ({ pkgs, ...} : {
name = "munin";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ domenkozar eelco ];
Expand All @@ -12,33 +12,33 @@ import ./make-test.nix ({ pkgs, ...} : {
{ config, ... }:
{
services = {
munin-node = {
munin-node = {
enable = true;
# disable a failing plugin to prevent irrelevant error message, see #23049
disabledPlugins = [ "apc_nis" ];
};
munin-cron = {
enable = true;
# disable a failing plugin to prevent irrelevant error message, see #23049
disabledPlugins = [ "apc_nis" ];
};
munin-cron = {
enable = true;
hosts = ''
[${config.networking.hostName}]
address localhost
'';
};
hosts = ''
[${config.networking.hostName}]
address localhost
'';
};
};
# long timeout to prevent hydra failure on high load
systemd.services.munin-node.serviceConfig.TimeoutStartSec = "10min";

# increase the systemd timer interval so it fires more often
systemd.timers.munin-cron.timerConfig.OnCalendar = pkgs.stdenv.lib.mkForce "*:*:0/10";
};
};

testScript = ''
startAll;
start_all()

$one->waitForUnit("munin-node.service");
# make sure the node is actually listening
$one->waitForOpenPort(4949);
$one->succeed('systemctl start munin-cron');
# wait for munin-cron output
$one->waitForFile("/var/lib/munin/one/one-uptime-uptime-g.rrd");
$one->waitForFile("/var/www/munin/one/index.html");
with subtest("ensure munin-node starts and listens on 4949"):
one.wait_for_unit("munin-node.service")
one.wait_for_open_port(4949)
with subtest("ensure munin-cron output is correct"):
one.wait_for_file("/var/lib/munin/one/one-uptime-uptime-g.rrd")
one.wait_for_file("/var/www/munin/one/index.html")
'';
})