remove terrible filter code
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
0d24e878d0
commit
ecd62fb785
4 changed files with 3 additions and 351 deletions
135
acls_test.go
135
acls_test.go
|
@ -1661,141 +1661,6 @@ func Test_excludeCorrectlyTaggedNodes(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// func Test_expandACLPeerAddr(t *testing.T) {
|
||||
// type args struct {
|
||||
// srcIP string
|
||||
// }
|
||||
// tests := []struct {
|
||||
// name string
|
||||
// args args
|
||||
// want []string
|
||||
// }{
|
||||
// {
|
||||
// name: "asterix",
|
||||
// args: args{
|
||||
// srcIP: "*",
|
||||
// },
|
||||
// want: []string{"*"},
|
||||
// },
|
||||
// {
|
||||
// name: "ip",
|
||||
// args: args{
|
||||
// srcIP: "10.0.0.1",
|
||||
// },
|
||||
// want: []string{"10.0.0.1"},
|
||||
// },
|
||||
// {
|
||||
// name: "ip/32",
|
||||
// args: args{
|
||||
// srcIP: "10.0.0.1/32",
|
||||
// },
|
||||
// want: []string{"10.0.0.1"},
|
||||
// },
|
||||
// {
|
||||
// name: "ip/30",
|
||||
// args: args{
|
||||
// srcIP: "10.0.0.1/30",
|
||||
// },
|
||||
// want: []string{
|
||||
// "10.0.0.0",
|
||||
// "10.0.0.1",
|
||||
// "10.0.0.2",
|
||||
// "10.0.0.3",
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: "ip/28",
|
||||
// args: args{
|
||||
// srcIP: "192.168.0.128/28",
|
||||
// },
|
||||
// want: []string{
|
||||
// "192.168.0.128", "192.168.0.129", "192.168.0.130",
|
||||
// "192.168.0.131", "192.168.0.132", "192.168.0.133",
|
||||
// "192.168.0.134", "192.168.0.135", "192.168.0.136",
|
||||
// "192.168.0.137", "192.168.0.138", "192.168.0.139",
|
||||
// "192.168.0.140", "192.168.0.141", "192.168.0.142",
|
||||
// "192.168.0.143",
|
||||
// },
|
||||
// },
|
||||
// }
|
||||
// for _, tt := range tests {
|
||||
// t.Run(tt.name, func(t *testing.T) {
|
||||
// if got := expandACLPeerAddr(tt.args.srcIP); !reflect.DeepEqual(got, tt.want) {
|
||||
// t.Errorf("expandACLPeerAddr() = %v, want %v", got, tt.want)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
// func Test_expandACLPeerAddrV6(t *testing.T) {
|
||||
// type args struct {
|
||||
// srcIP string
|
||||
// }
|
||||
// tests := []struct {
|
||||
// name string
|
||||
// args args
|
||||
// want []string
|
||||
// }{
|
||||
// {
|
||||
// name: "asterix",
|
||||
// args: args{
|
||||
// srcIP: "*",
|
||||
// },
|
||||
// want: []string{"*"},
|
||||
// },
|
||||
// {
|
||||
// name: "ipfull",
|
||||
// args: args{
|
||||
// srcIP: "fd7a:115c:a1e0:ab12:4943:cd96:624c:3166",
|
||||
// },
|
||||
// want: []string{"fd7a:115c:a1e0:ab12:4943:cd96:624c:3166"},
|
||||
// },
|
||||
// {
|
||||
// name: "ipzerocompression",
|
||||
// args: args{
|
||||
// srcIP: "fd7a:115c:a1e0:ab12:4943:cd96:624c::",
|
||||
// },
|
||||
// want: []string{"fd7a:115c:a1e0:ab12:4943:cd96:624c:0"},
|
||||
// },
|
||||
// {
|
||||
// name: "ip/128",
|
||||
// args: args{
|
||||
// srcIP: "fd7a:115c:a1e0:ab12:4943:cd96:624c:3166/128",
|
||||
// },
|
||||
// want: []string{"fd7a:115c:a1e0:ab12:4943:cd96:624c:3166"},
|
||||
// },
|
||||
// {
|
||||
// name: "ip/127",
|
||||
// args: args{
|
||||
// srcIP: "fd7a:115c:a1e0:ab12:4943:cd96:624c:0000/127",
|
||||
// },
|
||||
// want: []string{
|
||||
// "fd7a:115c:a1e0:ab12:4943:cd96:624c:0",
|
||||
// "fd7a:115c:a1e0:ab12:4943:cd96:624c:1",
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// name: "ip/126",
|
||||
// args: args{
|
||||
// srcIP: "fd7a:115c:a1e0:ab12:4943:cd96:624c:0000/126",
|
||||
// },
|
||||
// want: []string{
|
||||
// "fd7a:115c:a1e0:ab12:4943:cd96:624c:0",
|
||||
// "fd7a:115c:a1e0:ab12:4943:cd96:624c:1",
|
||||
// "fd7a:115c:a1e0:ab12:4943:cd96:624c:2",
|
||||
// "fd7a:115c:a1e0:ab12:4943:cd96:624c:3",
|
||||
// },
|
||||
// },
|
||||
// }
|
||||
// for _, tt := range tests {
|
||||
// t.Run(tt.name, func(t *testing.T) {
|
||||
// if got := expandACLPeerAddr(tt.args.srcIP); !reflect.DeepEqual(got, tt.want) {
|
||||
// t.Errorf("expandACLPeerAddr() = %v, want %v", got, tt.want)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
func TestACLPolicy_generateFilterRules(t *testing.T) {
|
||||
type field struct {
|
||||
pol ACLPolicy
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue