Skip to content

Commit

Permalink
test(inbound): remove testcase about ecs
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf-joe committed May 9, 2020
1 parent 7ba3904 commit 9dd8b16
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions inbound/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,6 @@ func TestGroup(t *testing.T) {

ipv4 := net.IPv4(1, 1, 1, 1)
resp := &dns.Msg{Answer: []dns.RR{&dns.A{A: ipv4}}}
// 测试appendECS
mocker.MethodSeq(callers[0], "Call", []gomonkey.Params{
{resp, nil}, {resp, nil}, {resp, nil},
})
group.ECS = &dns.EDNS0_SUBNET{Family: 1, SourceNetmask: 32, Address: ipv4}
req := &dns.Msg{Extra: []dns.RR{&dns.OPT{}}}
assert.Equal(t, len(req.Extra[0].(*dns.OPT).Option), 0) // 无ecs
_ = group.CallDNS(req)
assert.Equal(t, len(req.Extra[0].(*dns.OPT).Option), 1) // 附加了ecs
_ = group.CallDNS(req)
assert.Equal(t, len(req.Extra[0].(*dns.OPT).Option), 1) // 已有ecs,不再次附加ecs
// 测试CallDNS
assert.Nil(t, group.CallDNS(nil))
mocker.MethodSeq(callers[0], "Call", []gomonkey.Params{
Expand Down

0 comments on commit 9dd8b16

Please sign in to comment.