cmd/tailscale/cli: fix TestUpdatePrefs over Tailscale SSH (#7374)

Fixes #7373

Signed-off-by: Jordan Whited <jordan@tailscale.com>
pull/7375/head
Jordan Whited 1 year ago committed by GitHub
parent b0eba129e6
commit d4122c9f0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1078,6 +1078,13 @@ func TestUpdatePrefs(t *testing.T) {
old := getSSHClientEnvVar
getSSHClientEnvVar = func() string { return "100.100.100.100 1 1" }
t.Cleanup(func() { getSSHClientEnvVar = old })
} else if isSSHOverTailscale() {
// The test is being executed over a "real" tailscale SSH
// session, but sshOverTailscale is unset. Make the test appear
// as if it's not over tailscale SSH.
old := getSSHClientEnvVar
getSSHClientEnvVar = func() string { return "" }
t.Cleanup(func() { getSSHClientEnvVar = old })
}
if tt.env.goos == "" {
tt.env.goos = "linux"

Loading…
Cancel
Save