nixpkgs/nixos/tests/scanservjs.nix
Bjørn Forsman 32157e1c52 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.
2026-06-08 18:11:50 +02:00

23 lines
422 B
Nix

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}"
)
'';
}