depot/nixos/tests/novacomd.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

28 lines
825 B
Nix

import ./make-test-python.nix ({ pkgs, ...} : {
name = "novacomd";
meta = with pkgs.lib.maintainers; {
maintainers = [ dtzWill ];
};
nodes.machine = { ... }: {
services.novacomd.enable = true;
};
testScript = ''
machine.wait_for_unit("novacomd.service")
with subtest("Make sure the daemon is really listening"):
machine.wait_for_open_port(6968)
machine.succeed("novacom -l")
with subtest("Stop the daemon, double-check novacom fails if daemon isn't working"):
machine.stop_job("novacomd")
machine.fail("novacom -l")
with subtest("Make sure the daemon starts back up again"):
machine.start_job("novacomd")
# make sure the daemon is really listening
machine.wait_for_open_port(6968)
machine.succeed("novacom -l")
'';
})