utils/vmbox/lib
Krzysztof kuhy Rudnicki 8bb4d3a60d vmbox: bound every wait, so an unbootable guest fails instead of hanging
Testing boot_recovery produced a guest that cannot boot: boot-repair read
/boot/vmlinuz-linux and initramfs-linux.img on this BIOS/GRUB guest as
"orphaned kernel files shadowing the ESP" and deleted them, leaving the
sandbox at a GRUB prompt. That is a legitimate sandbox outcome -- destroying
the guest is what the tool is for -- but vmbox handled it by hanging.

Two independent unbounded waits, both fixed:

- vm_wait_ssh counted only its `sleep 2` calls, ignoring the up-to-5s
  ConnectTimeout each failed probe spends inside ssh. A nominal 150s wait ran
  past 400s (measured, then cut short by the harness). It now works to a wall
  clock deadline: the same guest is now reported unreachable in 156s.

- _run_recover_rc reboots the stopped guest to read the recorded exit code,
  and fell through to an unbounded serial console read: 180s for a prompt
  that never comes plus 300s for a command that never runs, all AFTER the
  verdict had already been printed. Recovery is best-effort by definition, so
  both bounds are now short (60s/30s) and overridable.

serial_exec's timeouts become env-overridable to make that possible.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VdyMBGCrGVGDWtJ9xe48f3
2026-08-22 22:31:39 +02:00
..
base.sh vmbox: disposable Arch VM sandbox for destructive system tests 2026-08-22 20:47:56 +02:00
common.sh vmbox: derive the peer IP from the NIC's MAC; document that VM-to-VM is broken 2026-08-22 21:23:37 +02:00
launch.sh vmbox: VM-to-VM networking works (the transport was fine, my pairing was not) 2026-08-22 21:26:47 +02:00
overlay.sh vmbox: wait for qemu to release the overlay before recreating it 2026-08-22 21:28:02 +02:00
qmp.py vmbox: disposable Arch VM sandbox for destructive system tests 2026-08-22 20:47:56 +02:00
recorder.py vmbox: disposable Arch VM sandbox for destructive system tests 2026-08-22 20:47:56 +02:00
repo.sh vmbox: share host repos by bind mount, not symlink 2026-08-22 21:15:57 +02:00
run.sh vmbox: bound every wait, so an unbootable guest fails instead of hanging 2026-08-22 22:31:39 +02:00
screenshot.sh vmbox: disposable Arch VM sandbox for destructive system tests 2026-08-22 20:47:56 +02:00
seed.sh vmbox: disposable Arch VM sandbox for destructive system tests 2026-08-22 20:47:56 +02:00
serial_exec.py vmbox: bound every wait, so an unbootable guest fails instead of hanging 2026-08-22 22:31:39 +02:00
smoke.sh vmbox: add a serial transport so shutdown tests do not depend on sshd 2026-08-22 20:58:22 +02:00
ssh.sh vmbox: bound every wait, so an unbootable guest fails instead of hanging 2026-08-22 22:31:39 +02:00
verdict.sh vmbox: disposable Arch VM sandbox for destructive system tests 2026-08-22 20:47:56 +02:00