1import ./make-test-python.nix ({ pkgs, ...} : {
2 name = "smokeping";
3 meta = with pkgs.lib.maintainers; {
4 maintainers = [ cransom ];
5 };
6
7 nodes = {
8 sm =
9 { ... }:
10 {
11 networking.domain = "example.com"; # FQDN: sm.example.com
12 services.smokeping = {
13 enable = true;
14 port = 8081;
15 mailHost = "127.0.0.2";
16 probeConfig = ''
17 + FPing
18 binary = /run/wrappers/bin/fping
19 offset = 0%
20 '';
21 };
22 };
23 };
24
25 testScript = ''
26 start_all()
27 sm.wait_for_unit("smokeping")
28 sm.wait_for_unit("thttpd")
29 sm.wait_for_file("/var/lib/smokeping/data/Local/LocalMachine.rrd")
30 sm.succeed("curl -s -f localhost:8081/smokeping.fcgi?target=Local")
31 # Check that there's a helpful page without explicit path as well.
32 sm.succeed("curl -s -f localhost:8081")
33 sm.succeed("ls /var/lib/smokeping/cache/Local/LocalMachine_mini.png")
34 sm.succeed("ls /var/lib/smokeping/cache/index.html")
35 '';
36})