about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/smokeping.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/tests/smokeping.nix')
-rw-r--r--nixpkgs/nixos/tests/smokeping.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/nixpkgs/nixos/tests/smokeping.nix b/nixpkgs/nixos/tests/smokeping.nix
new file mode 100644
index 000000000000..07d228051127
--- /dev/null
+++ b/nixpkgs/nixos/tests/smokeping.nix
@@ -0,0 +1,33 @@
+import ./make-test.nix ({ pkgs, ...} : {
+  name = "smokeping";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ cransom ];
+  };
+
+  nodes = {
+    sm =
+      { ... }:
+      {
+        services.smokeping = {
+          enable = true;
+          port = 8081;
+          mailHost = "127.0.0.2";
+          probeConfig = ''
+            + FPing
+            binary = /run/wrappers/bin/fping
+            offset = 0%
+          '';
+        };
+      };
+  };
+
+  testScript = ''
+    startAll;
+    $sm->waitForUnit("smokeping");
+    $sm->waitForUnit("thttpd");
+    $sm->waitForFile("/var/lib/smokeping/data/Local/LocalMachine.rrd");
+    $sm->succeed("curl -s -f localhost:8081/smokeping.fcgi?target=Local");
+    $sm->succeed("ls /var/lib/smokeping/cache/Local/LocalMachine_mini.png");
+    $sm->succeed("ls /var/lib/smokeping/cache/index.html");
+  '';
+})