Repository navigation
test(tunnel): cover stop and start in the end-to-end script - #96
Merged
Merged
Conversation
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.
What problem does this solve?
The end-to-end script verified the live browser path but had no way to exercise the new park/resume lifecycle against a real tunnel. This adds that round trip as an opt-in section, and this PR doubles as the record for the real-machine verification pass ahead of the release.
How does it work at a high level?
scripts/test-tunnel-e2e.sh [hostname] [port] --lifecycle <peer>appends six checks after the existing read-only five: stop → status reportsstopped (by request)with exit 0 → listener gone → start → the same local port listening again (polled up to 20 s for ssh to connect) →tunnel checkpasses.TAILROUTE_BINto override) so it can verify a build before the release that ships these verbs reaches brew.--lifecyclethe script is byte-for-byte the same read-only check as before. Usage errors exit 2.Breaking changes or migration steps?
None — opt-in flag; the default invocation is unchanged.
Manual testing steps
Script side:
shellcheckclean,bash -nclean, both usage-error paths exit 2, the default path runs unchanged.Real-machine verification record
Done — macOS 27.0.1 (26A434), Apple silicon, real registered tunnel with one forward:
scripts/test-tunnel-e2e.sh <peer>.<tailnet>.ts.net 8448 --lifecycle <peer>→Result: 11 passed, 0 failed(L1 stop · L2stopped (by request)exit 0 · L3 no listener parked · L4 start · L5 same port 8448 back · L6tunnel checkpasses). Re-run by the owner on the console: read-only checks 5/5.print-disabledline format (macOS 27) — while parked, exactly:startthe line persists as=> enabled(upsert-only store model confirmed on real launchd). Status JSON while parked:job=stopped stopped=true disabled=true healthy=true.stop, one real GUI logout + one full reboot: the disable flag survived both (=> disabledafter each), status stayedstopped (by request)with exit 0, no listener on the port, while a second non-disabled tunnel on the same account came backrunningat login (control group — proves the logout actually tore down the GUI launchd domain). Thenstart→Started, and one more logout/login:Job: running, forwardlistening, verified, store line=> enabled— the resumed tunnel survives login and the flag is gone.Still owed — need a human at the console or another machine:
print-disabledformat on the macOS 15 floor and on macOS 26 — verified on all three supported versions via clean macOS VMs (Tart/Virtualization.framework, ARM; provisioned, probed, and deleted for this check):"com.tailroute.format-probe" => disabledwhile disabled; the line persists as=> enabledafterlaunchctl enable(upsert-only model holds on 15). Floor clear — no matcher change needed.=> disableddisabled,=> enabledafter enable.Probe method per machine: throwaway
/bin/trueLaunchAgent label →launchctl disable→launchctl print-disabled gui/$UID | grep <label>→ exact line recorded → probe label removed.stop→remove→add <peer> --ssh-alias <alias> --remote-port 443 --yes:after
stopthe store read=> disabled; afterremove("hosts entry and launchd job cleaned up") it read=> enabled— the flag was cleared, not left to poison the re-add; theaddthen completed the full transaction (registry → hosts → plist → enable+bootstrap → live TLS verification) with noROLLED BACKand noBootstrap failed: 5, re-picked the same local port 8448, and finished healthy:Job: running, forwardlistening, verified,tunnel check→: check PASSED, store=> enabled.Related issues or PRs
Verifies #89–#95 on real hardware. Gates the next release.