mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
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.
23 lines
422 B
Nix
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}"
|
|
)
|
|
'';
|
|
}
|