tailscale/tstest
Josh Bleecher Snyder 63cd581c3f safesocket: add ConnectionStrategy, provide control over fallbacks
fee2d9fad added support for cmd/tailscale to connect to IPNExtension.
It came in two parts: If no socket was provided, dial IPNExtension first,
and also, if dialing the socket failed, fall back to IPNExtension.

The second half of that support caused the integration tests to fail
when run on a machine that was also running IPNExtension.
The integration tests want to wait until the tailscaled instances
that they spun up are listening. They do that by dialing the new
instance. But when that dial failed, it was falling back to IPNExtension,
so it appeared (incorrectly) that tailscaled was running.
Hilarity predictably ensued.

If a user (or a test) explicitly provides a socket to dial,
it is a reasonable assumption that they have a specific tailscaled
in mind and don't want to fall back to IPNExtension.
It is certainly true of the integration tests.

Instead of adding a bool to Connect, split out the notion of a
connection strategy. For now, the implementation remains the same,
but with the details hidden a bit. Later, we can improve that.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-12-09 15:46:38 -08:00
..
archtest go.mod: bump netstack for mipsle fix 2021-11-01 11:23:05 -07:00
integration safesocket: add ConnectionStrategy, provide control over fallbacks 2021-12-09 15:46:38 -08:00
natlab fix: typo spelling grammar 2021-08-24 07:55:04 -07:00
staticcheck tstest/staticcheck: import the main package to fix "go mod tidy" 2021-02-20 09:53:47 -08:00
allocs.go util/testingutil: new package with MinAllocsPerRun 2021-10-28 12:48:37 -07:00
clock.go tstest/natlab: add a stateful firewall. 2020-07-11 05:17:38 +00:00
log_test.go tstest: rename LogListener to LogLineTracker 2020-09-04 08:09:56 -07:00
log.go tstest: make MemLogger.String acquire its mutex 2021-09-09 11:38:06 -07:00
resource.go net/dns{,/resolver}: refactor DNS forwarder, send out of right link on macOS/iOS 2021-06-23 16:04:10 -07:00
tstest.go tstest: add WaitFor helper 2021-04-29 14:43:46 -07:00