Skip to content

Commit

Permalink
ipn/ipnlocal: delete redundant TestStatusWithoutPeers
Browse files Browse the repository at this point in the history
We have tstest/integration nowadays.

And this test was one of the lone holdouts using the to-be-nuked
SetControlClientGetterForTesting.

Updates tailscale#11649

Change-Id: Icf8a6a2e9b8ae1ac534754afa898c00dc0b7623b
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
  • Loading branch information
bradfitz committed Apr 13, 2024
1 parent 68043a1 commit 8186cd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
28 changes: 0 additions & 28 deletions ipn/ipnlocal/local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions tstest/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8186cd0

Please sign in to comment.