Config: Remove more legacy fields (#3817)

This commit is contained in:
Kobe Arthur Scofield 2024-09-19 09:05:59 +08:00 committed by GitHub
parent f406b2dee0
commit 57a41f3b4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 569 additions and 1157 deletions

View file

@ -106,42 +106,6 @@ func TestRoutingRule(t *testing.T) {
},
},
},
{
rule: &RoutingRule{
Cidr: []*CIDR{
{
Ip: []byte{8, 8, 8, 8},
Prefix: 32,
},
{
Ip: []byte{8, 8, 8, 8},
Prefix: 32,
},
{
Ip: net.ParseAddress("2001:0db8:85a3:0000:0000:8a2e:0370:7334").IP(),
Prefix: 128,
},
},
},
test: []ruleTest{
{
input: withOutbound(&session.Outbound{Target: net.TCPDestination(net.ParseAddress("8.8.8.8"), 80)}),
output: true,
},
{
input: withOutbound(&session.Outbound{Target: net.TCPDestination(net.ParseAddress("8.8.4.4"), 80)}),
output: false,
},
{
input: withOutbound(&session.Outbound{Target: net.TCPDestination(net.ParseAddress("2001:0db8:85a3:0000:0000:8a2e:0370:7334"), 80)}),
output: true,
},
{
input: withBackground(),
output: false,
},
},
},
{
rule: &RoutingRule{
Geoip: []*GeoIP{
@ -184,10 +148,14 @@ func TestRoutingRule(t *testing.T) {
},
{
rule: &RoutingRule{
SourceCidr: []*CIDR{
SourceGeoip: []*GeoIP{
{
Ip: []byte{192, 168, 0, 0},
Prefix: 16,
Cidr: []*CIDR{
{
Ip: []byte{192, 168, 0, 0},
Prefix: 16,
},
},
},
},
},