test: use a plain VGA device to show the restored system
virtio-vga shows its old VGA framebuffer after a restore and never repaints, which left a stale screen in the recording and sample machine whether or not bootvine ran. A plain VGA device repaints, so the recording can run through to the restored login prompt.
This commit is contained in:
3 files changed
+18
-3
No files matched your search
@@ -7,7 +7,6 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
machine
|
machine
|
||||||
../shared/recorded-display.nix
|
|
||||||
"${pkgs.path}/nixos/tests/common/auto-format-root-device.nix"
|
"${pkgs.path}/nixos/tests/common/auto-format-root-device.nix"
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -25,6 +24,13 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
|
memorySize = 2048;
|
||||||
|
qemu.options = [
|
||||||
|
"-vga none"
|
||||||
|
"-device VGA,xres=1280,yres=800"
|
||||||
|
"-chardev socket,id=recording-monitor,path=recording-monitor,server=on,wait=off"
|
||||||
|
"-mon chardev=recording-monitor,mode=readline"
|
||||||
|
];
|
||||||
emptyDiskImages = [ 4096 ];
|
emptyDiskImages = [ 4096 ];
|
||||||
useNixStoreImage = true;
|
useNixStoreImage = true;
|
||||||
useEFIBoot = true;
|
useEFIBoot = true;
|
||||||
|
|||||||
@@ -34,11 +34,12 @@ machine.start()
|
|||||||
resume_recording.start()
|
resume_recording.start()
|
||||||
machine.wait_for_console_text("Image loading progress")
|
machine.wait_for_console_text("Image loading progress")
|
||||||
machine.wait_for_console_text("Image loading done")
|
machine.wait_for_console_text("Image loading done")
|
||||||
resume_recording.stop()
|
|
||||||
machine.succeed(f"grep '{SENTINEL_TEXT}' /run/test/sentinel")
|
machine.succeed(f"grep '{SENTINEL_TEXT}' /run/test/sentinel")
|
||||||
assert console_level() == BOOT_CONSOLE_LEVEL, f"the restored system kept the opened level: {console_level()}"
|
assert console_level() == BOOT_CONSOLE_LEVEL, f"the restored system kept the opened level: {console_level()}"
|
||||||
assert foreground_terminal() != f"tty{BOOTVINE_TERMINAL}", "the restored system came back on bootvine's terminal"
|
assert foreground_terminal() != f"tty{BOOTVINE_TERMINAL}", "the restored system came back on bootvine's terminal"
|
||||||
machine.fail("systemctl is-active bootvine")
|
machine.fail("systemctl is-active bootvine")
|
||||||
|
machine.sleep(1)
|
||||||
|
resume_recording.stop()
|
||||||
|
|
||||||
machine.crash()
|
machine.crash()
|
||||||
machine.start()
|
machine.start()
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
|
boot.initrd.availableKernelModules = [ "bochs" ];
|
||||||
|
|
||||||
virtualisation.vmVariant = {
|
virtualisation.vmVariant = {
|
||||||
boot.resumeDevice = "/dev/vdb";
|
boot.resumeDevice = "/dev/vdb";
|
||||||
swapDevices = lib.mkOverride 0 [
|
swapDevices = lib.mkOverride 0 [
|
||||||
@@ -8,6 +10,12 @@
|
|||||||
options = [ "x-systemd.makefs" ];
|
options = [ "x-systemd.makefs" ];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
virtualisation.emptyDiskImages = [ 4096 ];
|
virtualisation = {
|
||||||
|
emptyDiskImages = [ 4096 ];
|
||||||
|
qemu.options = lib.mkForce [
|
||||||
|
"-vga none"
|
||||||
|
"-device VGA,xres=1920,yres=1080"
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user