nixos/test-driver: always respect --dump-vsock

Before, the vsocks the test-run will use were only printed in
interactive mode. However, with `enableDebugHook = true;` this
functionality can also be used via `breakpointHook` within the build
sandbox, i.e. in the non-interactive mode.

I misremembered how much effort this is to fix, otherwise, I would've
added this to #422066 already ;)
This commit is contained in:
Maximilian Bosch 2025-08-10 18:25:57 +02:00
parent febe951bcd
commit 9b1025c7fd
No known key found for this signature in database

View File

@ -148,11 +148,11 @@ def main() -> None:
args.global_timeout,
debug=debugger,
) as driver:
if offset := args.dump_vsocks:
driver.dump_machine_ssh(offset)
if args.interactive:
history_dir = os.getcwd()
history_path = os.path.join(history_dir, ".nixos-test-history")
if offset := args.dump_vsocks:
driver.dump_machine_ssh(offset)
ptpython.ipython.embed(
user_ns=driver.test_symbols(),
history_filename=history_path,