From 8186cd034902e2f2edd0616f5f03b0e72f1dfc8f Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sat, 13 Apr 2024 16:22:15 -0700 Subject: [PATCH] ipn/ipnlocal: delete redundant TestStatusWithoutPeers We have tstest/integration nowadays. And this test was one of the lone holdouts using the to-be-nuked SetControlClientGetterForTesting. Updates #11649 Change-Id: Icf8a6a2e9b8ae1ac534754afa898c00dc0b7623b Signed-off-by: Brad Fitzpatrick --- ipn/ipnlocal/local_test.go | 28 -------------------------- tstest/integration/integration_test.go | 5 +++++ 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/ipn/ipnlocal/local_test.go b/ipn/ipnlocal/local_test.go index d5c8ab26e..efa00f18c 100644 --- a/ipn/ipnlocal/local_test.go +++ b/ipn/ipnlocal/local_test.go @@ -763,34 +763,6 @@ func TestPacketFilterPermitsUnlockedNodes(t *testing.T) { } } -func TestStatusWithoutPeers(t *testing.T) { - b := newTestLocalBackend(t) - - var cc *mockControl - b.SetControlClientGetterForTesting(func(opts controlclient.Options) (controlclient.Client, error) { - cc = newClient(t, opts) - - t.Logf("ccGen: new mockControl.") - cc.called("New") - return cc, nil - }) - b.Start(ipn.Options{}) - b.StartLoginInteractive() - cc.send(nil, "", false, &netmap.NetworkMap{ - SelfNode: (&tailcfg.Node{ - MachineAuthorized: true, - Addresses: ipps("100.101.101.101"), - }).View(), - }) - got := b.StatusWithoutPeers() - if got.TailscaleIPs == nil { - t.Errorf("got nil, expected TailscaleIPs value to not be nil") - } - if !reflect.DeepEqual(got.TailscaleIPs, got.Self.TailscaleIPs) { - t.Errorf("got %v, expected %v", got.TailscaleIPs, got.Self.TailscaleIPs) - } -} - func TestStatusPeerCapabilities(t *testing.T) { tests := []struct { name string diff --git a/tstest/integration/integration_test.go b/tstest/integration/integration_test.go index a23ee09c9..0dfaee5a6 100644 --- a/tstest/integration/integration_test.go +++ b/tstest/integration/integration_test.go @@ -382,6 +382,11 @@ func TestTwoNodes(t *testing.T) { if peer.ID == st.Self.ID { return errors.New("peer is self") } + + if len(st.TailscaleIPs) == 0 { + return errors.New("no Tailscale IPs") + } + return nil }); err != nil { t.Error(err)