From ce2cd2553a937d84f1a78386ab28502e89f247d6 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 13 Nov 2026 20:36:10 +0000 Subject: populate: exit with the status of the command that failed The shell implementation runs under set -e, so it exits with the status of the command that failed, e.g. 255 if ssh can't reach the target, which wrappers retrying on connection failures rely on, or 128 if git fetch fails. The program does the same, instead of exiting with 1, and with 128 plus the signal for a command a signal ended. A phase's expect.status is the exit status it expects populate to fail with; git-status checks git fetch's. --- tests/vm.nix | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/vm.nix') diff --git a/tests/vm.nix b/tests/vm.nix index d7b2f60..25a12a4 100644 --- a/tests/vm.nix +++ b/tests/vm.nix @@ -173,6 +173,10 @@ in pkgs.testers.runNixOSTest { raise Exception( f"populate {i} doesn't fail with {phase['expect']!r}:\n{out}" ) + elif phase["status"] is not None and status != phase["status"]: + raise Exception( + f"populate {i} exits with {status} instead of {phase['status']}:\n{out}" + ) run(node, f"KROPS_TEST_GC=1 sh {phase['check']}") if phase["checkDeployer"] is not None: run(deployer, f"sh {phase['checkDeployer']}") -- cgit v1.3.1