From f04a31dc0675f8ce127cde41fe6a4884a54fc36b Mon Sep 17 00:00:00 2001 From: BFE Engineering Date: Wed, 28 Oct 2026 10:39:31 -0600 Subject: [PATCH] qemu: ui-drive --init-chain and the assert_ui_chain verb (flare-edge#2210) ui-drive.sh --init-chain DIR lays the panel's scripts over the rootfs (ROOTFS_OVERLAY) and boots with warden.initchain; it refuses a missing directory or one without etc/init.d/S99lvgl before anything is built. qmp.py assert_ui_chain [ACCOUNT] reads the guest over the control channel (@procs, @cat) and fails unless exactly one warden-ui and one warden-ui-run loop run, the UI's real, effective, saved and filesystem uids are all the account's (never 0), the safe-mode flag is absent and /tmp/warden-ui.log holds no exit or refusal of warden-ui-run. tests/scripts/init-chain-ui.txt runs it at about T+120 s. Tests: UiChainVerb in test_qmp_drive.py (12 cases, among them the #1903 case: no UI, safe mode, three exits); 6 of 6 mutants caught. rootfs-overlay.sh gains the three ui-drive.sh --init-chain checks. Refs flare-edge#2210 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01KerYPVh72hhNgKi3wS5ijG --- qemu/README.md | 7 +- qemu/tests/qmp.py | 92 ++++++++++++++++++ qemu/tests/rootfs-overlay.sh | 24 +++++ qemu/tests/scripts/init-chain-ui.txt | 11 +++ qemu/tests/test_qmp_drive.py | 139 +++++++++++++++++++++++++++ qemu/tests/ui-drive.sh | 19 +++- 6 files changed, 290 insertions(+), 2 deletions(-) create mode 100644 qemu/tests/scripts/init-chain-ui.txt diff --git a/qemu/README.md b/qemu/README.md index c240ad7..983ada5 100644 --- a/qemu/README.md +++ b/qemu/README.md @@ -106,6 +106,11 @@ daemons in place of its direct root start of `warden-ui`. S99lvgl then runs differences: the splash handover is marked done (no S09splash) and warden-ui-run passes `-b fbdev`, not the panel's `-b drm`. A chain boot with no script prints `WARDEN-QEMU-INITCHAIN-EMPTY` and starts no UI. +`tests/ui-drive.sh --init-chain ` does both steps, and the drive verb +`assert_ui_chain` judges the result: one `warden-ui` and one `warden-ui-run`, +the UI's four uids all `warden-ui`'s, no safe-mode flag, and no exit or +refusal in `/tmp/warden-ui.log`. `tests/scripts/init-chain-ui.txt` runs the +check at about T+120 s. A flow seed may contain `qemu-flow-setup.sh`. Stage-2 init runs it inside the disposable guest after mounting userdata and before starting daemons or the @@ -128,7 +133,7 @@ All take the virt-fragment ``; `FLARE_EDGE=` where noted. | `ui-drive.sh