Pull request 2006: 6182-fix-fallback-dns
Updates #6182. Squashed commit of the following: commit 7467bf851932a878af0eda01c140056a4261b597 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Sep 8 17:29:44 2023 +0300 dnsforward: imp test commit b807123d6030012bf9e9a4a0e454983a2e012a96 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Sep 8 17:22:49 2023 +0300 dnsforward: add test commit 698fc69e441e9f1e0e4c2878c81309967c058cab Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Sep 8 16:50:39 2023 +0300 dnsforward: fix more commit 444ae2870cd78ef736df744d80438b4dae5133ce Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Sep 8 16:32:49 2023 +0300 all: upd chlog commit 114ff58c7010528249f27bdc0b2f9bcc537f74c1 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Sep 8 15:59:13 2023 +0300 dnsforward: fix fallback dns
This commit is contained in:
@@ -372,6 +372,27 @@ func TestServer_timeout(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestServer_Prepare_fallbacks(t *testing.T) {
|
||||
srvConf := &ServerConfig{
|
||||
Config: Config{
|
||||
FallbackDNS: []string{
|
||||
"#tls://1.1.1.1",
|
||||
"8.8.8.8",
|
||||
},
|
||||
EDNSClientSubnet: &EDNSClientSubnet{Enabled: false},
|
||||
},
|
||||
}
|
||||
|
||||
s, err := NewServer(DNSCreateParams{})
|
||||
require.NoError(t, err)
|
||||
|
||||
err = s.Prepare(srvConf)
|
||||
require.NoError(t, err)
|
||||
require.NotNil(t, s.dnsProxy.Fallbacks)
|
||||
|
||||
assert.Len(t, s.dnsProxy.Fallbacks.Upstreams, 1)
|
||||
}
|
||||
|
||||
func TestServerWithProtectionDisabled(t *testing.T) {
|
||||
s := createTestServer(t, &filtering.Config{
|
||||
BlockingMode: filtering.BlockingModeDefault,
|
||||
|
||||
Reference in New Issue
Block a user