feat: record every sample machine's boot as an animated WebP
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>.
This commit is contained in:
1 parent
7e95cbd8e9
commit
c5e2e16b67
21 files changed
+402
-106
No files matched your search
@@ -3,16 +3,15 @@ let
|
||||
secretDisk = import ./secret-disk.nix { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
name = "bootvine-luks-passphrase";
|
||||
name = "bootvine-encrypted-volume";
|
||||
nodes.machine = {
|
||||
imports = [ machine ];
|
||||
imports = [
|
||||
machine
|
||||
../shared/recorded-display.nix
|
||||
];
|
||||
|
||||
testing.initrdBackdoor = true;
|
||||
|
||||
virtualisation.qemu.options = [
|
||||
"-vga none"
|
||||
"-device virtio-vga,xres=1280,yres=800"
|
||||
];
|
||||
virtualisation.qemu.drives = [ secretDisk.qemuDrive ];
|
||||
};
|
||||
|
||||
@@ -20,5 +19,6 @@ in
|
||||
PASSPHRASE = "${secretDisk.passphrase}"
|
||||
''
|
||||
+ builtins.readFile ../shared/console.py
|
||||
+ builtins.readFile ../shared/screen_recording.py
|
||||
+ builtins.readFile ./check.py;
|
||||
}
|
||||
@@ -7,7 +7,9 @@ def pending_prompt():
|
||||
return next((name for name in listing if name.startswith("ask.")), "")
|
||||
|
||||
|
||||
recording = ScreenRecording(machine)
|
||||
machine.start()
|
||||
recording.start()
|
||||
|
||||
retry(lambda _: pending_prompt() != "", timeout_seconds=60)
|
||||
wait_for_screen("passphrase")
|
||||
@@ -18,7 +20,6 @@ retry(lambda _: answered_prompts() == 1, timeout_seconds=30)
|
||||
retry(lambda _: pending_prompt() not in ("", first_prompt), timeout_seconds=30)
|
||||
wait_for_screen("passphrase")
|
||||
assert_text_visible(font_has_512_glyphs=True)
|
||||
machine.screenshot("passphrase")
|
||||
machine.send_chars(f"{PASSPHRASE}\n")
|
||||
machine.wait_for_unit("systemd-cryptsetup@secret.service")
|
||||
machine.switch_root()
|
||||
@@ -29,3 +30,4 @@ journal = bootvine_journal()
|
||||
print(journal)
|
||||
assert " in Initrd " in journal, "never ran in the initrd"
|
||||
assert journal.count("answered a password prompt") == 2, "did not answer both attempts itself"
|
||||
recording.stop()
|
||||
Reference in new issue
Block a user