about summary refs log tree commit diff
path: root/nixpkgs/nixos/tests/novacomd.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/tests/novacomd.nix')
-rw-r--r--nixpkgs/nixos/tests/novacomd.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/nixpkgs/nixos/tests/novacomd.nix b/nixpkgs/nixos/tests/novacomd.nix
new file mode 100644
index 000000000000..4eb60c0feb5c
--- /dev/null
+++ b/nixpkgs/nixos/tests/novacomd.nix
@@ -0,0 +1,34 @@
+import ./make-test.nix ({ pkgs, ...} : {
+  name = "novacomd";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ dtzWill ];
+  };
+
+  machine = { ... }: {
+    services.novacomd.enable = true;
+  };
+
+  testScript = ''
+    $machine->waitForUnit("multi-user.target");
+
+    # multi-user.target wants novacomd.service, but let's make sure
+    $machine->waitForUnit("novacomd.service");
+
+    # Check status and try connecting with novacom
+    $machine->succeed("systemctl status novacomd.service >&2");
+    # to prevent non-deterministic failure,
+    # make sure the daemon is really listening
+    $machine->waitForOpenPort(6968);
+    $machine->succeed("novacom -l");
+
+    # Stop the daemon, double-check novacom fails if daemon isn't working
+    $machine->stopJob("novacomd");
+    $machine->fail("novacom -l");
+
+    # And back again for good measure
+    $machine->startJob("novacomd");
+    # make sure the daemon is really listening
+    $machine->waitForOpenPort(6968);
+    $machine->succeed("novacom -l");
+  '';
+})