From 33dfb8999e0046793b987a05d7cbec25d6c8ddba Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Tue, 11 Feb 2020 04:52:50 -0500 Subject: [PATCH] controlclient, ipn: update tests for key pointer change Signed-off-by: David Crawshaw --- control/controlclient/auto_test.go | 4 ++-- control/controlclient/direct_test.go | 4 ++-- ipn/e2e_test.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/control/controlclient/auto_test.go b/control/controlclient/auto_test.go index eab5d7d76..a4a3f10d9 100644 --- a/control/controlclient/auto_test.go +++ b/control/controlclient/auto_test.go @@ -641,7 +641,7 @@ func TestRefresh(t *testing.T) { if got := *exp; !nkey1Expiry.Equal(got) { t.Errorf("node key expiry = %v, want %v", got, nkey1Expiry) } - k := tailcfg.NodeKey(*c1.direct.persist.PrivateNodeKey.Public()) + k := tailcfg.NodeKey(c1.direct.persist.PrivateNodeKey.Public()) if k != nkey1 { t.Errorf("node key after 2 hours is %v, want %v", k, nkey1) } @@ -1077,7 +1077,7 @@ func (c *client) status(t *testing.T) (status statusChange) { } else { t.Logf("%s state: %s", c.name, status.New.state) if status.New.NetMap != nil { - c.mkey = tailcfg.MachineKey(*status.New.Persist.PrivateMachineKey.Public()) + c.mkey = tailcfg.MachineKey(status.New.Persist.PrivateMachineKey.Public()) if nkey := status.New.NetMap.NodeKey; nkey != (tailcfg.NodeKey{}) && nkey != c.nkey { c.nkey = nkey c.id = c.s.control.DB().Node(c.nkey).ID diff --git a/control/controlclient/direct_test.go b/control/controlclient/direct_test.go index 6e852db1c..ed5ef17d2 100644 --- a/control/controlclient/direct_test.go +++ b/control/controlclient/direct_test.go @@ -190,7 +190,7 @@ func TestClientsReusingOldKey(t *testing.T) { if err != nil { t.Fatal(err) } - return *k + return k } // Replace the previous key with a new key. @@ -258,7 +258,7 @@ func TestClientsReusingOldKey(t *testing.T) { // At this point, there should only be one node for the machine key // registered as active in the server. - mkey := tailcfg.MachineKey(*persist1.PrivateMachineKey.Public()) + mkey := tailcfg.MachineKey(persist1.PrivateMachineKey.Public()) nodeIDs, err := server.DB().MachineNodes(mkey) if err != nil { t.Fatal(err) diff --git a/ipn/e2e_test.go b/ipn/e2e_test.go index 9f3ab3712..f3ac6546c 100644 --- a/ipn/e2e_test.go +++ b/ipn/e2e_test.go @@ -201,7 +201,7 @@ func newNode(t *testing.T, prefix string, https *httptest.Server) testNode { // Tell the control server to authorize the given node. func authNode(t *testing.T, ctl *control.Server, n *LocalBackend) { - mk := *n.prefs.Persist.PrivateMachineKey.Public() - nk := *n.prefs.Persist.PrivateNodeKey.Public() + mk := n.prefs.Persist.PrivateMachineKey.Public() + nk := n.prefs.Persist.PrivateNodeKey.Public() ctl.AuthorizeMachine(tailcfg.MachineKey(mk), tailcfg.NodeKey(nk)) }