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>.
47 lines
1.3 KiB
Nix
47 lines
1.3 KiB
Nix
{ machine, ... }:
|
|
{
|
|
name = "bootvine-failures";
|
|
|
|
nodes.machine =
|
|
{ pkgs, ... }:
|
|
let
|
|
holdUntilReleased =
|
|
marker: "${pkgs.bash}/bin/bash -c 'until [ -e /run/${marker} ]; do sleep 0.1; done'";
|
|
in
|
|
{
|
|
imports = [
|
|
machine
|
|
../shared/recorded-display.nix
|
|
];
|
|
bootvineSample.startFailuresByHand = true;
|
|
testing.initrdBackdoor = true;
|
|
|
|
boot.initrd.systemd = {
|
|
storePaths = [ "${pkgs.bash}/bin/bash" ];
|
|
services.initrd-failures-hold = {
|
|
description = "Initrd held for the check";
|
|
wantedBy = [ "initrd.target" ];
|
|
before = [ "initrd.target" ];
|
|
unitConfig.DefaultDependencies = false;
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
ExecStart = holdUntilReleased "release-initrd-failures-hold";
|
|
};
|
|
};
|
|
};
|
|
|
|
systemd.services.boot-failures-hold = {
|
|
description = "Boot held for the check";
|
|
wantedBy = [ "multi-user.target" ];
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
ExecStart = holdUntilReleased "release-boot-failures-hold";
|
|
};
|
|
};
|
|
|
|
};
|
|
|
|
testScript = builtins.readFile ../shared/console.py
|
|
+ builtins.readFile ../shared/screen_recording.py + builtins.readFile ./check.py;
|
|
}
|