diff --git a/ipn/ipnlocal/c2n_test.go b/ipn/ipnlocal/c2n_test.go index aefc1694b..e5b15e79a 100644 --- a/ipn/ipnlocal/c2n_test.go +++ b/ipn/ipnlocal/c2n_test.go @@ -16,6 +16,7 @@ import ( "testing" "time" + "tailscale.com/health" "tailscale.com/ipn/store/mem" "tailscale.com/tailcfg" "tailscale.com/tstest" @@ -23,6 +24,7 @@ import ( "tailscale.com/types/logger" "tailscale.com/types/netmap" "tailscale.com/types/views" + "tailscale.com/util/eventbus/eventbustest" "tailscale.com/util/must" gcmp "github.com/google/go-cmp/cmp" @@ -33,6 +35,7 @@ func TestHandleC2NTLSCertStatus(t *testing.T) { b := &LocalBackend{ store: &mem.Store{}, varRoot: t.TempDir(), + health: health.NewTracker(eventbustest.NewBus(t)), } certDir, err := b.certDir() if err != nil { diff --git a/ipn/ipnlocal/local_test.go b/ipn/ipnlocal/local_test.go index ed4df6b44..d930735cd 100644 --- a/ipn/ipnlocal/local_test.go +++ b/ipn/ipnlocal/local_test.go @@ -7763,6 +7763,7 @@ func TestStripKeysFromPrefs(t *testing.T) { ch := make(chan *ipn.Notify, 1) b := &LocalBackend{ extHost: h, + health: health.NewTracker(eventbustest.NewBus(t)), notifyWatchers: map[string]*watchSession{ "test": {ch: ch}, }, diff --git a/ipn/ipnlocal/network-lock_test.go b/ipn/ipnlocal/network-lock_test.go index 178b8dfac..eead2d892 100644 --- a/ipn/ipnlocal/network-lock_test.go +++ b/ipn/ipnlocal/network-lock_test.go @@ -158,6 +158,7 @@ func TestTKAEnablementFlow(t *testing.T) { cc: cc, ccAuto: cc, logf: t.Logf, + health: health.NewTracker(eventbustest.NewBus(t)), pm: pm, store: pm.Store(), } @@ -244,6 +245,7 @@ func TestTKADisablementFlow(t *testing.T) { cc: cc, ccAuto: cc, logf: t.Logf, + health: health.NewTracker(eventbustest.NewBus(t)), tka: &tkaState{ authority: authority, storage: chonk, @@ -428,6 +430,7 @@ func TestTKASync(t *testing.T) { cc: cc, ccAuto: cc, logf: t.Logf, + health: health.NewTracker(eventbustest.NewBus(t)), pm: pm, store: pm.Store(), tka: &tkaState{ @@ -544,6 +547,7 @@ func TestTKASyncTriggersCompact(t *testing.T) { cc: cc, ccAuto: cc, logf: t.Logf, + health: health.NewTracker(eventbustest.NewBus(t)), pm: pm, store: pm.Store(), tka: &tkaState{ @@ -616,8 +620,9 @@ func TestTKAFilterNetmap(t *testing.T) { } b := &LocalBackend{ - logf: t.Logf, - tka: &tkaState{authority: authority}, + logf: t.Logf, + health: health.NewTracker(eventbustest.NewBus(t)), + tka: &tkaState{authority: authority}, } n1, n2, n3, n4, n5 := key.NewNode(), key.NewNode(), key.NewNode(), key.NewNode(), key.NewNode() @@ -822,6 +827,7 @@ func TestTKADisable(t *testing.T) { cc: cc, ccAuto: cc, logf: t.Logf, + health: health.NewTracker(eventbustest.NewBus(t)), tka: &tkaState{ profile: pm.CurrentProfile().ID(), authority: authority, @@ -887,6 +893,7 @@ func TestTKASign(t *testing.T) { cc: cc, ccAuto: cc, logf: t.Logf, + health: health.NewTracker(eventbustest.NewBus(t)), tka: &tkaState{ authority: authority, storage: chonk, @@ -1083,6 +1090,7 @@ func TestTKAAffectedSigs(t *testing.T) { cc: cc, ccAuto: cc, logf: t.Logf, + health: health.NewTracker(eventbustest.NewBus(t)), tka: &tkaState{ authority: authority, storage: chonk, @@ -1168,6 +1176,7 @@ func TestTKARecoverCompromisedKeyFlow(t *testing.T) { cc: cc, ccAuto: cc, logf: t.Logf, + health: health.NewTracker(eventbustest.NewBus(t)), tka: &tkaState{ authority: authority, storage: chonk, @@ -1187,6 +1196,7 @@ func TestTKARecoverCompromisedKeyFlow(t *testing.T) { b := LocalBackend{ varRoot: temp, logf: t.Logf, + health: health.NewTracker(eventbustest.NewBus(t)), tka: &tkaState{ authority: authority, storage: chonk, diff --git a/ipn/ipnlocal/serve_test.go b/ipn/ipnlocal/serve_test.go index 0ba43a5f9..05f4936b2 100644 --- a/ipn/ipnlocal/serve_test.go +++ b/ipn/ipnlocal/serve_test.go @@ -194,6 +194,7 @@ func TestGetServeHandler(t *testing.T) { b := &LocalBackend{ serveConfig: tt.conf.View(), logf: t.Logf, + health: health.NewTracker(eventbustest.NewBus(t)), } req := &http.Request{ URL: &url.URL{ @@ -1191,7 +1192,9 @@ func TestServeFileOrDirectory(t *testing.T) { } } - b := &LocalBackend{} + b := &LocalBackend{ + health: health.NewTracker(eventbustest.NewBus(t)), + } tests := []struct { req string