From eaf2dbf1673c23eeda6763f7f0be3ca6bd5d42b9 Mon Sep 17 00:00:00 2001 From: cproudlock Date: Sat, 2 May 2026 17:45:06 -0400 Subject: [PATCH] test harness: smoke-pass B-enforce, fix four issues Harness now passes 9/9 across baseline + heal + idempotent phases on the win11 VM (Standard/Machine), with 6 drift scenarios applied + healed between the baseline and heal cycles in ~30s total. Fixes: 1. lib/qga-run.py - extracted the qga round-trip out of an inline `python3 - < --- .../common/test/B-enforce/run.sh | 36 ++++++------- .../common/test/lib/qga-run.py | 42 ++++++++++++++++ .../shopfloor-setup/common/test/lib/qga.sh | 50 +++++++------------ .../shopfloor-setup/common/test/matrix.json | 2 +- 4 files changed, 79 insertions(+), 51 deletions(-) create mode 100644 playbook/shopfloor-setup/common/test/lib/qga-run.py diff --git a/playbook/shopfloor-setup/common/test/B-enforce/run.sh b/playbook/shopfloor-setup/common/test/B-enforce/run.sh index ca10832..bd81623 100755 --- a/playbook/shopfloor-setup/common/test/B-enforce/run.sh +++ b/playbook/shopfloor-setup/common/test/B-enforce/run.sh @@ -114,30 +114,32 @@ if ($f) { Get-Content $f.FullName -Tail 25 } else { "no enforce log" } EOF } -run_verify() { - local phase_label="$1" - log "verify ($phase_label)..." - if qga_run_ps <<'EOF' | tee /dev/stderr | grep -q '=== verify summary' && qga_run_ps <<'EOF2' | grep -qE '0/[0-9]+ passed|^=== verify summary: ([0-9]+)/\1 passed'; then :; fi -& 'C:\Tools\test-harness\verify-state.ps1' -MatrixPath 'C:\Tools\test-harness\matrix.json' -PCType '$PCTYPE' -PCSubType '$PCSUBTYPE' -EOF -EOF2 -} - -# Simpler verify wrapper: capture output, parse summary line +# Verify wrapper: capture output, parse summary line. PS verify returns +# rc=1 when any check fails - capture that without aborting the harness. do_verify() { local phase_label="$1" expect_pass="$2" log "verify ($phase_label, expect_pass=$expect_pass)" - local out + local out rc=0 out=$(qga_run_ps <