From e824748cbda958c147ccd1110306f1b8ce6e0b72 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 10 Nov 2026 06:22:47 +0000 Subject: [PATCH] test(stick): the fixed screen's first test, fallback; Task 5's increments in the plan (#92, 5.1) [skip ci] Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2 --- ...-10-29-stick-5-proxy-zuse-and-real-zuse.md | 9 ++- scripts/qemu_session.py | 55 ++++++++++++++++++- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/docs/v4.0.0/plans/2026-10-29-stick-5-proxy-zuse-and-real-zuse.md b/docs/v4.0.0/plans/2026-10-29-stick-5-proxy-zuse-and-real-zuse.md index 9d7c4458..af4d9efa 100644 --- a/docs/v4.0.0/plans/2026-10-29-stick-5-proxy-zuse-and-real-zuse.md +++ b/docs/v4.0.0/plans/2026-10-29-stick-5-proxy-zuse-and-real-zuse.md @@ -361,7 +361,14 @@ Tasks 1-3 accepted and merged (#159, master 594d2f93); #155 merged with them. - [x] 4.8 `mint_zuse` passes on amd64 (4.7); the other sessions written (`mint_zuse_refuse`, `mint_small`, `mint_zuse_used`, `mint_pull_system`, `zuse_stick_first`; the data stick's QEMU device now `id=datadev`, so it can be pulled) -- all five PASS on amd64 (logs/20261110-0441* .. 0449*). Left for 4.8: `mint_zuse` on aarch64 and riscv64; the regressions (`genesis`, `two_sticks`, `hotplug`, `midpull`, `typeahead`). Then the other tests: `mint_zuse_refuse`, `mint_pull_system`, `zuse_stick_first`, `mint_small`, the pair's stick offered - [x] 4.9 regressions, full acceptance on three ISAs: 538/538, word_count=318, dict_hash 0x8c92508f748f99cf on the three, the stick high, test-32 0 failures; FABRIC-3 XLVIII.16. **Task 4 accepted.** -**Next: Task 5** -- the fixed screen, R, the old stick refused, `mint_fail`, the system stick pulled while hers is in. +**Task 5, the fixed screen** (increments, as Task 4's): +- [x] 5.1 the first failing test: mode `fallback` (a mint, then the data stick booted alone: the four lines, no prompt, keys dropped; her stick added: the prompt; pulled: the screen again; R with no stick: the plug-in line, any key stops it) +- [ ] 5.2 run `fallback` before any kernel change: FAIL expected (the proxy with a real key stays headless, no screen) +- [ ] 5.3 the fixed screen in `sk_v4_identity_wait()`: shown while `g_proxy_fallback`; R runs `sk_v4_mint_zuse()`; every other key dropped +- [ ] 5.4 her stick pulled: the fixed screen again (not headless) +- [ ] 5.5 the system stick pulled while hers is in: hers let go first (the chain's tail) +- [ ] 5.6 the other sessions: `replace` (R, a new stick, the old one refused), `mint_fail` (blkdebug write errors), `real_pull`, `system_pull_real` +- [ ] 5.7 regressions, full acceptance, FABRIC entry, commit; then the SER5 bench steps in `boards/BRINGUP.md` (Task 5 step 6) Working notes: the boot's own words are `sk_v4_words[]` in `kernel/src/v4/sk_v4.c`, served by `sk_v4_serve(node, request)` with request = index + 1 (`BYE` is 1). Sticks are added in the harness diff --git a/scripts/qemu_session.py b/scripts/qemu_session.py index e1cf10d9..1aff4606 100755 --- a/scripts/qemu_session.py +++ b/scripts/qemu_session.py @@ -78,6 +78,10 @@ the stick's, plan 2026-10-26-stick-1-screen-and-keyboard.md): written", session ended, headless; replugged: the proxy logs in again zuse_stick_first after a mint on a data stick made in the session, the same copy booted again with her stick on port 1 and the data stick on port 2 (Review Focus 1): she is logged in + fallback a mint on a data stick made in the session, then that stick booted alone (plan + 2026-10-29-stick-5, Task 5): the fixed screen's four lines, no ok> for 30 s, `3 4 + .` + typed there not run; her stick added: the prompt; pulled: the screen again; R with no + stick offered: the plug-in line, any key stops it, the screen again bam_flush --target qemu-stick --stick-gib 16: an Artemis block changed and SAVE-BUFFERS'd three times, each timed (TIME:); each answers ok within 2 s (#155: it took 5-6 s); then the BAM's bytes on the stick hashed (BAM:), to be the same before and after #155's change @@ -125,7 +129,7 @@ NO_ZUSE_MODES = {"gpt_zuse", "gpt_hotplug", "gpt_foreign", "gpt_bad_crc", "gpt_b "screen_dark_until_login", "screen_console_after_login", "screen_dark_after_logout", "kbd_typeahead", "stick_boot", "stick_v3", "stick_zuse", "screen_boot", "genesis", "stick_genesis", "stick_grow", "stick_small", "bam_flush", - "zuse_stick_first"} + "zuse_stick_first", "fallback"} label = a.label or f"{a.mode}-{a.arch}" work = os.path.join(ROOT, "build", "qemu-session", label) shutil.rmtree(work, ignore_errors=True) @@ -177,7 +181,7 @@ if a.stick_gib: make_args.append(f"STICK_GIB={a.stick_gib}") if a.mode in ("stick_grow", "stick_small", "bam_flush"): make_args.append("KERNEL_ARGS=--log-level=info") # the blk: disk lines the sizes are read from -if a.mode == "zuse_stick_first": +if a.mode in ("zuse_stick_first", "fallback"): # a data stick made once into the session's directory: minted on, then booted again dstick = os.path.join(work, "data.img") subprocess.run(["make", "-f", "kernel/Makefile", f"ARCH={a.arch}", "datastick", f"DATASTICK_IMG={dstick}"], @@ -666,6 +670,53 @@ elif m in ("mint_zuse_refuse", "mint_small", "mint_zuse_used", "mint_pull_system check("no genesis on the second boot", count(r"Zuse: genesis minted") == 0) check("no fault", count(r"EXCEPTION|PANIC|panic") == 0) +elif m == "fallback": + SCREEN = [r"Zuse's stick is not here\.", r"Plug it in to log in\.", + r"Or plug in another stick and press R to mint a replacement", + r"-- the old Zuse stick will stop working\."] + img = os.path.join(work, "zuse-real.img") + subprocess.run(["truncate", "-s", "600M", img], check=True) + check("[zuse@Hera] ok> (the proxy, first boot)", wait_for(PROMPT, 300)) + type_line("MINT-ZUSE") + wait_for(r"MINT-ZUSE: plug in the stick for the real Zuse", 60) + add_stick(1, img, 3) + wait_for(r"MINT-ZUSE: type YES to write it", 120) + type_line("YES") + check("the real Zuse minted (first boot)", wait_for(r"Zuse: real Zuse minted onto the second stick", 300)) + shutdown() + print("-- the second boot: the data stick alone", flush=True) + boot([x for x in make_args if x != "clean"]) + check("POST: PASSED (second boot)", wait_for(r"POST: PASSED", 900)) + shown = all(wait_for(line, 120) for line in SCREEN) + check("the fixed screen: its four lines", shown, near=r"Artemis: |Zuse") + check("no ok> for 30 s", not wait_for(ANYPROMPT, 30)) + type_line("3 4 + .") + time.sleep(5) + c = count(r"Zuse: identity confirmed from attached thumbdrive") + add_stick(2, img, 3) + check("her stick added: identity confirmed", wait_for(r"Zuse: identity confirmed from attached thumbdrive", 120, c)) + check("the prompt", wait_for(PROMPT, 60)) + time.sleep(3) + check("what was typed on the screen did not run (no 7)", re.search(r"\b7\s+ok", text()) is None) + n = count(PROMPT) + type_line("3 4 + .") + check("7 ok at her prompt", wait_for(PROMPT, 60, n) and re.search(r"7\s+ok", text()[-400:]) is not None) + shots = count(SCREEN[0]) + qcmd("device_del", id="stickdev2") + check("pulled: session ended", wait_for(r"Zuse: session ended -- reattach to re-authenticate", 60)) + check("pulled: the fixed screen again", wait_for(SCREEN[0], 60, shots)) + qcmd("blockdev-del", **{"node-name": "stick2"}) + shots = count(SCREEN[0]) + p0 = count(r"MINT-ZUSE: plug in the stick for the real Zuse") + s.send(b"R") + check("R with no stick: the plug-in line", wait_for(r"MINT-ZUSE: plug in the stick for the real Zuse", 60, p0)) + time.sleep(2) + s.send(b"x") + check("any key stops it", wait_for(r"MINT-ZUSE: stopped -- nothing written", 60), near=r"MINT-ZUSE") + check("the fixed screen again", wait_for(SCREEN[0], 60, shots)) + check("no ok> on the screen", "ok> " not in text()[text().rfind("Zuse: session ended"):]) + check("no fault", count(r"EXCEPTION|PANIC|panic") == 0) + elif m == "mint_zuse": blank = os.path.join(work, "zuse-real.img") subprocess.run(["truncate", "-s", "600M", blank], check=True)