fix(test): fix Tcl quoting in RunInteractive and openboot isolation in FirstTimeUser#94
Merged
Conversation
…n FirstTimeUser
RunInteractive was using shellescape() (POSIX single-quote escaping) to
quote the spawn command in the expect script. Tcl does not treat ' as a
quoting character, so the command was split on whitespace and bash received
fragmented args — causing 'unexpected EOF while looking for matching quote'.
Fix: use Tcl brace quoting {cmd} so the entire string is one Tcl word.
TestVM_Journey_FirstTimeUser/bare_system_has_no_openboot was failing because
TestVM_Interactive_InstallScript installs openboot via brew on the same host,
and the next test finds it with 'which openboot'. Fix: add openboot to the
brew uninstall call at the start of FirstTimeUser setup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix 1 —
RunInteractiveTcl quoting (testutil/machost.go)shellescape()produces POSIX single-quote escaping ('cmd'), but Tcl does not treat'as a quoting character — it splits on whitespace, sospawn bash -c 'cmd with spaces'becomesbash -c 'cmd with+spaces'as separate args. Bash then receives a fragmented script and reportsunexpected EOF while looking for matching quote.Fix: replace
shellescapewithtclBracewhich wraps the command in Tcl brace quotes{cmd}, making it a single word with no substitution. Falls back to Tcl double-quote escaping if the command contains{or}.Fix 2 —
TestVM_Journey_FirstTimeUserisolation (vm_user_journey_test.go)TestVM_Interactive_InstallScriptinstallsopenbootviabrew install, leaving/opt/homebrew/bin/openbooton the runner. The next test (FirstTimeUser) then failsbare_system_has_no_openbootbecausewhich openbootfinds it.Fix: add
openbootto thebrew uninstallcall at the start ofFirstTimeUsersetup.Test plan
vm-e2e-spikeand confirmTestVM_Interactive_InstallScriptruns (no SKIP, no FAIL) andFirstTimeUserpasses