summaryrefslogtreecommitdiffstats
path: root/nixos/tests/novacomd.nix
blob: 25082b30b4e5d9e162b8aa8c8256133fafd8ad64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import ./make-test-python.nix (
  { pkgs, ... }:
  {
    name = "novacomd";
    meta.maintainers = [ ];
    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")
    '';
  }
)