depot/third_party/nixpkgs/nixos/tests/novacomd.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

28 lines
826 B
Nix

import ./make-test-python.nix ({ pkgs, ...} : {
name = "novacomd";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ dtzWill ];
};
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")
'';
})