MCPcopy Index your code
hub / github.com/tailscale/tailscale / newTestLocalBackend

Function newTestLocalBackend

ipn/localapi/localapi_test.go:694–711  ·  view source on GitHub ↗
(t testing.TB)

Source from the content-addressed store, hash-verified

692}
693
694func newTestLocalBackend(t testing.TB) *ipnlocal.LocalBackend {
695 var logf logger.Logf = logger.Discard
696 sys := tsd.NewSystemWithBus(eventbustest.NewBus(t))
697 store := new(mem.Store)
698 sys.Set(store)
699 eng, err := wgengine.NewFakeUserspaceEngine(logf, sys.Set, sys.HealthTracker.Get(), sys.UserMetricsRegistry(), sys.Bus.Get())
700 if err != nil {
701 t.Fatalf("NewFakeUserspaceEngine: %v", err)
702 }
703 t.Cleanup(eng.Close)
704 sys.Set(eng)
705 lb, err := ipnlocal.NewLocalBackend(logf, logid.PublicID{}, sys, 0)
706 if err != nil {
707 t.Fatalf("NewLocalBackend: %v", err)
708 }
709 t.Cleanup(lb.Shutdown)
710 return lb
711}
712
713func TestKeepItSorted(t *testing.T) {
714 // Parse the localapi.go file into an AST.

Calls 9

NewSystemWithBusFunction · 0.92
NewBusFunction · 0.92
NewFakeUserspaceEngineFunction · 0.92
NewLocalBackendFunction · 0.92
SetMethod · 0.65
GetMethod · 0.65
FatalfMethod · 0.65
CleanupMethod · 0.65
UserMetricsRegistryMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…