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

Function sendTestMessages

proxy/proxy_internal_test.go:82–95  ·  view source on GitHub ↗

sendTestMessages sends [testMessagesCount] DNS requests to the specified connection and checks the responses.

(tb testing.TB, conn *dns.Conn)

Source from the content-addressed store, hash-verified

80// sendTestMessages sends [testMessagesCount] DNS requests to the specified
81// connection and checks the responses.
82func sendTestMessages(tb testing.TB, conn *dns.Conn) {
83 tb.Helper()
84
85 for i := range testMessagesCount {
86 req := newTestMessage()
87 err := conn.WriteMsg(req)
88 require.NoErrorf(tb, err, "req number %d", i)
89
90 res, err := conn.ReadMsg()
91 require.NoErrorf(tb, err, "resp number %d", i)
92
93 requireResponse(tb, req, res)
94 }
95}
96
97func newTestMessage() *dns.Msg {
98 return newHostTestMessage("google-public-dns-a.google.com")

Callers 3

TestProxy_tcpFunction · 0.85
TestProxy_tlsFunction · 0.85
TestUdpProxyFunction · 0.85

Calls 2

newTestMessageFunction · 0.85
requireResponseFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…