Skip to content

Fix OpenWrt procd smoke: anchor sentinel matching and escape [owrt] in expect puts - #179

Draft
jamiesun with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-guest-fetch-failure
Draft

jamiesun with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-guest-fetch-failure

Conversation

Copilot AI commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

The OpenWrt procd smoke expect driver matched bare "FETCH_OK" / "FETCH_FAIL" / "NETUP_DONE" substrings, so the serial console's echo of the sent command line (... && echo FETCH_OK || echo FETCH_FAIL) satisfied the success branch before the guest printed the real result — a failed uclient-fetch went unnoticed and the script continued to the missing /tmp/guest-smoke.sh. The eventual timeout branch then died with invalid command name "owrt" because unescaped [owrt] in puts triggers Tcl command substitution, masking the true failure point (CI runs 27677458092, 27816136090).

Changes (test/openwrt/run.sh)

  • Anchor sentinel matching to standalone output lines: "FETCH_OK", "FETCH_FAIL", and "NETUP_DONE" glob matches replaced with -re {[\r\n]MARKER[\r\n]}. In the echoed command line the markers are preceded by a space, so only the real guest output (\r\n-delimited) matches — the fetch-failure branch now fires immediately with exit 3.
  • Escape [owrt] literals in Tcl puts: all 5 occurrences changed to \[owrt\] so timeout/error messages print correctly instead of raising a Tcl error.
expect {
	-re {[\r\n]FETCH_OK[\r\n]}   {}
	-re {[\r\n]FETCH_FAIL[\r\n]} { puts "\n\[owrt\] cannot reach host HTTP server"; exit 3 }
	timeout      { puts "\n\[owrt\] fetch timeout"; exit 3 }
}

Verified against simulated serial output (command echo followed by FETCH_FAIL, plus the RTNETLINK answers: Network unreachable noise before NETUP_DONE seen in the failing runs): the fail path now exits through the fetch-failure branch, and the success path still matches the standalone marker lines.

Copilot AI changed the title [WIP] Fix procd smoke misreading echoed FETCH_OK message Fix OpenWrt procd smoke: anchor sentinel matching and escape [owrt] in expect puts Jul 10, 2026
Copilot AI requested a review from jamiesun July 10, 2026 14:17

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[openwrt] procd smoke misreads echoed FETCH_OK and hides guest fetch failures

2 participants