From 13672bfa06d2e2d1a4c73d74079d4c3900fc280a Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Mon, 30 Dec 2024 06:40:37 +0100 Subject: [PATCH] temp fix tests with unique peers, we now generate summarized rule correctly this is duplicating the summarized "correctly" and there is room to reduce processing --- management/server/policy_test.go | 56 ++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/management/server/policy_test.go b/management/server/policy_test.go index fab738abe53..ffd060ef925 100644 --- a/management/server/policy_test.go +++ b/management/server/policy_test.go @@ -159,6 +159,8 @@ func TestAccount_getPeersByPolicy(t *testing.T) { assert.Contains(t, peers, account.Peers["peerD"]) assert.Contains(t, peers, account.Peers["peerE"]) assert.Contains(t, peers, account.Peers["peerF"]) + assert.Contains(t, peers, account.Peers["peerG"]) + assert.Contains(t, peers, account.Peers["peerH"]) epectedFirewallRules := []*types.FirewallRule{ { @@ -176,33 +178,47 @@ func TestAccount_getPeersByPolicy(t *testing.T) { Port: "", }, { - PeerIP: "100.65.14.88", + PeerIP: "0.0.0.0", Direction: types.FirewallRuleDirectionIN, Action: "accept", Protocol: "all", Port: "", }, { - PeerIP: "100.65.14.88", + PeerIP: "0.0.0.0", Direction: types.FirewallRuleDirectionOUT, Action: "accept", Protocol: "all", Port: "", }, { - PeerIP: "100.65.254.139", - Direction: types.FirewallRuleDirectionOUT, + PeerIP: "100.65.14.88", + Direction: types.FirewallRuleDirectionIN, Action: "accept", Protocol: "all", Port: "", }, { - PeerIP: "100.65.254.139", - Direction: types.FirewallRuleDirectionIN, + PeerIP: "100.65.14.88", + Direction: types.FirewallRuleDirectionOUT, Action: "accept", Protocol: "all", Port: "", }, + //{ + // PeerIP: "100.65.254.139", + // Direction: types.FirewallRuleDirectionOUT, + // Action: "accept", + // Protocol: "all", + // Port: "", + //}, + //{ + // PeerIP: "100.65.254.139", + // Direction: types.FirewallRuleDirectionIN, + // Action: "accept", + // Protocol: "all", + // Port: "", + //}, { PeerIP: "100.65.62.5", @@ -234,20 +250,20 @@ func TestAccount_getPeersByPolicy(t *testing.T) { Port: "", }, - { - PeerIP: "100.65.250.202", - Direction: types.FirewallRuleDirectionOUT, - Action: "accept", - Protocol: "all", - Port: "", - }, - { - PeerIP: "100.65.250.202", - Direction: types.FirewallRuleDirectionIN, - Action: "accept", - Protocol: "all", - Port: "", - }, + //{ + // PeerIP: "100.65.250.202", + // Direction: types.FirewallRuleDirectionOUT, + // Action: "accept", + // Protocol: "all", + // Port: "", + //}, + //{ + // PeerIP: "100.65.250.202", + // Direction: types.FirewallRuleDirectionIN, + // Action: "accept", + // Protocol: "all", + // Port: "", + //}, { PeerIP: "100.65.13.186",