MCPcopy
hub / github.com/tailscale/tailscale / startNode

Function startNode

cmd/sniproxy/sniproxy_test.go:91–113  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context, controlURL, hostname string)

Source from the content-addressed store, hash-verified

89}
90
91func 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
115func TestSNIProxyWithNetmapConfig(t *testing.T) {
116 nettest.SkipIfNoNetwork(t)

Callers 2

Calls 6

CloseMethod · 0.95
UpMethod · 0.95
HelperMethod · 0.65
TempDirMethod · 0.65
CleanupMethod · 0.65
FatalMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…