From 08733ed8d59816687c8b9ad9ffd02740ef73abef Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Wed, 6 Dec 2023 15:02:10 +0100 Subject: [PATCH] update tests --- management/server/policy_test.go | 55 +++++++++++++++++++------------- management/server/route_test.go | 5 +++ 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/management/server/policy_test.go b/management/server/policy_test.go index 3ed08f4e6d7..e4874d99d6e 100644 --- a/management/server/policy_test.go +++ b/management/server/policy_test.go @@ -15,36 +15,44 @@ func TestAccount_getPeersByPolicy(t *testing.T) { account := &Account{ Peers: map[string]*nbpeer.Peer{ "peerA": { - ID: "peerA", - IP: net.ParseIP("100.65.14.88"), + ID: "peerA", + IP: net.ParseIP("100.65.14.88"), + Status: &nbpeer.PeerStatus{}, }, "peerB": { - ID: "peerB", - IP: net.ParseIP("100.65.80.39"), + ID: "peerB", + IP: net.ParseIP("100.65.80.39"), + Status: &nbpeer.PeerStatus{}, }, "peerC": { - ID: "peerC", - IP: net.ParseIP("100.65.254.139"), + ID: "peerC", + IP: net.ParseIP("100.65.254.139"), + Status: &nbpeer.PeerStatus{}, }, "peerD": { - ID: "peerD", - IP: net.ParseIP("100.65.62.5"), + ID: "peerD", + IP: net.ParseIP("100.65.62.5"), + Status: &nbpeer.PeerStatus{}, }, "peerE": { - ID: "peerE", - IP: net.ParseIP("100.65.32.206"), + ID: "peerE", + IP: net.ParseIP("100.65.32.206"), + Status: &nbpeer.PeerStatus{}, }, "peerF": { - ID: "peerF", - IP: net.ParseIP("100.65.250.202"), + ID: "peerF", + IP: net.ParseIP("100.65.250.202"), + Status: &nbpeer.PeerStatus{}, }, "peerG": { - ID: "peerG", - IP: net.ParseIP("100.65.13.186"), + ID: "peerG", + IP: net.ParseIP("100.65.13.186"), + Status: &nbpeer.PeerStatus{}, }, "peerH": { - ID: "peerH", - IP: net.ParseIP("100.65.29.55"), + ID: "peerH", + IP: net.ParseIP("100.65.29.55"), + Status: &nbpeer.PeerStatus{}, }, }, Groups: map[string]*Group{ @@ -259,16 +267,19 @@ func TestAccount_getPeersByPolicyDirect(t *testing.T) { account := &Account{ Peers: map[string]*nbpeer.Peer{ "peerA": { - ID: "peerA", - IP: net.ParseIP("100.65.14.88"), + ID: "peerA", + IP: net.ParseIP("100.65.14.88"), + Status: &nbpeer.PeerStatus{}, }, "peerB": { - ID: "peerB", - IP: net.ParseIP("100.65.80.39"), + ID: "peerB", + IP: net.ParseIP("100.65.80.39"), + Status: &nbpeer.PeerStatus{}, }, "peerC": { - ID: "peerC", - IP: net.ParseIP("100.65.254.139"), + ID: "peerC", + IP: net.ParseIP("100.65.254.139"), + Status: &nbpeer.PeerStatus{}, }, }, Groups: map[string]*Group{ diff --git a/management/server/route_test.go b/management/server/route_test.go index 94f169a9bf0..bbf0ea3dd13 100644 --- a/management/server/route_test.go +++ b/management/server/route_test.go @@ -1062,6 +1062,7 @@ func initTestRouteAccount(t *testing.T, am *DefaultAccountManager) (*Account, er WtVersion: "development", UIVersion: "development", }, + Status: &nbpeer.PeerStatus{}, } account.Peers[peer1.ID] = peer1 @@ -1087,6 +1088,7 @@ func initTestRouteAccount(t *testing.T, am *DefaultAccountManager) (*Account, er WtVersion: "development", UIVersion: "development", }, + Status: &nbpeer.PeerStatus{}, } account.Peers[peer2.ID] = peer2 @@ -1112,6 +1114,7 @@ func initTestRouteAccount(t *testing.T, am *DefaultAccountManager) (*Account, er WtVersion: "development", UIVersion: "development", }, + Status: &nbpeer.PeerStatus{}, } account.Peers[peer3.ID] = peer3 @@ -1137,6 +1140,7 @@ func initTestRouteAccount(t *testing.T, am *DefaultAccountManager) (*Account, er WtVersion: "development", UIVersion: "development", }, + Status: &nbpeer.PeerStatus{}, } account.Peers[peer4.ID] = peer4 @@ -1162,6 +1166,7 @@ func initTestRouteAccount(t *testing.T, am *DefaultAccountManager) (*Account, er WtVersion: "development", UIVersion: "development", }, + Status: &nbpeer.PeerStatus{}, } account.Peers[peer5.ID] = peer5