feat: show why units failed, with their last journal lines

Failed jobs keep their kind: units that broke or timed out get a failure
panel entry with the reason systemd reports (exit status, signal, timeout,
start limit, status text) and their last journal lines read through
libsystemd. Units that failed only through a dependency are dimmed and left
out of the panel, and units that crash after starting count as failed.

Restructure the repository around this:
- move the library and binary into bootvine/ and the scripted demos into
  their own unpublished scripted-demos crate, with their VHS tapes
- move the crane builds and NixOS module into nix/
- group each sample VM with its check under vm-tests/, adding text-console,
  scripted-initrd, encrypted-volume and failures machines and a vm-failures
  check
- add docs/guide.md walking through the screen with every recording, keep
  one recording in the README, and re-render all recordings
This commit is contained in:
Willem Vanhulle committed 2026-10-30 14:59:10 +01:00
1 parent f2544a964a
commit 7e95cbd8e9
96 files changed
+2027 -462

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
{ machine, pkgs }:
let
secretDisk = import ./secret-disk.nix { inherit pkgs; };
in
{
name = "bootvine-luks-passphrase";
nodes.machine = {
imports = [ machine ];
testing.initrdBackdoor = true;
virtualisation.qemu.options = [
"-vga none"
"-device virtio-vga,xres=1280,yres=800"
];
virtualisation.qemu.drives = [ secretDisk.qemuDrive ];
};
testScript = ''
PASSPHRASE = "${secretDisk.passphrase}"
''
+ builtins.readFile ../shared/console.py
+ builtins.readFile ./check.py;
}
+31
View File
@@ -0,0 +1,31 @@
def answered_prompts():
return bootvine_journal().count("answered a password prompt")
def pending_prompt():
listing = machine.succeed("ls /run/systemd/ask-password").split()
return next((name for name in listing if name.startswith("ask.")), "")
machine.start()
retry(lambda _: pending_prompt() != "", timeout_seconds=60)
wait_for_screen("passphrase")
assert_text_visible(font_has_512_glyphs=True)
first_prompt = pending_prompt()
machine.send_chars("not the passphrase\n")
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()
machine.wait_for_unit("multi-user.target")
machine.succeed("test -e /dev/mapper/secret")
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"
+11
View File
@@ -0,0 +1,11 @@
{ lib, pkgs, ... }:
let
secretDisk = import ./secret-disk.nix { inherit pkgs; };
in
{
boot.initrd.luks.devices = lib.mkVMOverride {
secret.device = "/dev/disk/by-uuid/${secretDisk.uuid}";
};
virtualisation.vmVariant.virtualisation.qemu.drives = [ secretDisk.qemuDrive ];
}
+22
View File
@@ -0,0 +1,22 @@
{ pkgs }:
let
passphrase = "sample passphrase";
uuid = "9d1f2a8e-0b7c-4c55-9a8e-6b2f8f3c1d00";
image = pkgs.runCommand "bootvine-luks-disk" { nativeBuildInputs = [ pkgs.cryptsetup ]; } ''
truncate -s 32M disk.img
echo -n '${passphrase}' | cryptsetup luksFormat -q --disable-locks --type luks2 \
--pbkdf pbkdf2 --pbkdf-force-iterations 1000 --uuid ${uuid} disk.img -
mv disk.img $out
'';
in
{
inherit passphrase uuid;
qemuDrive = {
name = "secret";
file = "${image}";
driveExtraOpts = {
format = "raw";
snapshot = "on";
};
};
}