2021-05-21 14:15:47 +01:00
|
|
|
package filtering
|
2020-04-27 15:24:55 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"net"
|
2023-09-07 15:13:48 +01:00
|
|
|
"net/netip"
|
2020-04-27 15:24:55 +01:00
|
|
|
"testing"
|
|
|
|
|
2020-06-03 10:04:23 +01:00
|
|
|
"github.com/miekg/dns"
|
2020-04-27 15:24:55 +01:00
|
|
|
"github.com/stretchr/testify/assert"
|
2021-03-11 14:32:58 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
2020-04-27 15:24:55 +01:00
|
|
|
)
|
|
|
|
|
2021-03-11 14:32:58 +00:00
|
|
|
// TODO(e.burkov): All the tests in this file may and should me merged together.
|
|
|
|
|
2020-04-27 15:24:55 +01:00
|
|
|
func TestRewrites(t *testing.T) {
|
2022-09-29 15:36:01 +01:00
|
|
|
d, _ := newForTest(t, nil, nil)
|
2021-01-29 13:09:31 +00:00
|
|
|
t.Cleanup(d.Close)
|
2021-03-11 14:32:58 +00:00
|
|
|
|
2023-09-07 15:13:48 +01:00
|
|
|
var (
|
|
|
|
addr1v4 = netip.AddrFrom4([4]byte{1, 2, 3, 4})
|
|
|
|
addr2v4 = netip.AddrFrom4([4]byte{1, 2, 3, 5})
|
|
|
|
addr3v4 = netip.AddrFrom4([4]byte{1, 2, 3, 6})
|
|
|
|
addr4v4 = netip.AddrFrom4([4]byte{1, 2, 3, 7})
|
|
|
|
|
|
|
|
addr1v6 = netip.MustParseAddr("1:2:3::4")
|
|
|
|
addr2v6 = netip.MustParseAddr("1234::5678")
|
|
|
|
)
|
|
|
|
|
|
|
|
d.conf.Rewrites = []*LegacyRewrite{{
|
2021-03-11 14:32:58 +00:00
|
|
|
// This one and below are about CNAME, A and AAAA.
|
|
|
|
Domain: "somecname",
|
|
|
|
Answer: "somehost.com",
|
|
|
|
}, {
|
|
|
|
Domain: "somehost.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
Answer: netip.IPv4Unspecified().String(),
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
Domain: "host.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
Answer: addr1v4.String(),
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
Domain: "host.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
Answer: addr2v4.String(),
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
Domain: "host.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
Answer: addr1v6.String(),
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
Domain: "www.host.com",
|
|
|
|
Answer: "host.com",
|
|
|
|
}, {
|
|
|
|
// This one is a wildcard.
|
|
|
|
Domain: "*.host.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
Answer: addr2v4.String(),
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
// This one and below are about wildcard overriding.
|
|
|
|
Domain: "a.host.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
Answer: addr1v4.String(),
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
// This one is about CNAME and wildcard interacting.
|
|
|
|
Domain: "*.host2.com",
|
|
|
|
Answer: "host.com",
|
|
|
|
}, {
|
|
|
|
// This one and below are about 2 level CNAME.
|
|
|
|
Domain: "b.host.com",
|
|
|
|
Answer: "somecname",
|
|
|
|
}, {
|
|
|
|
// This one and below are about 2 level CNAME and wildcard.
|
|
|
|
Domain: "b.host3.com",
|
|
|
|
Answer: "a.host3.com",
|
|
|
|
}, {
|
|
|
|
Domain: "a.host3.com",
|
|
|
|
Answer: "x.host.com",
|
2021-07-12 19:10:39 +01:00
|
|
|
}, {
|
|
|
|
Domain: "*.hostboth.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
Answer: addr3v4.String(),
|
2021-07-12 19:10:39 +01:00
|
|
|
}, {
|
|
|
|
Domain: "*.hostboth.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
Answer: addr2v6.String(),
|
2021-07-13 17:45:25 +01:00
|
|
|
}, {
|
|
|
|
Domain: "BIGHOST.COM",
|
2023-09-07 15:13:48 +01:00
|
|
|
Answer: addr4v4.String(),
|
2021-12-27 16:40:39 +00:00
|
|
|
}, {
|
|
|
|
Domain: "*.issue4016.com",
|
|
|
|
Answer: "sub.issue4016.com",
|
2023-10-11 15:31:41 +01:00
|
|
|
}, {
|
|
|
|
Domain: "*.sub.issue6226.com",
|
|
|
|
Answer: addr2v4.String(),
|
|
|
|
}, {
|
|
|
|
Domain: "*.issue6226.com",
|
|
|
|
Answer: addr1v4.String(),
|
2021-03-11 14:32:58 +00:00
|
|
|
}}
|
2021-12-27 16:40:39 +00:00
|
|
|
|
|
|
|
require.NoError(t, d.prepareRewrites())
|
2020-04-27 15:24:55 +01:00
|
|
|
|
2021-03-11 14:32:58 +00:00
|
|
|
testCases := []struct {
|
2021-12-24 17:14:36 +00:00
|
|
|
name string
|
|
|
|
host string
|
|
|
|
wantCName string
|
2023-09-07 15:13:48 +01:00
|
|
|
wantIPs []netip.Addr
|
2021-12-24 17:14:36 +00:00
|
|
|
wantReason Reason
|
|
|
|
dtyp uint16
|
2021-03-11 14:32:58 +00:00
|
|
|
}{{
|
2021-12-24 17:14:36 +00:00
|
|
|
name: "not_filtered_not_found",
|
|
|
|
host: "hoost.com",
|
|
|
|
wantCName: "",
|
|
|
|
wantIPs: nil,
|
|
|
|
wantReason: NotFilteredNotFound,
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
}, {
|
|
|
|
name: "rewritten_a",
|
|
|
|
host: "www.host.com",
|
|
|
|
wantCName: "host.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
wantIPs: []netip.Addr{addr1v4, addr2v4},
|
2021-12-24 17:14:36 +00:00
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
}, {
|
|
|
|
name: "rewritten_aaaa",
|
|
|
|
host: "www.host.com",
|
|
|
|
wantCName: "host.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
wantIPs: []netip.Addr{addr1v6},
|
2021-12-24 17:14:36 +00:00
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeAAAA,
|
|
|
|
}, {
|
|
|
|
name: "wildcard_match",
|
|
|
|
host: "abc.host.com",
|
|
|
|
wantCName: "",
|
2023-09-07 15:13:48 +01:00
|
|
|
wantIPs: []netip.Addr{addr2v4},
|
2021-12-24 17:14:36 +00:00
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
}, {
|
|
|
|
name: "wildcard_override",
|
|
|
|
host: "a.host.com",
|
|
|
|
wantCName: "",
|
2023-09-07 15:13:48 +01:00
|
|
|
wantIPs: []netip.Addr{addr1v4},
|
2021-12-24 17:14:36 +00:00
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
}, {
|
|
|
|
name: "wildcard_cname_interaction",
|
|
|
|
host: "www.host2.com",
|
|
|
|
wantCName: "host.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
wantIPs: []netip.Addr{addr1v4, addr2v4},
|
2021-12-24 17:14:36 +00:00
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
}, {
|
|
|
|
name: "two_cnames",
|
|
|
|
host: "b.host.com",
|
|
|
|
wantCName: "somehost.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
wantIPs: []netip.Addr{netip.IPv4Unspecified()},
|
2021-12-24 17:14:36 +00:00
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
}, {
|
|
|
|
name: "two_cnames_and_wildcard",
|
|
|
|
host: "b.host3.com",
|
|
|
|
wantCName: "x.host.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
wantIPs: []netip.Addr{addr2v4},
|
2021-12-24 17:14:36 +00:00
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
}, {
|
|
|
|
name: "issue3343",
|
|
|
|
host: "www.hostboth.com",
|
|
|
|
wantCName: "",
|
2023-09-07 15:13:48 +01:00
|
|
|
wantIPs: []netip.Addr{addr2v6},
|
2021-12-24 17:14:36 +00:00
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeAAAA,
|
|
|
|
}, {
|
|
|
|
name: "issue3351",
|
|
|
|
host: "bighost.com",
|
|
|
|
wantCName: "",
|
2023-09-07 15:13:48 +01:00
|
|
|
wantIPs: []netip.Addr{addr4v4},
|
2021-12-24 17:14:36 +00:00
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
}, {
|
|
|
|
name: "issue4008",
|
|
|
|
host: "somehost.com",
|
|
|
|
wantCName: "",
|
|
|
|
wantIPs: nil,
|
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeHTTPS,
|
2021-12-27 16:40:39 +00:00
|
|
|
}, {
|
|
|
|
name: "issue4016",
|
|
|
|
host: "www.issue4016.com",
|
|
|
|
wantCName: "sub.issue4016.com",
|
|
|
|
wantIPs: nil,
|
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
}, {
|
|
|
|
name: "issue4016_self",
|
|
|
|
host: "sub.issue4016.com",
|
|
|
|
wantCName: "",
|
|
|
|
wantIPs: nil,
|
|
|
|
wantReason: NotFilteredNotFound,
|
|
|
|
dtyp: dns.TypeA,
|
2023-10-11 15:31:41 +01:00
|
|
|
}, {
|
|
|
|
name: "issue6226",
|
|
|
|
host: "www.issue6226.com",
|
|
|
|
wantCName: "",
|
|
|
|
wantIPs: []netip.Addr{addr1v4},
|
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
}, {
|
|
|
|
name: "issue6226_sub",
|
|
|
|
host: "www.sub.issue6226.com",
|
|
|
|
wantCName: "",
|
|
|
|
wantIPs: []netip.Addr{addr2v4},
|
|
|
|
wantReason: Rewritten,
|
|
|
|
dtyp: dns.TypeA,
|
2021-03-11 14:32:58 +00:00
|
|
|
}}
|
2020-04-27 15:24:55 +01:00
|
|
|
|
2021-03-11 14:32:58 +00:00
|
|
|
for _, tc := range testCases {
|
|
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
|
|
r := d.processRewrites(tc.host, tc.dtyp)
|
2021-12-24 17:14:36 +00:00
|
|
|
require.Equalf(t, tc.wantReason, r.Reason, "got %s", r.Reason)
|
2021-07-13 17:45:25 +01:00
|
|
|
|
2021-03-11 14:32:58 +00:00
|
|
|
if tc.wantCName != "" {
|
|
|
|
assert.Equal(t, tc.wantCName, r.CanonName)
|
|
|
|
}
|
|
|
|
|
2021-12-24 17:14:36 +00:00
|
|
|
assert.Equal(t, tc.wantIPs, r.IPList)
|
2021-03-11 14:32:58 +00:00
|
|
|
})
|
2020-04-27 15:24:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestRewritesLevels(t *testing.T) {
|
2022-09-29 15:36:01 +01:00
|
|
|
d, _ := newForTest(t, nil, nil)
|
2021-01-29 13:09:31 +00:00
|
|
|
t.Cleanup(d.Close)
|
2021-03-11 14:32:58 +00:00
|
|
|
// Exact host, wildcard L2, wildcard L3.
|
2023-09-07 15:13:48 +01:00
|
|
|
d.conf.Rewrites = []*LegacyRewrite{{
|
2021-03-11 14:32:58 +00:00
|
|
|
Domain: "host.com",
|
|
|
|
Answer: "1.1.1.1",
|
2021-07-12 19:10:39 +01:00
|
|
|
Type: dns.TypeA,
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
Domain: "*.host.com",
|
|
|
|
Answer: "2.2.2.2",
|
2021-07-12 19:10:39 +01:00
|
|
|
Type: dns.TypeA,
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
Domain: "*.sub.host.com",
|
|
|
|
Answer: "3.3.3.3",
|
2021-07-12 19:10:39 +01:00
|
|
|
Type: dns.TypeA,
|
2021-03-11 14:32:58 +00:00
|
|
|
}}
|
2021-12-27 16:40:39 +00:00
|
|
|
|
|
|
|
require.NoError(t, d.prepareRewrites())
|
2020-04-27 15:24:55 +01:00
|
|
|
|
2021-03-11 14:32:58 +00:00
|
|
|
testCases := []struct {
|
|
|
|
name string
|
|
|
|
host string
|
|
|
|
want net.IP
|
|
|
|
}{{
|
|
|
|
name: "exact_match",
|
|
|
|
host: "host.com",
|
|
|
|
want: net.IP{1, 1, 1, 1},
|
|
|
|
}, {
|
|
|
|
name: "l2_match",
|
|
|
|
host: "sub.host.com",
|
|
|
|
want: net.IP{2, 2, 2, 2},
|
|
|
|
}, {
|
|
|
|
name: "l3_match",
|
|
|
|
host: "my.sub.host.com",
|
|
|
|
want: net.IP{3, 3, 3, 3},
|
|
|
|
}}
|
|
|
|
|
|
|
|
for _, tc := range testCases {
|
|
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
|
|
r := d.processRewrites(tc.host, dns.TypeA)
|
|
|
|
assert.Equal(t, Rewritten, r.Reason)
|
|
|
|
require.Len(t, r.IPList, 1)
|
|
|
|
})
|
|
|
|
}
|
2020-04-27 15:24:55 +01:00
|
|
|
}
|
2020-05-26 09:42:42 +01:00
|
|
|
|
2020-06-03 10:04:23 +01:00
|
|
|
func TestRewritesExceptionCNAME(t *testing.T) {
|
2022-09-29 15:36:01 +01:00
|
|
|
d, _ := newForTest(t, nil, nil)
|
2021-01-29 13:09:31 +00:00
|
|
|
t.Cleanup(d.Close)
|
2021-03-11 14:32:58 +00:00
|
|
|
// Wildcard and exception for a sub-domain.
|
2023-09-07 15:13:48 +01:00
|
|
|
d.conf.Rewrites = []*LegacyRewrite{{
|
2021-03-11 14:32:58 +00:00
|
|
|
Domain: "*.host.com",
|
|
|
|
Answer: "2.2.2.2",
|
|
|
|
}, {
|
|
|
|
Domain: "sub.host.com",
|
|
|
|
Answer: "sub.host.com",
|
|
|
|
}, {
|
|
|
|
Domain: "*.sub.host.com",
|
|
|
|
Answer: "*.sub.host.com",
|
|
|
|
}}
|
2021-12-27 16:40:39 +00:00
|
|
|
|
|
|
|
require.NoError(t, d.prepareRewrites())
|
2020-05-26 09:42:42 +01:00
|
|
|
|
2021-03-11 14:32:58 +00:00
|
|
|
testCases := []struct {
|
|
|
|
name string
|
|
|
|
host string
|
2023-09-07 15:13:48 +01:00
|
|
|
want netip.Addr
|
2021-03-11 14:32:58 +00:00
|
|
|
}{{
|
2021-12-24 17:14:36 +00:00
|
|
|
name: "match_subdomain",
|
2021-03-11 14:32:58 +00:00
|
|
|
host: "my.host.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
want: netip.AddrFrom4([4]byte{2, 2, 2, 2}),
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
name: "exception_cname",
|
|
|
|
host: "sub.host.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
want: netip.Addr{},
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
name: "exception_wildcard",
|
|
|
|
host: "my.sub.host.com",
|
2023-09-07 15:13:48 +01:00
|
|
|
want: netip.Addr{},
|
2021-03-11 14:32:58 +00:00
|
|
|
}}
|
2020-05-26 09:42:42 +01:00
|
|
|
|
2021-03-11 14:32:58 +00:00
|
|
|
for _, tc := range testCases {
|
|
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
|
|
r := d.processRewrites(tc.host, dns.TypeA)
|
2023-09-07 15:13:48 +01:00
|
|
|
if tc.want == (netip.Addr{}) {
|
2021-12-27 16:40:39 +00:00
|
|
|
assert.Equal(t, NotFilteredNotFound, r.Reason, "got %s", r.Reason)
|
2020-05-26 09:42:42 +01:00
|
|
|
|
2021-03-11 14:32:58 +00:00
|
|
|
return
|
|
|
|
}
|
2020-05-26 09:42:42 +01:00
|
|
|
|
2021-03-11 14:32:58 +00:00
|
|
|
assert.Equal(t, Rewritten, r.Reason)
|
|
|
|
require.Len(t, r.IPList, 1)
|
2023-09-07 15:13:48 +01:00
|
|
|
assert.Equal(t, tc.want, r.IPList[0])
|
2021-03-11 14:32:58 +00:00
|
|
|
})
|
|
|
|
}
|
2020-05-26 09:42:42 +01:00
|
|
|
}
|
2020-06-03 10:04:23 +01:00
|
|
|
|
|
|
|
func TestRewritesExceptionIP(t *testing.T) {
|
2022-09-29 15:36:01 +01:00
|
|
|
d, _ := newForTest(t, nil, nil)
|
2021-01-29 13:09:31 +00:00
|
|
|
t.Cleanup(d.Close)
|
2021-03-11 14:32:58 +00:00
|
|
|
// Exception for AAAA record.
|
2023-09-07 15:13:48 +01:00
|
|
|
d.conf.Rewrites = []*LegacyRewrite{{
|
2021-03-11 14:32:58 +00:00
|
|
|
Domain: "host.com",
|
|
|
|
Answer: "1.2.3.4",
|
2021-07-12 19:10:39 +01:00
|
|
|
Type: dns.TypeA,
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
Domain: "host.com",
|
|
|
|
Answer: "AAAA",
|
2021-07-12 19:10:39 +01:00
|
|
|
Type: dns.TypeAAAA,
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
Domain: "host2.com",
|
|
|
|
Answer: "::1",
|
2021-07-12 19:10:39 +01:00
|
|
|
Type: dns.TypeAAAA,
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
Domain: "host2.com",
|
|
|
|
Answer: "A",
|
2021-07-12 19:10:39 +01:00
|
|
|
Type: dns.TypeA,
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
|
|
|
Domain: "host3.com",
|
|
|
|
Answer: "A",
|
2021-07-12 19:10:39 +01:00
|
|
|
Type: dns.TypeA,
|
2021-03-11 14:32:58 +00:00
|
|
|
}}
|
2021-12-27 16:40:39 +00:00
|
|
|
|
|
|
|
require.NoError(t, d.prepareRewrites())
|
2020-06-03 10:04:23 +01:00
|
|
|
|
2021-03-11 14:32:58 +00:00
|
|
|
testCases := []struct {
|
2023-09-07 15:13:48 +01:00
|
|
|
name string
|
|
|
|
host string
|
|
|
|
want []netip.Addr
|
|
|
|
dtyp uint16
|
|
|
|
wantReason Reason
|
2021-03-11 14:32:58 +00:00
|
|
|
}{{
|
2023-09-07 15:13:48 +01:00
|
|
|
name: "match_A",
|
|
|
|
host: "host.com",
|
|
|
|
want: []netip.Addr{netip.AddrFrom4([4]byte{1, 2, 3, 4})},
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
wantReason: Rewritten,
|
2021-03-11 14:32:58 +00:00
|
|
|
}, {
|
2023-09-07 15:13:48 +01:00
|
|
|
name: "exception_AAAA_host.com",
|
|
|
|
host: "host.com",
|
|
|
|
want: nil,
|
|
|
|
dtyp: dns.TypeAAAA,
|
|
|
|
wantReason: NotFilteredNotFound,
|
|
|
|
}, {
|
|
|
|
name: "exception_A_host2.com",
|
|
|
|
host: "host2.com",
|
|
|
|
want: nil,
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
wantReason: NotFilteredNotFound,
|
|
|
|
}, {
|
|
|
|
name: "match_AAAA_host2.com",
|
|
|
|
host: "host2.com",
|
|
|
|
want: []netip.Addr{netip.MustParseAddr("::1")},
|
|
|
|
dtyp: dns.TypeAAAA,
|
|
|
|
wantReason: Rewritten,
|
|
|
|
}, {
|
|
|
|
name: "exception_A_host3.com",
|
|
|
|
host: "host3.com",
|
|
|
|
want: nil,
|
|
|
|
dtyp: dns.TypeA,
|
|
|
|
wantReason: NotFilteredNotFound,
|
|
|
|
}, {
|
|
|
|
name: "match_AAAA_host3.com",
|
|
|
|
host: "host3.com",
|
|
|
|
want: nil,
|
|
|
|
dtyp: dns.TypeAAAA,
|
|
|
|
wantReason: Rewritten,
|
2021-03-11 14:32:58 +00:00
|
|
|
}}
|
|
|
|
|
|
|
|
for _, tc := range testCases {
|
2023-09-07 15:13:48 +01:00
|
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
|
|
if tc.name != "match_AAAA_host3.com" {
|
|
|
|
t.SkipNow()
|
2021-03-11 14:32:58 +00:00
|
|
|
}
|
|
|
|
|
2023-09-07 15:13:48 +01:00
|
|
|
r := d.processRewrites(tc.host, tc.dtyp)
|
|
|
|
assert.Equal(t, tc.want, r.IPList)
|
|
|
|
assert.Equal(t, tc.wantReason, r.Reason)
|
2021-03-11 14:32:58 +00:00
|
|
|
})
|
|
|
|
}
|
2020-06-03 10:04:23 +01:00
|
|
|
}
|