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

Function newTestUpstreamConfig

proxy/proxy_internal_test.go:261–275  ·  view source on GitHub ↗

newTestUpstreamConfig creates a new UpstreamConfig with a single upstream address and default timeout.

(
	tb testing.TB,
	timeout time.Duration,
	addrs ...string,
)

Source from the content-addressed store, hash-verified

259// newTestUpstreamConfig creates a new UpstreamConfig with a single upstream
260// address and default timeout.
261func newTestUpstreamConfig(
262 tb testing.TB,
263 timeout time.Duration,
264 addrs ...string,
265) (u *UpstreamConfig) {
266 tb.Helper()
267
268 upsConf, err := ParseUpstreamsConfig(addrs, &upstream.Options{
269 Logger: testLogger,
270 Timeout: timeout,
271 })
272 require.NoError(tb, err)
273
274 return upsConf
275}
276
277// mustStartDefaultProxy starts a new proxy with default settings and returns
278// it. It fails the test on error.

Callers 15

newTestDNSCryptProxyFunction · 0.85
TestProxy_quicFunction · 0.85
TestHttpsProxyFunction · 0.85
TestProxy_trustedProxiesFunction · 0.85
TestProxy_tlsFunction · 0.85
mustStartDefaultProxyFunction · 0.85
TestProxyRaceFunction · 0.85
TestFallbackFunction · 0.85

Calls 1

ParseUpstreamsConfigFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…