mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 04:55:31 +00:00
net/portmapper: add envknob to disable portmapper in localhost integration tests
Updates #11962 Change-Id: I8212cd814985b455d96986de0d4c45f119516cb3 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
7e0dd61e61
commit
ce8969d82b
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
"go4.org/mem"
|
"go4.org/mem"
|
||||||
"tailscale.com/control/controlknobs"
|
"tailscale.com/control/controlknobs"
|
||||||
|
"tailscale.com/envknob"
|
||||||
"tailscale.com/net/netaddr"
|
"tailscale.com/net/netaddr"
|
||||||
"tailscale.com/net/neterror"
|
"tailscale.com/net/neterror"
|
||||||
"tailscale.com/net/netmon"
|
"tailscale.com/net/netmon"
|
||||||
@ -32,6 +33,8 @@
|
|||||||
"tailscale.com/util/clientmetric"
|
"tailscale.com/util/clientmetric"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var disablePortMapperEnv = envknob.RegisterBool("TS_DISABLE_PORTMAPPER")
|
||||||
|
|
||||||
// DebugKnobs contains debug configuration that can be provided when creating a
|
// DebugKnobs contains debug configuration that can be provided when creating a
|
||||||
// Client. The zero value is valid for use.
|
// Client. The zero value is valid for use.
|
||||||
type DebugKnobs struct {
|
type DebugKnobs struct {
|
||||||
@ -55,6 +58,9 @@ type DebugKnobs struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (k *DebugKnobs) disableAll() bool {
|
func (k *DebugKnobs) disableAll() bool {
|
||||||
|
if disablePortMapperEnv() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
if k.DisableAll != nil {
|
if k.DisableAll != nil {
|
||||||
return k.DisableAll()
|
return k.DisableAll()
|
||||||
}
|
}
|
||||||
|
@ -1262,6 +1262,7 @@ func (n *testNode) StartDaemonAsIPNGOOS(ipnGOOS string) *Daemon {
|
|||||||
"TS_NETCHECK_GENERATE_204_URL="+n.env.ControlServer.URL+"/generate_204",
|
"TS_NETCHECK_GENERATE_204_URL="+n.env.ControlServer.URL+"/generate_204",
|
||||||
"TS_ASSUME_NETWORK_UP_FOR_TEST=1", // don't pause control client in airplane mode (no wifi, etc)
|
"TS_ASSUME_NETWORK_UP_FOR_TEST=1", // don't pause control client in airplane mode (no wifi, etc)
|
||||||
"TS_PANIC_IF_HIT_MAIN_CONTROL=1",
|
"TS_PANIC_IF_HIT_MAIN_CONTROL=1",
|
||||||
|
"TS_DISABLE_PORTMAPPER=1", // shouldn't be needed; test is all localhost
|
||||||
)
|
)
|
||||||
if version.IsRace() {
|
if version.IsRace() {
|
||||||
cmd.Env = append(cmd.Env, "GORACE=halt_on_error=1")
|
cmd.Env = append(cmd.Env, "GORACE=halt_on_error=1")
|
||||||
|
Loading…
Reference in New Issue
Block a user