Skip to content

Commit

Permalink
temp fix tests
Browse files Browse the repository at this point in the history
with unique peers, we now generate summarized rule correctly

this is duplicating the summarized "correctly" and there is room to reduce processing
  • Loading branch information
mlsmaycon committed Dec 30, 2024
1 parent 8b3b585 commit 13672bf
Showing 1 changed file with 36 additions and 20 deletions.
56 changes: 36 additions & 20 deletions management/server/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
{
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 13672bf

Please sign in to comment.