nixos: Add basic test of novacomd
This commit is contained in:
parent
e5e29284a9
commit
f32139cf78
28
nixos/tests/novacomd.nix
Normal file
28
nixos/tests/novacomd.nix
Normal file
|
@ -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");
|
||||||
|
'';
|
||||||
|
})
|
Loading…
Reference in a new issue