summary refs log tree commit diff
path: root/nixos/tests/munin.nix
diff options
context:
space:
mode:
authorx123 <x123@users.noreply.github.com>2019-12-03 20:24:50 +0100
committerFlorian Klink <flokli@flokli.de>2019-12-06 01:05:04 +0100
commit2cda20c12ee1cb80af476a1a1cdaeded7a0a51ef (patch)
treeb6f9b391318a5a37ff6e822370db9d00669eaf36 /nixos/tests/munin.nix
parent4de58b617bf52509cdfa7946f46505166f0bc3de (diff)
downloadnixpkgs-2cda20c12ee1cb80af476a1a1cdaeded7a0a51ef.tar
nixpkgs-2cda20c12ee1cb80af476a1a1cdaeded7a0a51ef.tar.gz
nixpkgs-2cda20c12ee1cb80af476a1a1cdaeded7a0a51ef.tar.bz2
nixpkgs-2cda20c12ee1cb80af476a1a1cdaeded7a0a51ef.tar.lz
nixpkgs-2cda20c12ee1cb80af476a1a1cdaeded7a0a51ef.tar.xz
nixpkgs-2cda20c12ee1cb80af476a1a1cdaeded7a0a51ef.tar.zst
nixpkgs-2cda20c12ee1cb80af476a1a1cdaeded7a0a51ef.zip
nixos/tests/munin: port to python
Diffstat (limited to 'nixos/tests/munin.nix')
-rw-r--r--nixos/tests/munin.nix44
1 files changed, 22 insertions, 22 deletions
diff --git a/nixos/tests/munin.nix b/nixos/tests/munin.nix
index 31374aaf77e..7b674db7768 100644
--- a/nixos/tests/munin.nix
+++ b/nixos/tests/munin.nix
@@ -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 ];
@@ -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")
   '';
 })