1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-26 23:52:33 +00:00
nixpkgs/nixos/tests/novacomd.nix

29 lines
826 B
Nix
Raw Normal View History

import ./make-test-python.nix ({ pkgs, ...} : {
2018-02-20 17:03:49 +00:00
name = "novacomd";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ dtzWill ];
};
machine = { ... }: {
2018-02-20 17:03:49 +00:00
services.novacomd.enable = true;
};
testScript = ''
machine.wait_for_unit("novacomd.service")
2018-02-20 17:03:49 +00:00
with subtest("Make sure the daemon is really listening"):
machine.wait_for_open_port(6968)
machine.succeed("novacom -l")
2018-02-20 17:03:49 +00:00
with subtest("Stop the daemon, double-check novacom fails if daemon isn't working"):
machine.stop_job("novacomd")
machine.fail("novacom -l")
2018-02-20 17:03:49 +00:00
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")
2018-02-20 17:03:49 +00:00
'';
})