Files
bootvine/tests/vm-checks/boot.nix
T
Willem Vanhulle 631315ffe1 fix: yield the console once the display manager starts
Since the boot only counted as complete when the default target was
reached, bootvine kept taking its terminal back from a display manager
that started while another unit still held graphical.target. The
StartupFinished signal was never parsed either, so nothing else ended
the watch.
2026-10-24 20:00:29 +02:00

40 lines
1.1 KiB
Nix

{ sampleMachine }:
{
name = "bootvine-boot-and-shutdown";
nodes.machine =
{ lib, ... }:
let
waitFor = flag: "/bin/sh -c 'until [ -e /run/${flag} ]; do sleep 0.1; done'";
in
{
imports = [ sampleMachine ];
testing.initrdBackdoor = true;
boot.initrd.systemd.services.demo-initrd-probe.serviceConfig.ExecStart = lib.mkForce (
waitFor "release-initrd-probe"
);
systemd = {
settings.Manager.ShowStatus = lib.mkForce true;
services.demo-db.serviceConfig.ExecStop = lib.mkForce (waitFor "release-demo-db");
services.backdoor.before = [ "demo-db.service" ];
services.demo-late-sensor = {
wantedBy = [ "graphical.target" ];
after = [ "greetd.service" ];
serviceConfig = {
Type = "oneshot";
ExecStart = waitFor "release-late-sensor";
};
};
};
virtualisation = {
memorySize = 2048;
qemu.options = [
"-vga none"
"-device virtio-vga,xres=1280,yres=800"
];
};
};
testScript = builtins.readFile ./console.py + builtins.readFile ./boot.py;
}