diff options
author | Tom Hubrecht <tom@hubrecht.ovh> | 2022-09-01 14:36:19 +0200 |
---|---|---|
committer | Sandro Jäckel <sandro.jaeckel@gmail.com> | 2022-10-19 02:20:16 +0200 |
commit | bbf5ba11b488c43a3b042164de209fcfc6f4a62c (patch) | |
tree | 95f65a14801a40db053c6a2a8ebe0a8d31ef5036 /nixos/tests/ntfy-sh.nix | |
parent | e2abc215de587149fa14d78d846a4f3550538f92 (diff) |
nixos/ntfy-sh: init
Diffstat (limited to 'nixos/tests/ntfy-sh.nix')
-rw-r--r-- | nixos/tests/ntfy-sh.nix | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/nixos/tests/ntfy-sh.nix b/nixos/tests/ntfy-sh.nix new file mode 100644 index 0000000000000..c0c289b904b6e --- /dev/null +++ b/nixos/tests/ntfy-sh.nix @@ -0,0 +1,20 @@ +import ./make-test-python.nix { + + nodes.machine = { ... }: { + services.ntfy-sh.enable = true; + }; + + testScript = '' + import json + + msg = "Test notification" + + machine.wait_for_unit("multi-user.target") + + machine.succeed(f"curl -d '{msg}' localhost:80/test") + + notif = json.loads(machine.succeed("curl -s localhost:80/test/json?poll=1")) + + assert msg == notif["message"], "Wrong message" + ''; +} |