Skip to content

Commit

Permalink
fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DarienRaymond committed Nov 8, 2018
1 parent 58221eb commit df2d5b5
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 16 deletions.
12 changes: 9 additions & 3 deletions testing/scenarios/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ func TestCommanderRemoveHandler(t *testing.T) {
Rule: []*router.RoutingRule{
{
InboundTag: []string{"api"},
Tag: "api",
TargetTag: &router.RoutingRule_Tag{
Tag: "api",
},
},
},
}),
Expand Down Expand Up @@ -173,7 +175,9 @@ func TestCommanderAddRemoveUser(t *testing.T) {
Rule: []*router.RoutingRule{
{
InboundTag: []string{"api"},
Tag: "api",
TargetTag: &router.RoutingRule_Tag{
Tag: "api",
},
},
},
}),
Expand Down Expand Up @@ -381,7 +385,9 @@ func TestCommanderStats(t *testing.T) {
Rule: []*router.RoutingRule{
{
InboundTag: []string{"api"},
Tag: "api",
TargetTag: &router.RoutingRule_Tag{
Tag: "api",
},
},
},
}),
Expand Down
4 changes: 3 additions & 1 deletion testing/scenarios/dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ func TestResolveIP(t *testing.T) {
Prefix: 8,
},
},
Tag: "direct",
TargetTag: &router.RoutingRule_Tag{
Tag: "direct",
},
},
},
}),
Expand Down
12 changes: 9 additions & 3 deletions testing/scenarios/feature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,9 @@ func TestBlackhole(t *testing.T) {
serial.ToTypedMessage(&router.Config{
Rule: []*router.RoutingRule{
{
Tag: "blocked",
TargetTag: &router.RoutingRule_Tag{
Tag: "blocked",
},
PortRange: net.SinglePortRange(dest2.Port),
},
},
Expand Down Expand Up @@ -714,10 +716,14 @@ func TestDomainSniffing(t *testing.T) {
serial.ToTypedMessage(&router.Config{
Rule: []*router.RoutingRule{
{
Tag: "direct",
TargetTag: &router.RoutingRule_Tag{
Tag: "direct",
},
InboundTag: []string{"snif"},
}, {
Tag: "redir",
TargetTag: &router.RoutingRule_Tag{
Tag: "redir",
},
InboundTag: []string{"http"},
},
},
Expand Down
32 changes: 24 additions & 8 deletions testing/scenarios/reverse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ func TestReverseProxy(t *testing.T) {
Domain: []*router.Domain{
{Type: router.Domain_Full, Value: "test.v2ray.com"},
},
Tag: "portal",
TargetTag: &router.RoutingRule_Tag{
Tag: "portal",
},
},
{
InboundTag: []string{"external"},
Tag: "portal",
TargetTag: &router.RoutingRule_Tag{
Tag: "portal",
},
},
},
}),
Expand Down Expand Up @@ -122,11 +126,15 @@ func TestReverseProxy(t *testing.T) {
Domain: []*router.Domain{
{Type: router.Domain_Full, Value: "test.v2ray.com"},
},
Tag: "reverse",
TargetTag: &router.RoutingRule_Tag{
Tag: "reverse",
},
},
{
InboundTag: []string{"bridge"},
Tag: "freedom",
TargetTag: &router.RoutingRule_Tag{
Tag: "freedom",
},
},
},
}),
Expand Down Expand Up @@ -256,11 +264,15 @@ func TestReverseProxyLongRunning(t *testing.T) {
Domain: []*router.Domain{
{Type: router.Domain_Full, Value: "test.v2ray.com"},
},
Tag: "portal",
TargetTag: &router.RoutingRule_Tag{
Tag: "portal",
},
},
{
InboundTag: []string{"external"},
Tag: "portal",
TargetTag: &router.RoutingRule_Tag{
Tag: "portal",
},
},
},
}),
Expand Down Expand Up @@ -335,11 +347,15 @@ func TestReverseProxyLongRunning(t *testing.T) {
Domain: []*router.Domain{
{Type: router.Domain_Full, Value: "test.v2ray.com"},
},
Tag: "reverse",
TargetTag: &router.RoutingRule_Tag{
Tag: "reverse",
},
},
{
InboundTag: []string{"bridge"},
Tag: "freedom",
TargetTag: &router.RoutingRule_Tag{
Tag: "freedom",
},
},
},
}),
Expand Down
4 changes: 3 additions & 1 deletion testing/scenarios/socks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ func TestSocksBridageUDPWithRouting(t *testing.T) {
serial.ToTypedMessage(&router.Config{
Rule: []*router.RoutingRule{
{
Tag: "out",
TargetTag: &router.RoutingRule_Tag{
Tag: "out",
},
InboundTag: []string{"socks"},
},
},
Expand Down

0 comments on commit df2d5b5

Please sign in to comment.