qemu: rig agent, a framed guest shell on its own serial port (flare-edge M9 soak-lite) #40

Merged
noah merged 3 commits from rb/d15-rig-agent into rebuild 2026-10-31 19:40:35 -06:00
Owner

Rig agent for the QEMU soak rig (flare-edge M9 soak-lite, d10 6.5). The flare-edge flow rig drives the guest through QMP and the ctl bridge only; the soak needs bus reads and writes, the clock and /proc inside the gate image without touching the network the soak pulls.

Changes

  • run.sh --agent SOCK: a third pci-serial after ctl and rs485 (their ttyS order is unchanged) and warden.agent on the command line.
  • rootfs/sbin/init: on warden.agent, runs warden_agent on ttyS2 (with ctl) or ttyS1 (without), echo off.
  • rootfs/etc/warden-lib.sh warden_agent: @run ID SECS B64 runs a script and answers <<BEGIN ID>>, the base64 of its stdout and stderr, <<END ID RC>>; @chunk ID B64 gets past the 4095-byte cooked line; a script past its deadline is killed with its process group and answers 124 (the panel BusyBox has no timeout); a malformed request answers one <<ERR ...>> line and runs nothing.
  • Rig rootfs only: no panel image carries it.

Tests

  • qemu/tests/agent-test.sh (new, in CI under sh and busybox sh): 18 checks, OK under dash, busybox sh and bash locally.
  • qemu/tests/run-sh-args-test.sh: new cases (agent chardev after rs485 and ctl; warden.agent only with the flag). All pass.
  • End to end: the flare-edge consumer is tools/soak/rig-qemu.py (flare-edge PR from rb/d15-m9-guest-channel, which pins this commit); its QEMU proof run is linked there.

Generated with Claude Code

https://claude.ai/code/session_01BdKQBQkJkq4zE7iPFMkAhS

Rig agent for the QEMU soak rig (flare-edge M9 soak-lite, d10 6.5). The flare-edge flow rig drives the guest through QMP and the ctl bridge only; the soak needs bus reads and writes, the clock and /proc inside the gate image without touching the network the soak pulls. ## Changes - `run.sh --agent SOCK`: a third pci-serial after ctl and rs485 (their ttyS order is unchanged) and `warden.agent` on the command line. - `rootfs/sbin/init`: on `warden.agent`, runs `warden_agent` on ttyS2 (with ctl) or ttyS1 (without), echo off. - `rootfs/etc/warden-lib.sh` `warden_agent`: `@run ID SECS B64` runs a script and answers `<<BEGIN ID>>`, the base64 of its stdout and stderr, `<<END ID RC>>`; `@chunk ID B64` gets past the 4095-byte cooked line; a script past its deadline is killed with its process group and answers 124 (the panel BusyBox has no timeout); a malformed request answers one `<<ERR ...>>` line and runs nothing. - Rig rootfs only: no panel image carries it. ## Tests - `qemu/tests/agent-test.sh` (new, in CI under sh and busybox sh): 18 checks, OK under dash, busybox sh and bash locally. - `qemu/tests/run-sh-args-test.sh`: new cases (agent chardev after rs485 and ctl; warden.agent only with the flag). All pass. - End to end: the flare-edge consumer is `tools/soak/rig-qemu.py` (flare-edge PR from rb/d15-m9-guest-channel, which pins this commit); its QEMU proof run is linked there. Generated with Claude Code https://claude.ai/code/session_01BdKQBQkJkq4zE7iPFMkAhS
noah added 1 commit 2026-10-31 17:24:10 -06:00
qemu: rig agent, a framed guest shell on its own serial port (flare-edge M9 soak-lite)
ci / test (push) Successful in 10s
ci / patches-apply (push) Successful in 25s
ci / quality (push) Successful in 36s
ci / badges (push) Skipped
ci / kernel-symbols (push) Successful in 4m38s
ci / mcdc (push) Successful in 37s
ci / bench (push) Successful in 6s
ci / qemu-tools (push) Failing after 15s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / test (pull_request) Successful in 9s
ci / prune-artifacts (pull_request) Skipped
ci / mcdc (pull_request) Successful in 34s
ci / bench (pull_request) Successful in 20s
ci / kernel-build (pull_request) Skipped
ci / qemu-tools (pull_request) Failing after 57s
ci / patches-apply (pull_request) Successful in 1m16s
ci / kernel-symbols (pull_request) Successful in 2m14s
ci / badges (pull_request) Skipped
ci / quality (pull_request) Successful in 2m51s
579ac260ca
run.sh --agent SOCK adds a third pci-serial after ctl and rs485 (their
ttyS order is unchanged) and warden.agent on the command line. Stage-2
init then runs warden_agent (rootfs/etc/warden-lib.sh) on that port with
echo off: `@run ID SECS B64` runs a script and answers <<BEGIN ID>>, the
base64 of its output and <<END ID RC>>; `@chunk` pieces get past the
4095-byte cooked line; a script past its deadline is killed with its
process group and answers 124 (the panel BusyBox has no timeout). It is
the guest channel of flare-edge tools/soak/rig-qemu.py, which needs bus
reads and writes, the clock and /proc inside the gate image. Rig rootfs
only: no panel image carries it.

Tests: qemu/tests/agent-test.sh (sh and busybox sh, in CI) and new
run-sh-args-test.sh cases (agent last, warden.agent only with the flag).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBQkJkq4zE7iPFMkAhS
noah added 1 commit 2026-10-31 18:11:36 -06:00
qemu: agent-test.sh passes shellcheck (SC2016 on the guest-side script)
ci / quality (push) Successful in 34s
ci / badges (push) Skipped
ci / bench (pull_request) Successful in 1m5s
ci / prune-artifacts (pull_request) Skipped
ci / quality (pull_request) Successful in 35s
ci / badges (pull_request) Skipped
ci / test (push) Successful in 8s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / mcdc (push) Successful in 34s
ci / bench (push) Successful in 5s
ci / qemu-tools (push) Failing after 50s
ci / patches-apply (push) Successful in 21s
ci / test (pull_request) Successful in 20s
ci / mcdc (pull_request) Successful in 55s
ci / qemu-tools (pull_request) Failing after 49s
ci / patches-apply (pull_request) Successful in 1m29s
ci / kernel-build (pull_request) Skipped
ci / kernel-symbols (push) Successful in 4m52s
ci / kernel-symbols (pull_request) Successful in 5m54s
bbc91618f8
The qemu-tools job (run 10385) failed shellcheck on the single-quoted
script the test hands the agent: its expansions belong to the agent's
shell, so the info finding is disabled on that line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBQkJkq4zE7iPFMkAhS
noah added 1 commit 2026-10-31 18:49:48 -06:00
qemu: agent-test.sh counts a zombie child as killed (CI containers reap nothing)
ci / patches-apply (push) Successful in 1m1s
ci / test (pull_request) Successful in 9s
ci / kernel-build (pull_request) Skipped
ci / quality (pull_request) Successful in 28s
ci / mcdc (push) Successful in 35s
ci / bench (push) Successful in 7s
ci / test (push) Successful in 12s
ci / prune-artifacts (push) Skipped
ci / kernel-build (push) Skipped
ci / badges (push) Skipped
ci / qemu-tools (push) Successful in 2m21s
ci / bench (pull_request) Successful in 7s
ci / mcdc (pull_request) Successful in 35s
ci / kernel-symbols (push) Successful in 4m10s
ci / quality (push) Successful in 29s
ci / prune-artifacts (pull_request) Skipped
ci / qemu-tools (pull_request) Successful in 2m6s
ci / patches-apply (pull_request) Successful in 1m8s
ci / badges (pull_request) Skipped
ci / kernel-symbols (pull_request) Successful in 3m49s
1e182a44e4
Run 10403: under a CI job container's non-reaping PID 1 the script child
the deadline killed stays a zombie, and kill -0 still found it. The check
now reads the process state from /proc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBQkJkq4zE7iPFMkAhS
noah merged commit b8d9d541fe into rebuild 2026-10-31 19:40:35 -06:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blueflare/bfe-core1106-sdk#40