MCPcopy
hub / github.com/tailscale/tailscale / TestIsNetstack

Function TestIsNetstack

wgengine/userspace_ext_test.go:18–36  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

16)
17
18func TestIsNetstack(t *testing.T) {
19 sys := tsd.NewSystem()
20 e, err := wgengine.NewUserspaceEngine(
21 tstest.WhileTestRunningLogger(t),
22 wgengine.Config{
23 SetSubsystem: sys.Set,
24 HealthTracker: sys.HealthTracker.Get(),
25 Metrics: sys.UserMetricsRegistry(),
26 EventBus: sys.Bus.Get(),
27 },
28 )
29 if err != nil {
30 t.Fatal(err)
31 }
32 defer e.Close()
33 if !sys.IsNetstack() {
34 t.Errorf("IsNetstack = false; want true")
35 }
36}
37
38func TestIsNetstackRouter(t *testing.T) {
39 tests := []struct {

Callers

nothing calls this directly

Calls 9

UserMetricsRegistryMethod · 0.95
IsNetstackMethod · 0.95
NewSystemFunction · 0.92
NewUserspaceEngineFunction · 0.92
WhileTestRunningLoggerFunction · 0.92
GetMethod · 0.65
FatalMethod · 0.65
CloseMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…