Each sample machine now has a VM check, including new ones for text-console and scripted-initrd. While a check runs, a recorder takes a frame every half second through a second QEMU monitor socket, and record-screencasts encodes the frames into recordings/<machine>.webp with img2webp, dropping the BIOS frames at other resolutions. The guide shows each machine's recording in the section it illustrates, replacing the PNG screenshots. The checks are now named vm-<machine>.
29 lines
1.0 KiB
Python
29 lines
1.0 KiB
Python
def unit_state(unit):
|
|
return machine.succeed(f"systemctl is-active {unit} || true").strip()
|
|
|
|
|
|
recording = ScreenRecording(machine)
|
|
machine.start()
|
|
recording.start()
|
|
|
|
wait_for_screen("Stage 2", "sample-database")
|
|
assert_bootvine_in_front()
|
|
assert_text_visible(font_has_512_glyphs=True)
|
|
|
|
machine.wait_for_unit("greetd.service")
|
|
retry(lambda _: unit_state("bootvine") == "inactive", timeout_seconds=60)
|
|
journal = bootvine_journal()
|
|
print(journal)
|
|
watched = [line for line in journal.splitlines() if line.startswith("bootvine: watching")]
|
|
assert watched, "bootvine never started"
|
|
assert not any(" in Initrd " in line for line in watched), "bootvine ran in a scripted initrd"
|
|
assert "handing the console over" in journal, "never handed the console over"
|
|
|
|
machine.succeed("systemctl poweroff --no-block")
|
|
retry(lambda _: unit_state("sample-database") == "deactivating", timeout_seconds=60)
|
|
wait_for_screen("Shutdown", "sample-database")
|
|
assert_bootvine_in_front()
|
|
machine.succeed("touch /run/release-sample-database")
|
|
machine.wait_for_shutdown()
|
|
recording.stop()
|