From a41662f03370349375020aee24e49d9be43c1f0a Mon Sep 17 00:00:00 2001 From: mosaic-coder Date: Sun, 26 Jul 2026 08:33:36 -0500 Subject: [PATCH] test(wake): I14 blank-reset assertion BusyBox-grep-portable (grep -z unsupported on Alpine CI) + portability sweep MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #931 CI (node:24-alpine, musl/BusyBox) went RED: the I14 blank-reset assertion used `grep -qz` (NUL-data), a GNU-only extension BusyBox grep does NOT support (its option list is -HhnlLoqvsrRiwFE -m -A -B -C -e -f — no -z). BusyBox grep printed usage + exited non-zero, tripping `|| fail_msg`. Passed locally only because GNU grep has -z. Toolchain-divergence class (cf. #912, BusyBox sed). Fix (test-only; product drop-in is correct, verify-single already proves exactly-one): assert the blank-reset FORM portably — `grep -A1 '^OnUnitActiveSec=$' | grep -qx 'OnUnitActiveSec=30min'` still requires the empty reset line IMMEDIATELY followed by the value, and still catches the negative control. Also simplified a sibling `grep -qi 'EXACTLY ONE\|exactly one'` to `grep -qi 'exactly one'` (drop the BRE alternation; -i already covers case). Sweep of all packages/mosaic/framework/tools/wake/test-*.sh for BusyBox- incompatible constructs (grep -z/-P, sed \xNN/\b/-i, gawk-isms, date -d/%N): the only #931-introduced defect was this one. Verified in the real Alpine image (node:24-alpine, BusyBox v1.37.0): all 9 wake harnesses + full test:framework- shell green under BusyBox with CI=woodpecker (openssl present, I8 HMAC leg runs). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_0158NZqN2n2ymKFeJAZ4GUCb --- packages/mosaic/framework/tools/wake/test-wake-install.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/mosaic/framework/tools/wake/test-wake-install.sh b/packages/mosaic/framework/tools/wake/test-wake-install.sh index 2e414df2..794e0293 100755 --- a/packages/mosaic/framework/tools/wake/test-wake-install.sh +++ b/packages/mosaic/framework/tools/wake/test-wake-install.sh @@ -411,9 +411,13 @@ echo "== I14: per-class fallback cadence — blank-reset yields EXACTLY ONE OnUn # write-fallback-cadence writes the per-class cadence in BLANK-RESET form. out="$(bash "$WI" write-fallback-cadence 30min 2>&1)"; rc=$? [ "$rc" -eq 0 ] || fail_msg "I14: write-fallback-cadence must succeed + verify single (rc=$rc) [$out]" - echo "$out" | grep -qi 'EXACTLY ONE\|exactly one' || fail_msg "I14: the cadence write must confirm exactly-one OnUnitActiveUSec [$out]" + echo "$out" | grep -qi 'exactly one' || fail_msg "I14: the cadence write must confirm exactly-one OnUnitActiveUSec [$out]" [ -f "$UD/$TIMER.d/cadence.conf" ] || fail_msg "I14: the per-class cadence drop-in must be written under .d/" - grep -qz $'OnUnitActiveSec=\nOnUnitActiveSec=30min' "$UD/$TIMER.d/cadence.conf" \ + # Assert the blank-reset FORM: an empty `OnUnitActiveSec=` reset line IMMEDIATELY + # FOLLOWED by the new value. Portable across GNU and BusyBox grep (Alpine CI) — + # `grep -z` (NUL-data) is a GNU-only extension BusyBox grep does NOT support, so + # match the reset line and require the value on the very next line (-A1) instead. + grep -A1 '^OnUnitActiveSec=$' "$UD/$TIMER.d/cadence.conf" | grep -qx 'OnUnitActiveSec=30min' \ || fail_msg "I14: the drop-in must use the blank-reset form (empty reset line, then the value)" bash "$WI" verify-single "$TIMER" >/dev/null 2>&1 || fail_msg "I14: base(1h)+blank-reset(30min) must resolve exactly one OnUnitActiveUSec" # NEGATIVE CONTROL: a drop-in WITHOUT the reset line appends -> base 1h + 30min -> two -> fail.