From 32157e1c527cd71127d5344aaa411eea0f0233b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sun, 7 Jun 2026 20:34:15 +0200 Subject: [PATCH] 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. --- nixos/tests/all-tests.nix | 1 + nixos/tests/scanservjs.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 nixos/tests/scanservjs.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 9d01b75516f7..2d85c5f06001 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -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; diff --git a/nixos/tests/scanservjs.nix b/nixos/tests/scanservjs.nix new file mode 100644 index 000000000000..009b00a51d8e --- /dev/null +++ b/nixos/tests/scanservjs.nix @@ -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}" + ) + ''; +}