nixosTests.scanservjs: init

Test that the service runs and uses our configured (TCP) port.

This should prevent https://github.com/NixOS/nixpkgs/issues/475043
("nixos/scanservjs: settings (host/port) ignored in v3.0.4") from
happening again.
This commit is contained in:
Bjørn Forsman 2026-06-07 20:34:15 +02:00
commit 32157e1c52
2 changed files with 24 additions and 0 deletions

View file

@ -1489,6 +1489,7 @@ in
sane = runTest ./sane.nix;
sanoid = runTest ./sanoid.nix;
saunafs = runTest ./saunafs.nix;
scanservjs = runTest ./scanservjs.nix;
scaphandre = runTest ./scaphandre.nix;
schleuder = runTest ./schleuder.nix;
scion-freestanding-deployment = runTest ./scion/freestanding-deployment;

View file

@ -0,0 +1,23 @@
let
port = 1234;
in
{
name = "scanservjs";
nodes.machine =
{ ... }:
{
services.scanservjs = {
enable = true;
settings.host = "0.0.0.0";
settings.port = port;
};
};
testScript = ''
machine.wait_for_unit("scanservjs.service")
machine.wait_until_succeeds(
"curl --silent --fail --show-error --location http://localhost:${toString port}"
)
'';
}