2023-12-08 10:48:21 +01:00
|
|
|
package test
|
|
|
|
|
2024-10-02 13:41:00 +02:00
|
|
|
import (
|
|
|
|
"net/netip"
|
|
|
|
|
|
|
|
firewall "github.com/netbirdio/netbird/client/firewall/manager"
|
|
|
|
)
|
2023-12-08 10:48:21 +01:00
|
|
|
|
|
|
|
var (
|
|
|
|
InsertRuleTestCases = []struct {
|
|
|
|
Name string
|
|
|
|
InputPair firewall.RouterPair
|
|
|
|
}{
|
|
|
|
{
|
|
|
|
Name: "Insert Forwarding IPV4 Rule",
|
|
|
|
InputPair: firewall.RouterPair{
|
|
|
|
ID: "zxa",
|
2024-10-02 13:41:00 +02:00
|
|
|
Source: netip.MustParsePrefix("100.100.100.1/32"),
|
|
|
|
Destination: netip.MustParsePrefix("100.100.200.0/24"),
|
2023-12-08 10:48:21 +01:00
|
|
|
Masquerade: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "Insert Forwarding And Nat IPV4 Rules",
|
|
|
|
InputPair: firewall.RouterPair{
|
|
|
|
ID: "zxa",
|
2024-10-02 13:41:00 +02:00
|
|
|
Source: netip.MustParsePrefix("100.100.100.1/32"),
|
|
|
|
Destination: netip.MustParsePrefix("100.100.200.0/24"),
|
2023-12-08 10:48:21 +01:00
|
|
|
Masquerade: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
RemoveRuleTestCases = []struct {
|
|
|
|
Name string
|
|
|
|
InputPair firewall.RouterPair
|
|
|
|
IpVersion string
|
|
|
|
}{
|
|
|
|
{
|
|
|
|
Name: "Remove Forwarding And Nat IPV4 Rules",
|
|
|
|
InputPair: firewall.RouterPair{
|
|
|
|
ID: "zxa",
|
2024-10-02 13:41:00 +02:00
|
|
|
Source: netip.MustParsePrefix("100.100.100.1/32"),
|
|
|
|
Destination: netip.MustParsePrefix("100.100.200.0/24"),
|
2023-12-08 10:48:21 +01:00
|
|
|
Masquerade: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
)
|