2019-12-15 21:32:34 +03:00
|
|
|
import ./make-test-python.nix ({ pkgs, ...} : {
|
2018-02-20 20:03:49 +03:00
|
|
|
name = "novacomd";
|
2021-01-10 22:08:30 +03:00
|
|
|
meta = with pkgs.lib.maintainers; {
|
2018-02-20 20:03:49 +03:00
|
|
|
maintainers = [ dtzWill ];
|
|
|
|
};
|
|
|
|
|
2022-03-21 02:15:30 +03:00
|
|
|
nodes.machine = { ... }: {
|
2018-02-20 20:03:49 +03:00
|
|
|
services.novacomd.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2019-12-15 21:32:34 +03:00
|
|
|
machine.wait_for_unit("novacomd.service")
|
2018-02-20 20:03:49 +03:00
|
|
|
|
2019-12-15 21:32:34 +03:00
|
|
|
with subtest("Make sure the daemon is really listening"):
|
|
|
|
machine.wait_for_open_port(6968)
|
|
|
|
machine.succeed("novacom -l")
|
2018-02-20 20:03:49 +03:00
|
|
|
|
2019-12-15 21:32:34 +03: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 20:03:49 +03:00
|
|
|
|
2019-12-15 21:32:34 +03: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 20:03:49 +03:00
|
|
|
'';
|
|
|
|
})
|