ipn: don't listen on the unspecified address in test

To avoid the Mac firewall dialog of (test) death.

See 4521a59f30
which I added to help debug this.
This commit is contained in:
Brad Fitzpatrick
2020-04-28 19:20:02 -07:00
parent d2b7cb1e45
commit e1526b796e
2 changed files with 20 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ import (
"net/http/cookiejar"
"net/http/httptest"
"net/url"
"os"
"strings"
"testing"
"time"
@@ -26,6 +27,13 @@ import (
"tailscale.io/control" // not yet released
)
func init() {
// Hacky way to signal to magicsock for now not to bind on the
// unspecified address. TODO(bradfitz): clean up wgengine's
// constructors.
os.Setenv("IN_TS_TEST", "1")
}
func TestIPN(t *testing.T) {
testy.FixLogs(t)
defer testy.UnfixLogs(t)