1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-02-20 23:47:21 -05:00

fix broken tests

This commit is contained in:
Darien Raymond 2018-11-08 01:01:53 +01:00
parent 58221ebae1
commit df2d5b5d75
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
5 changed files with 48 additions and 16 deletions

View File

@ -56,9 +56,11 @@ func TestCommanderRemoveHandler(t *testing.T) {
Rule: []*router.RoutingRule{
{
InboundTag: []string{"api"},
TargetTag: &router.RoutingRule_Tag{
Tag: "api",
},
},
},
}),
},
Inbound: []*core.InboundHandlerConfig{
@ -173,9 +175,11 @@ func TestCommanderAddRemoveUser(t *testing.T) {
Rule: []*router.RoutingRule{
{
InboundTag: []string{"api"},
TargetTag: &router.RoutingRule_Tag{
Tag: "api",
},
},
},
}),
serial.ToTypedMessage(&policy.Config{
Level: map[uint32]*policy.Policy{
@ -381,9 +385,11 @@ func TestCommanderStats(t *testing.T) {
Rule: []*router.RoutingRule{
{
InboundTag: []string{"api"},
TargetTag: &router.RoutingRule_Tag{
Tag: "api",
},
},
},
}),
serial.ToTypedMessage(&policy.Config{
Level: map[uint32]*policy.Policy{

View File

@ -46,9 +46,11 @@ func TestResolveIP(t *testing.T) {
Prefix: 8,
},
},
TargetTag: &router.RoutingRule_Tag{
Tag: "direct",
},
},
},
}),
},
Inbound: []*core.InboundHandlerConfig{

View File

@ -475,7 +475,9 @@ func TestBlackhole(t *testing.T) {
serial.ToTypedMessage(&router.Config{
Rule: []*router.RoutingRule{
{
TargetTag: &router.RoutingRule_Tag{
Tag: "blocked",
},
PortRange: net.SinglePortRange(dest2.Port),
},
},
@ -714,10 +716,14 @@ func TestDomainSniffing(t *testing.T) {
serial.ToTypedMessage(&router.Config{
Rule: []*router.RoutingRule{
{
TargetTag: &router.RoutingRule_Tag{
Tag: "direct",
},
InboundTag: []string{"snif"},
}, {
TargetTag: &router.RoutingRule_Tag{
Tag: "redir",
},
InboundTag: []string{"http"},
},
},

View File

@ -57,13 +57,17 @@ func TestReverseProxy(t *testing.T) {
Domain: []*router.Domain{
{Type: router.Domain_Full, Value: "test.v2ray.com"},
},
TargetTag: &router.RoutingRule_Tag{
Tag: "portal",
},
},
{
InboundTag: []string{"external"},
TargetTag: &router.RoutingRule_Tag{
Tag: "portal",
},
},
},
}),
},
Inbound: []*core.InboundHandlerConfig{
@ -122,13 +126,17 @@ func TestReverseProxy(t *testing.T) {
Domain: []*router.Domain{
{Type: router.Domain_Full, Value: "test.v2ray.com"},
},
TargetTag: &router.RoutingRule_Tag{
Tag: "reverse",
},
},
{
InboundTag: []string{"bridge"},
TargetTag: &router.RoutingRule_Tag{
Tag: "freedom",
},
},
},
}),
},
Inbound: []*core.InboundHandlerConfig{
@ -256,13 +264,17 @@ func TestReverseProxyLongRunning(t *testing.T) {
Domain: []*router.Domain{
{Type: router.Domain_Full, Value: "test.v2ray.com"},
},
TargetTag: &router.RoutingRule_Tag{
Tag: "portal",
},
},
{
InboundTag: []string{"external"},
TargetTag: &router.RoutingRule_Tag{
Tag: "portal",
},
},
},
}),
},
Inbound: []*core.InboundHandlerConfig{
@ -335,13 +347,17 @@ func TestReverseProxyLongRunning(t *testing.T) {
Domain: []*router.Domain{
{Type: router.Domain_Full, Value: "test.v2ray.com"},
},
TargetTag: &router.RoutingRule_Tag{
Tag: "reverse",
},
},
{
InboundTag: []string{"bridge"},
TargetTag: &router.RoutingRule_Tag{
Tag: "freedom",
},
},
},
}),
},
Inbound: []*core.InboundHandlerConfig{

View File

@ -231,7 +231,9 @@ func TestSocksBridageUDPWithRouting(t *testing.T) {
serial.ToTypedMessage(&router.Config{
Rule: []*router.RoutingRule{
{
TargetTag: &router.RoutingRule_Tag{
Tag: "out",
},
InboundTag: []string{"socks"},
},
},