MCPcopy
hub / github.com/AdguardTeam/dnsproxy / TestDNSCryptProxy

Function TestDNSCryptProxy

proxy/serverdnscrypt_internal_test.go:17–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func TestDNSCryptProxy(t *testing.T) {
18 t.Parallel()
19
20 // Prepare the proxy server.
21 dnsProxy, rc := newTestDNSCryptProxy(t)
22
23 servicetest.RequireRun(t, dnsProxy, testTimeout)
24
25 // Generate a DNS stamp.
26 port := testutil.RequireTypeAssert[*net.UDPAddr](t, dnsProxy.Addr(ProtoDNSCrypt)).Port
27 addr := netutil.JoinHostPort(listenIP, uint16(port))
28 stamp, err := rc.CreateStamp(addr)
29 require.NoError(t, err)
30
31 // Test DNSCrypt proxy on both UDP and TCP.
32 checkDNSCryptProxy(t, dnscrypt.ProtoUDP, stamp)
33 checkDNSCryptProxy(t, dnscrypt.ProtoTCP, stamp)
34}
35
36// newTestDNSCryptProxy is a helper function that creates a DNSCrypt proxy and
37// the corresponding resolver configuration for testing.

Callers

nothing calls this directly

Calls 3

newTestDNSCryptProxyFunction · 0.85
checkDNSCryptProxyFunction · 0.85
AddrMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…