Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ameshkov committed Jun 16, 2024
1 parent 6f1b67f commit ef8961b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions internal/dnssrv/dnssrv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

const tlsServerName = "dns.example.com"
const relayUpstreamAddr = "tls://dns.google"
const relayUpstreamAddr = "8.8.8.8"

func TestNew(t *testing.T) {
testCases := []struct {
Expand Down Expand Up @@ -57,7 +57,7 @@ func TestNew(t *testing.T) {
proto: proxy.ProtoQUIC,
}, {
name: "no-redirect",
reqDomain: "example.org",
reqDomain: "example.net",
redirectDomains: []string{"example.com"},
expectedRedirect: false,
proto: proxy.ProtoUDP,
Expand Down Expand Up @@ -132,9 +132,14 @@ func TestNew(t *testing.T) {
require.NoError(t, err)

for _, reqType := range []uint16{dns.TypeA, dns.TypeAAAA, dns.TypeHTTPS} {
req := &dns.Msg{}
req.Question = []dns.Question{
{Name: dns.Fqdn(tc.reqDomain), Qtype: reqType, Qclass: dns.ClassINET},
req := &dns.Msg{
MsgHdr: dns.MsgHdr{
Id: dns.Id(),
RecursionDesired: true,
},
Question: []dns.Question{
{Name: dns.Fqdn(tc.reqDomain), Qtype: reqType, Qclass: dns.ClassINET},
},
}

resp, exchErr := testUpstream.Exchange(req)
Expand Down

0 comments on commit ef8961b

Please sign in to comment.