| 89 | } |
| 90 | |
| 91 | func startNode(t *testing.T, ctx context.Context, controlURL, hostname string) (*tsnet.Server, key.NodePublic, netip.Addr) { |
| 92 | t.Helper() |
| 93 | |
| 94 | tmp := filepath.Join(t.TempDir(), hostname) |
| 95 | os.MkdirAll(tmp, 0755) |
| 96 | s := &tsnet.Server{ |
| 97 | Dir: tmp, |
| 98 | ControlURL: controlURL, |
| 99 | Hostname: hostname, |
| 100 | Store: new(mem.Store), |
| 101 | Ephemeral: true, |
| 102 | } |
| 103 | if *verboseNodes { |
| 104 | s.Logf = log.Printf |
| 105 | } |
| 106 | t.Cleanup(func() { s.Close() }) |
| 107 | |
| 108 | status, err := s.Up(ctx) |
| 109 | if err != nil { |
| 110 | t.Fatal(err) |
| 111 | } |
| 112 | return s, status.Self.PublicKey, status.TailscaleIPs[0] |
| 113 | } |
| 114 | |
| 115 | func TestSNIProxyWithNetmapConfig(t *testing.T) { |
| 116 | nettest.SkipIfNoNetwork(t) |