utils/vmbox/tests
Krzysztof kuhy Rudnicki b4a5b4f899 vmbox: add the host-side test suite the README already promised
README documented `bats tests/test_vmbox.bats` covering "name validation,
meta handling, serial rotation and the full verdict table", and the handoff
made it a done-condition, but the file did not exist. Written to that spec:
39 tests, no VM boot, well under a second.

VMBOX_HOME is redirected to a per-test mktemp dir, so the suite can create
and delete VM state without any chance of clobbering a live sandbox's overlay
or pidfile; one test asserts every path helper stays inside it.

The verdict cases encode the distinctions the design turns on rather than just
exercising the function: guest:true with a truncated serial log is DIRTY (3)
and not a clean poweroff, POWERDOWN alone proves nothing and must read as
"none", an unrecognised shutdown reason fails closed at 6 rather than passing
silently, and events.jsonl is read last-event-first so a previous boot's
poweroff is never mistaken for this run's outcome.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VdyMBGCrGVGDWtJ9xe48f3
2026-08-22 22:06:13 +02:00
..
destructive_demo.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
shutdown_verdict_demo.sh vmbox: add the end-to-end acceptance demos 2026-08-22 21:08:53 +02:00
test_vmbox.bats vmbox: add the host-side test suite the README already promised 2026-08-22 22:06:13 +02:00