refactor(netxlite): add Transport suffix to DNS transports (#731)

This diff has been extracted from https://github.com/bassosimone/websteps-illustrated/commit/c2f7ccab0ec971d5c084ea4c571b76f7530b28ee

See https://github.com/ooni/probe/issues/2096
This commit is contained in:
Simone Basso
2022-05-14 17:38:31 +02:00
committed by GitHub
parent 6c388d2c61
commit f5b801ae95
16 changed files with 94 additions and 94 deletions
@@ -124,7 +124,7 @@ func TestConfigurerNewConfigurationResolverDNSOverHTTPSPowerdns(t *testing.T) {
if !ok {
t.Fatal("not the DNS transport we expected")
}
dohtxp, ok := stxp.DNSTransport.(*netxlite.DNSOverHTTPS)
dohtxp, ok := stxp.DNSTransport.(*netxlite.DNSOverHTTPSTransport)
if !ok {
t.Fatal("not the DNS transport we expected")
}
@@ -200,7 +200,7 @@ func TestConfigurerNewConfigurationResolverDNSOverHTTPSGoogle(t *testing.T) {
if !ok {
t.Fatal("not the DNS transport we expected")
}
dohtxp, ok := stxp.DNSTransport.(*netxlite.DNSOverHTTPS)
dohtxp, ok := stxp.DNSTransport.(*netxlite.DNSOverHTTPSTransport)
if !ok {
t.Fatal("not the DNS transport we expected")
}
@@ -276,7 +276,7 @@ func TestConfigurerNewConfigurationResolverDNSOverHTTPSCloudflare(t *testing.T)
if !ok {
t.Fatal("not the DNS transport we expected")
}
dohtxp, ok := stxp.DNSTransport.(*netxlite.DNSOverHTTPS)
dohtxp, ok := stxp.DNSTransport.(*netxlite.DNSOverHTTPSTransport)
if !ok {
t.Fatal("not the DNS transport we expected")
}
@@ -352,7 +352,7 @@ func TestConfigurerNewConfigurationResolverUDP(t *testing.T) {
if !ok {
t.Fatal("not the DNS transport we expected")
}
udptxp, ok := stxp.DNSTransport.(*netxlite.DNSOverUDP)
udptxp, ok := stxp.DNSTransport.(*netxlite.DNSOverUDPTransport)
if !ok {
t.Fatal("not the DNS transport we expected")
}
+1 -1
View File
@@ -368,5 +368,5 @@ const thResolverURL = "https://dns.google/dns-query"
// Here we're using github.com/apex/log as the logger, which
// is fine because this is backend only code.
var thResolver = netxlite.WrapResolver(log.Log, netxlite.NewSerialResolver(
netxlite.NewDNSOverHTTPS(http.DefaultClient, thResolverURL),
netxlite.NewDNSOverHTTPSTransport(http.DefaultClient, thResolverURL),
))