aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to '')
-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" (