(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func 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. |
nothing calls this directly
no test coverage detected
searching dependent graphs…