summary refs log tree commit diff
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2018-02-20 11:03:49 -0600
committerWill Dietz <w@wdtz.org>2018-02-20 11:03:49 -0600
commitf32139cf78bf587c36f98e2b777f6de1317ebf2e (patch)
treea1f8671828eaa638795bf257a899536eeb3c2f06
parente5e29284a91cc6b3f18ab5525b144a219b6d8d3f (diff)
downloadnixpkgs-f32139cf78bf587c36f98e2b777f6de1317ebf2e.tar
nixpkgs-f32139cf78bf587c36f98e2b777f6de1317ebf2e.tar.gz
nixpkgs-f32139cf78bf587c36f98e2b777f6de1317ebf2e.tar.bz2
nixpkgs-f32139cf78bf587c36f98e2b777f6de1317ebf2e.tar.lz
nixpkgs-f32139cf78bf587c36f98e2b777f6de1317ebf2e.tar.xz
nixpkgs-f32139cf78bf587c36f98e2b777f6de1317ebf2e.tar.zst
nixpkgs-f32139cf78bf587c36f98e2b777f6de1317ebf2e.zip
nixos: Add basic test of novacomd
-rw-r--r--nixos/tests/novacomd.nix28
1 files changed, 28 insertions, 0 deletions
diff --git a/nixos/tests/novacomd.nix b/nixos/tests/novacomd.nix
new file mode 100644
index 00000000000..21b86f6dae2
--- /dev/null
+++ b/nixos/tests/novacomd.nix
@@ -0,0 +1,28 @@
+import ./make-test.nix ({ pkgs, ...} : {
+  name = "novacomd";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ dtzWill ];
+  };
+
+  machine = { config, pkgs, ... }: {
+    services.novacomd.enable = true;
+  };
+
+  testScript = ''
+    startAll;
+
+    $machine->waitForUnit("novacomd.service");
+
+    # Check status and try connecting with novacom
+    $machine->succeed("systemctl status novacomd.service >&2");
+    $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");
+    $machine->succeed("novacom -l");
+  '';
+})