2018-02-20 10:03:49 -07:00
|
|
|
import ./make-test.nix ({ pkgs, ...} : {
|
|
|
|
name = "novacomd";
|
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
|
|
|
maintainers = [ dtzWill ];
|
|
|
|
};
|
|
|
|
|
2018-07-20 14:56:59 -06:00
|
|
|
machine = { ... }: {
|
2018-02-20 10:03:49 -07:00
|
|
|
services.novacomd.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2018-09-04 14:39:01 -06:00
|
|
|
$machine->waitForUnit("multi-user.target");
|
2018-02-20 10:03:49 -07:00
|
|
|
|
2018-09-04 14:39:01 -06:00
|
|
|
# multi-user.target wants novacomd.service, but let's make sure
|
2018-02-20 10:03:49 -07:00
|
|
|
$machine->waitForUnit("novacomd.service");
|
|
|
|
|
|
|
|
# Check status and try connecting with novacom
|
|
|
|
$machine->succeed("systemctl status novacomd.service >&2");
|
2018-09-04 14:39:01 -06:00
|
|
|
# to prevent non-deterministic failure,
|
|
|
|
# make sure the daemon is really listening
|
|
|
|
$machine->waitForOpenPort(6968);
|
2018-02-20 10:03:49 -07:00
|
|
|
$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");
|
2018-09-04 14:39:01 -06:00
|
|
|
# make sure the daemon is really listening
|
|
|
|
$machine->waitForOpenPort(6968);
|
2018-02-20 10:03:49 -07:00
|
|
|
$machine->succeed("novacom -l");
|
|
|
|
'';
|
|
|
|
})
|