cmd/tailscale/cli: fix TestUpdatePrefs over Tailscale SSH (#7374)
Fixes #7373 Signed-off-by: Jordan Whited <jordan@tailscale.com>pull/7375/head
parent
b0eba129e6
commit
d4122c9f0a
|
@ -1078,6 +1078,13 @@ func TestUpdatePrefs(t *testing.T) {
|
||||||
old := getSSHClientEnvVar
|
old := getSSHClientEnvVar
|
||||||
getSSHClientEnvVar = func() string { return "100.100.100.100 1 1" }
|
getSSHClientEnvVar = func() string { return "100.100.100.100 1 1" }
|
||||||
t.Cleanup(func() { getSSHClientEnvVar = old })
|
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 == "" {
|
if tt.env.goos == "" {
|
||||||
tt.env.goos = "linux"
|
tt.env.goos = "linux"
|
||||||
|
|
Loading…
Reference in New Issue