aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-10-28 17:09:50 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-10-28 17:09:50 +0100
commit4705c4e7a712608fc4ac365bf09151eb61be4295 (patch)
treec302886ec80343b1a75dc7213e4da945f15b9e17 /tests
parenttests/rocie: Wait for open ports before checking starting test (diff)
downloadnixos-server-4705c4e7a712608fc4ac365bf09151eb61be4295.zip
tests/{default,rust-motd}: Make `start` argument in `services` more logical
Diffstat (limited to 'tests')
-rw-r--r--tests/by-name/ru/rust-motd/test.nix6
-rw-r--r--tests/default.nix17
2 files changed, 16 insertions, 7 deletions
diff --git a/tests/by-name/ru/rust-motd/test.nix b/tests/by-name/ru/rust-motd/test.nix
index 864607c..b50abf5 100644
--- a/tests/by-name/ru/rust-motd/test.nix
+++ b/tests/by-name/ru/rust-motd/test.nix
@@ -12,8 +12,10 @@ vhack.runTest {
services = [
{
- server = "rust-motd.service";
- start = true;
+ server = {
+ name = "rust-motd.service";
+ should_be_started = true;
+ };
}
];
diff --git a/tests/default.nix b/tests/default.nix
index ebf2e96..88ea7d9 100644
--- a/tests/default.nix
+++ b/tests/default.nix
@@ -147,11 +147,18 @@
waitForServices = builtins.concatStringsSep "\n" (
builtins.map (attr: let
split = splitAttr attr;
- in " maybe_wait(${split.name},\"${split.value}\", ${
- if (builtins.hasAttr "start" attr && attr.start)
- then "True"
- else "False"
- })")
+ name =
+ if builtins.isAttrs split.value
+ then split.value.name
+ else split.value;
+ should_be_started =
+ if builtins.isAttrs split.value
+ then
+ if split.value.should_be_started
+ then "True"
+ else "False"
+ else "False";
+ in " maybe_wait(${split.name},\"${name}\", ${should_be_started})")
args.services
);
waitForPorts = builtins.concatStringsSep "\n" (