nixos: Add basic test of novacomd

+28
+28
nixos/tests/novacomd.nix
··· 1 + import ./make-test.nix ({ pkgs, ...} : { 2 + name = "novacomd"; 3 + meta = with pkgs.stdenv.lib.maintainers; { 4 + maintainers = [ dtzWill ]; 5 + }; 6 + 7 + machine = { config, pkgs, ... }: { 8 + services.novacomd.enable = true; 9 + }; 10 + 11 + testScript = '' 12 + startAll; 13 + 14 + $machine->waitForUnit("novacomd.service"); 15 + 16 + # Check status and try connecting with novacom 17 + $machine->succeed("systemctl status novacomd.service >&2"); 18 + $machine->succeed("novacom -l"); 19 + 20 + # Stop the daemon, double-check novacom fails if daemon isn't working 21 + $machine->stopJob("novacomd"); 22 + $machine->fail("novacom -l"); 23 + 24 + # And back again for good measure 25 + $machine->startJob("novacomd"); 26 + $machine->succeed("novacom -l"); 27 + ''; 28 + })