1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00
nixpkgs/nixos/tests/ntfy-sh.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
439 B
Nix
Raw Normal View History

2022-09-01 13:36:19 +01:00
import ./make-test-python.nix {
2022-12-14 10:09:52 +00:00
name = "ntfy-sh";
2022-09-01 13:36:19 +01:00
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"
'';
}