test: record the resume itself and show it in the guide
Stop before the jump into the restored system, because the virtual GPU of the test machine does not repaint after a restore.
This commit is contained in:
2 files changed
+3
-6
No files matched your search
@@ -85,6 +85,8 @@ stage 2, from `sysinit.target` on.
|
||||
|
||||
## Resuming from hibernation
|
||||
|
||||
<img src="https://codeberg.org/wvhulle/bootvine/raw/branch/recordings/hibernate-resume.webp" width="640" alt="The tree held still during a resume, with the kernel's image loading progress in a band across the middle of the screen">
|
||||
|
||||
Resuming from hibernation looks different from a boot, because the kernel
|
||||
freezes every process before it loads the image, bootvine included. The tree
|
||||
stops moving, and a band across the middle of the screen shows the kernel's own
|
||||
|
||||
@@ -13,9 +13,7 @@ def assert_console_returned():
|
||||
assert console_level() == BOOT_CONSOLE_LEVEL, f"kernel console level was not restored: {console_level()}"
|
||||
|
||||
|
||||
recording = ScreenRecording(machine)
|
||||
machine.start()
|
||||
recording.start()
|
||||
|
||||
machine.wait_for_unit("default.target")
|
||||
assert_console_returned()
|
||||
@@ -29,22 +27,19 @@ machine.succeed(
|
||||
|
||||
machine.execute("systemctl hibernate >&2 &", check_return=False)
|
||||
machine.wait_for_shutdown()
|
||||
recording.stop()
|
||||
|
||||
resume_recording = ScreenRecording(machine)
|
||||
resume_recording.frames_directory = os.path.join(machine.out_dir, "resume-recording")
|
||||
resume_recording.frame_seconds = 0.1
|
||||
machine.start()
|
||||
resume_recording.start()
|
||||
machine.wait_for_console_text("Image loading progress")
|
||||
machine.wait_for_console_text("Image loading done")
|
||||
resume_recording.stop()
|
||||
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 foreground_terminal() != f"tty{BOOTVINE_TERMINAL}", "the restored system came back on bootvine's terminal"
|
||||
machine.fail("systemctl is-active bootvine")
|
||||
|
||||
resume_recording.stop()
|
||||
|
||||
machine.crash()
|
||||
machine.start()
|
||||
machine.wait_for_unit("default.target")
|
||||
|
||||
Reference in new issue
Block a user