From 75f2fddb65c0d0b7659282a1e210bd2ddb3abefa Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 13 Nov 2026 21:10:04 +0000 Subject: populate: stop if a flake's URL can't be found The URLs of flakes went into nix flake lock's and nix flake metadata's arguments as command substitutions, whose failure doesn't stop a script under set -e. After "error: source p is not a directory", nix flake lock ran with an empty URL, which Nix takes for the current directory: on a remote target, the login directory, which ended up in the world-readable store, .ssh included. URLs get assigned first now, so failing to find one stops populate. A phase's unexpected lists what populate is expected not to print, whether it succeeds or not; notdir expects populate not to go on locking. --- tests/vm.nix | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/vm.nix') diff --git a/tests/vm.nix b/tests/vm.nix index d7b2f60..7c362f5 100644 --- a/tests/vm.nix +++ b/tests/vm.nix @@ -158,6 +158,11 @@ in pkgs.testers.runNixOSTest { f"env HOME=/root {phase['env']} timeout {limit} {phase['populate']} &1", timeout=900, ) + for unexpected in phase["unexpected"]: + if unexpected in out: + raise Exception( + f"populate {i} prints {unexpected!r}:\n{out}" + ) if phase["interrupt"] is not None: if status != 124: raise Exception(f"populate {i} ends on its own:\n{out}") -- cgit v1.3.1