From 59b1063ec5174bc0848f4bea37c8b603e23aa967 Mon Sep 17 00:00:00 2001 From: SomeoneSerge Date: Fri, 16 Aug 2024 16:28:09 +0000 Subject: nixosTests: allow extending testScript without overriding it --- nixos/tests/all-tests.nix | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index adeaf65..b79b198 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -42,13 +42,20 @@ builtins.mapAttrs { inherit name; imports = value.imports ++ [ dsl ]; - testScript = '' - start_all() - substituter.wait_for_unit("nix-serve.service") - builder.succeed("dag-test") - ''; + testScript = + value.testScriptPre or "" + + '' + start_all() + substituter.wait_for_unit("nix-serve.service") + builder.succeed("dag-test") + '' + + value.testScriptPost or ""; } - // builtins.removeAttrs value [ "imports" ] + // builtins.removeAttrs value [ + "imports" + "testScriptPre" + "testScriptPost" + ] ) ) { -- cgit v1.2.3