mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-13 18:31:18 +01:00
fix tests
This commit is contained in:
parent
02c0a9b1da
commit
8bab9dc3c0
@ -1111,15 +1111,31 @@ func TestAccountManager_AddPeerWithUserID(t *testing.T) {
|
|||||||
func TestAccountManager_NetworkUpdates_SaveGroup(t *testing.T) {
|
func TestAccountManager_NetworkUpdates_SaveGroup(t *testing.T) {
|
||||||
manager, account, peer1, peer2, peer3 := setupNetworkMapTest(t)
|
manager, account, peer1, peer2, peer3 := setupNetworkMapTest(t)
|
||||||
|
|
||||||
updMsg := manager.peersUpdateManager.CreateChannel(context.Background(), peer1.ID)
|
|
||||||
defer manager.peersUpdateManager.CloseChannel(context.Background(), peer1.ID)
|
|
||||||
|
|
||||||
group := group.Group{
|
group := group.Group{
|
||||||
ID: "group-id",
|
ID: "group-id",
|
||||||
Name: "GroupA",
|
Name: "GroupA",
|
||||||
Peers: []string{peer1.ID, peer2.ID, peer3.ID},
|
Peers: []string{peer1.ID, peer2.ID, peer3.ID},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
policy := Policy{
|
||||||
|
ID: "policy",
|
||||||
|
Enabled: true,
|
||||||
|
Rules: []*PolicyRule{
|
||||||
|
{
|
||||||
|
Enabled: true,
|
||||||
|
Sources: []string{"group-id"},
|
||||||
|
Destinations: []string{"group-id"},
|
||||||
|
Bidirectional: true,
|
||||||
|
Action: PolicyTrafficActionAccept,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
err := manager.SavePolicy(context.Background(), account.Id, userID, &policy)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
updMsg := manager.peersUpdateManager.CreateChannel(context.Background(), peer1.ID)
|
||||||
|
defer manager.peersUpdateManager.CloseChannel(context.Background(), peer1.ID)
|
||||||
|
|
||||||
wg := sync.WaitGroup{}
|
wg := sync.WaitGroup{}
|
||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
|
Loading…
Reference in New Issue
Block a user