Skip to content

Commit

Permalink
dnsforward: imp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizzick committed Aug 9, 2023
1 parent 9c5bc29 commit c13ffda
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/dnsforward/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func TestHandleDNSRequest_handleDNSRequest(t *testing.T) {
||::1^$dnstype=~AAAA
0.0.0.0 duplicate.domain
0.0.0.0 duplicate.domain
0.0.0.0 blocked.by.hostrule
`

forwardConf := ServerConfig{
Expand Down Expand Up @@ -166,6 +167,17 @@ func TestHandleDNSRequest_handleDNSRequest(t *testing.T) {
},
A: netutil.IPv4Zero(),
}},
}, {
req: createTestMessageWithType("blocked.by.hostrule.", dns.TypeHTTPS),
name: "blocked_host_rule_https_req",
wantAns: []dns.RR{&dns.A{
Hdr: dns.RR_Header{
Name: "blocked.by.hostrule.",
Rrtype: dns.TypeA,
Class: dns.ClassINET,
},
A: netutil.IPv4Zero(),
}},
}}

for _, tc := range testCases {
Expand Down

0 comments on commit c13ffda

Please sign in to comment.