Skip to content

Commit df2d5b5

Browse files
committed
fix broken tests
1 parent 58221eb commit df2d5b5

File tree

5 files changed

+48
-16
lines changed

5 files changed

+48
-16
lines changed

testing/scenarios/command_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ func TestCommanderRemoveHandler(t *testing.T) {
5656
Rule: []*router.RoutingRule{
5757
{
5858
InboundTag: []string{"api"},
59-
Tag: "api",
59+
TargetTag: &router.RoutingRule_Tag{
60+
Tag: "api",
61+
},
6062
},
6163
},
6264
}),
@@ -173,7 +175,9 @@ func TestCommanderAddRemoveUser(t *testing.T) {
173175
Rule: []*router.RoutingRule{
174176
{
175177
InboundTag: []string{"api"},
176-
Tag: "api",
178+
TargetTag: &router.RoutingRule_Tag{
179+
Tag: "api",
180+
},
177181
},
178182
},
179183
}),
@@ -381,7 +385,9 @@ func TestCommanderStats(t *testing.T) {
381385
Rule: []*router.RoutingRule{
382386
{
383387
InboundTag: []string{"api"},
384-
Tag: "api",
388+
TargetTag: &router.RoutingRule_Tag{
389+
Tag: "api",
390+
},
385391
},
386392
},
387393
}),

testing/scenarios/dns_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ func TestResolveIP(t *testing.T) {
4646
Prefix: 8,
4747
},
4848
},
49-
Tag: "direct",
49+
TargetTag: &router.RoutingRule_Tag{
50+
Tag: "direct",
51+
},
5052
},
5153
},
5254
}),

testing/scenarios/feature_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,9 @@ func TestBlackhole(t *testing.T) {
475475
serial.ToTypedMessage(&router.Config{
476476
Rule: []*router.RoutingRule{
477477
{
478-
Tag: "blocked",
478+
TargetTag: &router.RoutingRule_Tag{
479+
Tag: "blocked",
480+
},
479481
PortRange: net.SinglePortRange(dest2.Port),
480482
},
481483
},
@@ -714,10 +716,14 @@ func TestDomainSniffing(t *testing.T) {
714716
serial.ToTypedMessage(&router.Config{
715717
Rule: []*router.RoutingRule{
716718
{
717-
Tag: "direct",
719+
TargetTag: &router.RoutingRule_Tag{
720+
Tag: "direct",
721+
},
718722
InboundTag: []string{"snif"},
719723
}, {
720-
Tag: "redir",
724+
TargetTag: &router.RoutingRule_Tag{
725+
Tag: "redir",
726+
},
721727
InboundTag: []string{"http"},
722728
},
723729
},

testing/scenarios/reverse_test.go

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,15 @@ func TestReverseProxy(t *testing.T) {
5757
Domain: []*router.Domain{
5858
{Type: router.Domain_Full, Value: "test.v2ray.com"},
5959
},
60-
Tag: "portal",
60+
TargetTag: &router.RoutingRule_Tag{
61+
Tag: "portal",
62+
},
6163
},
6264
{
6365
InboundTag: []string{"external"},
64-
Tag: "portal",
66+
TargetTag: &router.RoutingRule_Tag{
67+
Tag: "portal",
68+
},
6569
},
6670
},
6771
}),
@@ -122,11 +126,15 @@ func TestReverseProxy(t *testing.T) {
122126
Domain: []*router.Domain{
123127
{Type: router.Domain_Full, Value: "test.v2ray.com"},
124128
},
125-
Tag: "reverse",
129+
TargetTag: &router.RoutingRule_Tag{
130+
Tag: "reverse",
131+
},
126132
},
127133
{
128134
InboundTag: []string{"bridge"},
129-
Tag: "freedom",
135+
TargetTag: &router.RoutingRule_Tag{
136+
Tag: "freedom",
137+
},
130138
},
131139
},
132140
}),
@@ -256,11 +264,15 @@ func TestReverseProxyLongRunning(t *testing.T) {
256264
Domain: []*router.Domain{
257265
{Type: router.Domain_Full, Value: "test.v2ray.com"},
258266
},
259-
Tag: "portal",
267+
TargetTag: &router.RoutingRule_Tag{
268+
Tag: "portal",
269+
},
260270
},
261271
{
262272
InboundTag: []string{"external"},
263-
Tag: "portal",
273+
TargetTag: &router.RoutingRule_Tag{
274+
Tag: "portal",
275+
},
264276
},
265277
},
266278
}),
@@ -335,11 +347,15 @@ func TestReverseProxyLongRunning(t *testing.T) {
335347
Domain: []*router.Domain{
336348
{Type: router.Domain_Full, Value: "test.v2ray.com"},
337349
},
338-
Tag: "reverse",
350+
TargetTag: &router.RoutingRule_Tag{
351+
Tag: "reverse",
352+
},
339353
},
340354
{
341355
InboundTag: []string{"bridge"},
342-
Tag: "freedom",
356+
TargetTag: &router.RoutingRule_Tag{
357+
Tag: "freedom",
358+
},
343359
},
344360
},
345361
}),

testing/scenarios/socks_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ func TestSocksBridageUDPWithRouting(t *testing.T) {
231231
serial.ToTypedMessage(&router.Config{
232232
Rule: []*router.RoutingRule{
233233
{
234-
Tag: "out",
234+
TargetTag: &router.RoutingRule_Tag{
235+
Tag: "out",
236+
},
235237
InboundTag: []string{"socks"},
236238
},
237239
},

0 commit comments

Comments
 (0)