From 4705c4e7a712608fc4ac365bf09151eb61be4295 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Wed, 28 Oct 2026 17:09:50 +0100 Subject: tests/{default,rust-motd}: Make `start` argument in `services` more logical --- tests/by-name/ru/rust-motd/test.nix | 6 ++++-- tests/default.nix | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'tests') 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" ( -- cgit v1.3.1