AdGuardHome/internal/dnsforward/upstreams_internal_test.go

217 lines
5.8 KiB
Go
Raw Normal View History

Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
package dnsforward
import (
"net"
"net/url"
"strings"
"testing"
"time"
"github.com/AdguardTeam/dnsproxy/upstream"
"github.com/AdguardTeam/golibs/testutil"
"github.com/miekg/dns"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestUpstreamConfigValidator(t *testing.T) {
goodHandler := dns.HandlerFunc(func(w dns.ResponseWriter, m *dns.Msg) {
err := w.WriteMsg(new(dns.Msg).SetReply(m))
require.NoError(testutil.PanicT{}, err)
})
badHandler := dns.HandlerFunc(func(w dns.ResponseWriter, _ *dns.Msg) {
err := w.WriteMsg(new(dns.Msg))
require.NoError(testutil.PanicT{}, err)
})
goodUps := (&url.URL{
Scheme: "tcp",
Host: newLocalUpstreamListener(t, 0, goodHandler).String(),
}).String()
badUps := (&url.URL{
Scheme: "tcp",
Host: newLocalUpstreamListener(t, 0, badHandler).String(),
}).String()
goodAndBadUps := strings.Join([]string{goodUps, badUps}, " ")
// upsTimeout restricts the checking process to prevent the test from
// hanging.
const upsTimeout = 100 * time.Millisecond
testCases := []struct {
want map[string]string
name string
general []string
fallback []string
private []string
}{{
name: "success",
general: []string{goodUps},
want: map[string]string{
goodUps: "OK",
},
}, {
name: "broken",
general: []string{badUps},
want: map[string]string{
badUps: `couldn't communicate with upstream: exchanging with ` +
badUps + ` over tcp: dns: id mismatch`,
},
}, {
name: "both",
general: []string{goodUps, badUps, goodUps},
want: map[string]string{
goodUps: "OK",
badUps: `couldn't communicate with upstream: exchanging with ` +
badUps + ` over tcp: dns: id mismatch`,
},
}, {
name: "domain_specific_error",
general: []string{"[/domain.example/]" + badUps},
want: map[string]string{
badUps: `WARNING: couldn't communicate ` +
`with upstream: exchanging with ` + badUps + ` over tcp: ` +
`dns: id mismatch`,
},
}, {
name: "fallback_success",
fallback: []string{goodUps},
want: map[string]string{
goodUps: "OK",
},
}, {
name: "fallback_broken",
fallback: []string{badUps},
want: map[string]string{
badUps: `couldn't communicate with upstream: exchanging with ` +
badUps + ` over tcp: dns: id mismatch`,
},
}, {
name: "multiple_domain_specific_upstreams",
general: []string{"[/domain.example/]" + goodAndBadUps},
want: map[string]string{
goodUps: "OK",
badUps: `WARNING: couldn't communicate ` +
`with upstream: exchanging with ` + badUps + ` over tcp: ` +
`dns: id mismatch`,
},
}, {
name: "bad_specification",
general: []string{"[/domain.example/]/]1.2.3.4"},
want: map[string]string{
Pull request 2107: AG-28327-upstream-config-parser Squashed commit of the following: commit e496653b10de52676826ed8e0c461e91405603a8 Merge: db2cd04e9 60a978c9a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Feb 1 18:23:50 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit db2cd04e981dd24998d87f4935ff6590ea7854cd Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:21:53 2024 +0300 all: upd proxy commit e8878179b6d094321d56fb2b75c16c1ba8cf637d Merge: ccbbae6d6 aa872dfe9 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:17:34 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit ccbbae6d615e110d7d2d4c2a6b35954311153bcf Merge: d947d900e 8936c95ec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:31:17 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit d947d900e1f759159bc9068589ffe852483cfdd0 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:26:01 2024 +0300 dnsforward: imp docs commit cf9678c098951e2a4bebae7a3a5808d7de4c14c6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 25 14:18:04 2024 +0300 dnsforward: imp code commit 22792a9311cb93b2bb3b804293f87f091b9b81e2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 24 13:59:28 2024 +0300 dnsforward: imp code commit 57ddaaaaaf1009c65f0d9d6b2b1671211f194c85 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 20:19:44 2024 +0300 all: add tests commit d6732d13adae4ee46410252a33d092e67da3c34a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 18:44:57 2024 +0300 all: imp errors commit e14456571ce2ef43fb217f45445729ce6299daf6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 18 19:05:31 2024 +0300 dnsforward: imp code commit a5c106eae902fbc0a169ef9e4d7bf968f1e40bec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 18:36:30 2024 +0300 dnsforward: imp logs commit 333b8561aa21d778007f808fb8e931ef3e95d721 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Dec 21 15:06:42 2023 +0300 all: imp tests commit 5b19d6b039755577e03ffcc03952724a36f21aa4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 15 14:21:58 2023 +0300 all: imp code commit 15fbd229de336425bde107a4f32175b8af41d876 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Dec 13 14:49:40 2023 +0300 all: upstream config parser
2024-02-05 13:12:27 +00:00
"[/domain.example/]/]1.2.3.4": generalTextLabel + " 1: parsing error",
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
},
}, {
name: "all_different",
general: []string{"[/domain.example/]" + goodAndBadUps},
fallback: []string{"[/domain.example/]" + goodAndBadUps},
private: []string{"[/domain.example/]" + goodAndBadUps},
want: map[string]string{
goodUps: "OK",
badUps: `WARNING: couldn't communicate ` +
`with upstream: exchanging with ` + badUps + ` over tcp: ` +
`dns: id mismatch`,
},
}, {
name: "bad_specific_domains",
general: []string{"[/example/]/]" + goodUps},
fallback: []string{"[/example/" + goodUps},
private: []string{"[/example//bad.123/]" + goodUps},
want: map[string]string{
Pull request 2107: AG-28327-upstream-config-parser Squashed commit of the following: commit e496653b10de52676826ed8e0c461e91405603a8 Merge: db2cd04e9 60a978c9a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Feb 1 18:23:50 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit db2cd04e981dd24998d87f4935ff6590ea7854cd Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:21:53 2024 +0300 all: upd proxy commit e8878179b6d094321d56fb2b75c16c1ba8cf637d Merge: ccbbae6d6 aa872dfe9 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:17:34 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit ccbbae6d615e110d7d2d4c2a6b35954311153bcf Merge: d947d900e 8936c95ec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:31:17 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit d947d900e1f759159bc9068589ffe852483cfdd0 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:26:01 2024 +0300 dnsforward: imp docs commit cf9678c098951e2a4bebae7a3a5808d7de4c14c6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 25 14:18:04 2024 +0300 dnsforward: imp code commit 22792a9311cb93b2bb3b804293f87f091b9b81e2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 24 13:59:28 2024 +0300 dnsforward: imp code commit 57ddaaaaaf1009c65f0d9d6b2b1671211f194c85 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 20:19:44 2024 +0300 all: add tests commit d6732d13adae4ee46410252a33d092e67da3c34a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 18:44:57 2024 +0300 all: imp errors commit e14456571ce2ef43fb217f45445729ce6299daf6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 18 19:05:31 2024 +0300 dnsforward: imp code commit a5c106eae902fbc0a169ef9e4d7bf968f1e40bec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 18:36:30 2024 +0300 dnsforward: imp logs commit 333b8561aa21d778007f808fb8e931ef3e95d721 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Dec 21 15:06:42 2023 +0300 all: imp tests commit 5b19d6b039755577e03ffcc03952724a36f21aa4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 15 14:21:58 2023 +0300 all: imp code commit 15fbd229de336425bde107a4f32175b8af41d876 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Dec 13 14:49:40 2023 +0300 all: upstream config parser
2024-02-05 13:12:27 +00:00
"[/example/]/]" + goodUps: generalTextLabel + " 1: parsing error",
"[/example/" + goodUps: fallbackTextLabel + " 1: parsing error",
"[/example//bad.123/]" + goodUps: privateTextLabel + " 1: parsing error",
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
},
}, {
Pull request 2107: AG-28327-upstream-config-parser Squashed commit of the following: commit e496653b10de52676826ed8e0c461e91405603a8 Merge: db2cd04e9 60a978c9a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Feb 1 18:23:50 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit db2cd04e981dd24998d87f4935ff6590ea7854cd Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:21:53 2024 +0300 all: upd proxy commit e8878179b6d094321d56fb2b75c16c1ba8cf637d Merge: ccbbae6d6 aa872dfe9 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:17:34 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit ccbbae6d615e110d7d2d4c2a6b35954311153bcf Merge: d947d900e 8936c95ec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:31:17 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit d947d900e1f759159bc9068589ffe852483cfdd0 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:26:01 2024 +0300 dnsforward: imp docs commit cf9678c098951e2a4bebae7a3a5808d7de4c14c6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 25 14:18:04 2024 +0300 dnsforward: imp code commit 22792a9311cb93b2bb3b804293f87f091b9b81e2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 24 13:59:28 2024 +0300 dnsforward: imp code commit 57ddaaaaaf1009c65f0d9d6b2b1671211f194c85 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 20:19:44 2024 +0300 all: add tests commit d6732d13adae4ee46410252a33d092e67da3c34a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 18:44:57 2024 +0300 all: imp errors commit e14456571ce2ef43fb217f45445729ce6299daf6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 18 19:05:31 2024 +0300 dnsforward: imp code commit a5c106eae902fbc0a169ef9e4d7bf968f1e40bec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 18:36:30 2024 +0300 dnsforward: imp logs commit 333b8561aa21d778007f808fb8e931ef3e95d721 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Dec 21 15:06:42 2023 +0300 all: imp tests commit 5b19d6b039755577e03ffcc03952724a36f21aa4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 15 14:21:58 2023 +0300 all: imp code commit 15fbd229de336425bde107a4f32175b8af41d876 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Dec 13 14:49:40 2023 +0300 all: upstream config parser
2024-02-05 13:12:27 +00:00
name: "bad_proto",
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
general: []string{
Pull request 2107: AG-28327-upstream-config-parser Squashed commit of the following: commit e496653b10de52676826ed8e0c461e91405603a8 Merge: db2cd04e9 60a978c9a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Feb 1 18:23:50 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit db2cd04e981dd24998d87f4935ff6590ea7854cd Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:21:53 2024 +0300 all: upd proxy commit e8878179b6d094321d56fb2b75c16c1ba8cf637d Merge: ccbbae6d6 aa872dfe9 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:17:34 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit ccbbae6d615e110d7d2d4c2a6b35954311153bcf Merge: d947d900e 8936c95ec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:31:17 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit d947d900e1f759159bc9068589ffe852483cfdd0 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:26:01 2024 +0300 dnsforward: imp docs commit cf9678c098951e2a4bebae7a3a5808d7de4c14c6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 25 14:18:04 2024 +0300 dnsforward: imp code commit 22792a9311cb93b2bb3b804293f87f091b9b81e2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 24 13:59:28 2024 +0300 dnsforward: imp code commit 57ddaaaaaf1009c65f0d9d6b2b1671211f194c85 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 20:19:44 2024 +0300 all: add tests commit d6732d13adae4ee46410252a33d092e67da3c34a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 18:44:57 2024 +0300 all: imp errors commit e14456571ce2ef43fb217f45445729ce6299daf6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 18 19:05:31 2024 +0300 dnsforward: imp code commit a5c106eae902fbc0a169ef9e4d7bf968f1e40bec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 18:36:30 2024 +0300 dnsforward: imp logs commit 333b8561aa21d778007f808fb8e931ef3e95d721 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Dec 21 15:06:42 2023 +0300 all: imp tests commit 5b19d6b039755577e03ffcc03952724a36f21aa4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 15 14:21:58 2023 +0300 all: imp code commit 15fbd229de336425bde107a4f32175b8af41d876 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Dec 13 14:49:40 2023 +0300 all: upstream config parser
2024-02-05 13:12:27 +00:00
"bad://1.2.3.4",
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
},
want: map[string]string{
Pull request 2107: AG-28327-upstream-config-parser Squashed commit of the following: commit e496653b10de52676826ed8e0c461e91405603a8 Merge: db2cd04e9 60a978c9a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Feb 1 18:23:50 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit db2cd04e981dd24998d87f4935ff6590ea7854cd Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:21:53 2024 +0300 all: upd proxy commit e8878179b6d094321d56fb2b75c16c1ba8cf637d Merge: ccbbae6d6 aa872dfe9 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:17:34 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit ccbbae6d615e110d7d2d4c2a6b35954311153bcf Merge: d947d900e 8936c95ec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:31:17 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit d947d900e1f759159bc9068589ffe852483cfdd0 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:26:01 2024 +0300 dnsforward: imp docs commit cf9678c098951e2a4bebae7a3a5808d7de4c14c6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 25 14:18:04 2024 +0300 dnsforward: imp code commit 22792a9311cb93b2bb3b804293f87f091b9b81e2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 24 13:59:28 2024 +0300 dnsforward: imp code commit 57ddaaaaaf1009c65f0d9d6b2b1671211f194c85 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 20:19:44 2024 +0300 all: add tests commit d6732d13adae4ee46410252a33d092e67da3c34a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 18:44:57 2024 +0300 all: imp errors commit e14456571ce2ef43fb217f45445729ce6299daf6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 18 19:05:31 2024 +0300 dnsforward: imp code commit a5c106eae902fbc0a169ef9e4d7bf968f1e40bec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 18:36:30 2024 +0300 dnsforward: imp logs commit 333b8561aa21d778007f808fb8e931ef3e95d721 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Dec 21 15:06:42 2023 +0300 all: imp tests commit 5b19d6b039755577e03ffcc03952724a36f21aa4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 15 14:21:58 2023 +0300 all: imp code commit 15fbd229de336425bde107a4f32175b8af41d876 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Dec 13 14:49:40 2023 +0300 all: upstream config parser
2024-02-05 13:12:27 +00:00
"bad://1.2.3.4": generalTextLabel + " 1: parsing error",
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
},
}, {
Pull request 2107: AG-28327-upstream-config-parser Squashed commit of the following: commit e496653b10de52676826ed8e0c461e91405603a8 Merge: db2cd04e9 60a978c9a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Feb 1 18:23:50 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit db2cd04e981dd24998d87f4935ff6590ea7854cd Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:21:53 2024 +0300 all: upd proxy commit e8878179b6d094321d56fb2b75c16c1ba8cf637d Merge: ccbbae6d6 aa872dfe9 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:17:34 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit ccbbae6d615e110d7d2d4c2a6b35954311153bcf Merge: d947d900e 8936c95ec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:31:17 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit d947d900e1f759159bc9068589ffe852483cfdd0 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:26:01 2024 +0300 dnsforward: imp docs commit cf9678c098951e2a4bebae7a3a5808d7de4c14c6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 25 14:18:04 2024 +0300 dnsforward: imp code commit 22792a9311cb93b2bb3b804293f87f091b9b81e2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 24 13:59:28 2024 +0300 dnsforward: imp code commit 57ddaaaaaf1009c65f0d9d6b2b1671211f194c85 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 20:19:44 2024 +0300 all: add tests commit d6732d13adae4ee46410252a33d092e67da3c34a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 18:44:57 2024 +0300 all: imp errors commit e14456571ce2ef43fb217f45445729ce6299daf6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 18 19:05:31 2024 +0300 dnsforward: imp code commit a5c106eae902fbc0a169ef9e4d7bf968f1e40bec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 18:36:30 2024 +0300 dnsforward: imp logs commit 333b8561aa21d778007f808fb8e931ef3e95d721 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Dec 21 15:06:42 2023 +0300 all: imp tests commit 5b19d6b039755577e03ffcc03952724a36f21aa4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 15 14:21:58 2023 +0300 all: imp code commit 15fbd229de336425bde107a4f32175b8af41d876 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Dec 13 14:49:40 2023 +0300 all: upstream config parser
2024-02-05 13:12:27 +00:00
name: "truncated_line",
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
general: []string{
Pull request 2107: AG-28327-upstream-config-parser Squashed commit of the following: commit e496653b10de52676826ed8e0c461e91405603a8 Merge: db2cd04e9 60a978c9a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Feb 1 18:23:50 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit db2cd04e981dd24998d87f4935ff6590ea7854cd Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:21:53 2024 +0300 all: upd proxy commit e8878179b6d094321d56fb2b75c16c1ba8cf637d Merge: ccbbae6d6 aa872dfe9 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:17:34 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit ccbbae6d615e110d7d2d4c2a6b35954311153bcf Merge: d947d900e 8936c95ec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:31:17 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit d947d900e1f759159bc9068589ffe852483cfdd0 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:26:01 2024 +0300 dnsforward: imp docs commit cf9678c098951e2a4bebae7a3a5808d7de4c14c6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 25 14:18:04 2024 +0300 dnsforward: imp code commit 22792a9311cb93b2bb3b804293f87f091b9b81e2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 24 13:59:28 2024 +0300 dnsforward: imp code commit 57ddaaaaaf1009c65f0d9d6b2b1671211f194c85 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 20:19:44 2024 +0300 all: add tests commit d6732d13adae4ee46410252a33d092e67da3c34a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 18:44:57 2024 +0300 all: imp errors commit e14456571ce2ef43fb217f45445729ce6299daf6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 18 19:05:31 2024 +0300 dnsforward: imp code commit a5c106eae902fbc0a169ef9e4d7bf968f1e40bec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 18:36:30 2024 +0300 dnsforward: imp logs commit 333b8561aa21d778007f808fb8e931ef3e95d721 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Dec 21 15:06:42 2023 +0300 all: imp tests commit 5b19d6b039755577e03ffcc03952724a36f21aa4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 15 14:21:58 2023 +0300 all: imp code commit 15fbd229de336425bde107a4f32175b8af41d876 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Dec 13 14:49:40 2023 +0300 all: upstream config parser
2024-02-05 13:12:27 +00:00
"This is a very long line. It will cause a parsing error and will be truncated here.",
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
},
want: map[string]string{
Pull request 2107: AG-28327-upstream-config-parser Squashed commit of the following: commit e496653b10de52676826ed8e0c461e91405603a8 Merge: db2cd04e9 60a978c9a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Feb 1 18:23:50 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit db2cd04e981dd24998d87f4935ff6590ea7854cd Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:21:53 2024 +0300 all: upd proxy commit e8878179b6d094321d56fb2b75c16c1ba8cf637d Merge: ccbbae6d6 aa872dfe9 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 31 16:17:34 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit ccbbae6d615e110d7d2d4c2a6b35954311153bcf Merge: d947d900e 8936c95ec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:31:17 2024 +0300 Merge branch 'master' into AG-28327-upstream-config-parser commit d947d900e1f759159bc9068589ffe852483cfdd0 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 29 18:26:01 2024 +0300 dnsforward: imp docs commit cf9678c098951e2a4bebae7a3a5808d7de4c14c6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 25 14:18:04 2024 +0300 dnsforward: imp code commit 22792a9311cb93b2bb3b804293f87f091b9b81e2 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Jan 24 13:59:28 2024 +0300 dnsforward: imp code commit 57ddaaaaaf1009c65f0d9d6b2b1671211f194c85 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 20:19:44 2024 +0300 all: add tests commit d6732d13adae4ee46410252a33d092e67da3c34a Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 22 18:44:57 2024 +0300 all: imp errors commit e14456571ce2ef43fb217f45445729ce6299daf6 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Jan 18 19:05:31 2024 +0300 dnsforward: imp code commit a5c106eae902fbc0a169ef9e4d7bf968f1e40bec Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Mon Jan 15 18:36:30 2024 +0300 dnsforward: imp logs commit 333b8561aa21d778007f808fb8e931ef3e95d721 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Thu Dec 21 15:06:42 2023 +0300 all: imp tests commit 5b19d6b039755577e03ffcc03952724a36f21aa4 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Fri Dec 15 14:21:58 2023 +0300 all: imp code commit 15fbd229de336425bde107a4f32175b8af41d876 Author: Stanislav Chzhen <s.chzhen@adguard.com> Date: Wed Dec 13 14:49:40 2023 +0300 all: upstream config parser
2024-02-05 13:12:27 +00:00
"This is a very long line. It will cause a parsing error and will be truncated …": "upstream_dns 1: parsing error",
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
},
}}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
cv := newUpstreamConfigValidator(tc.general, tc.fallback, tc.private, &upstream.Options{
Timeout: upsTimeout,
Bootstrap: net.DefaultResolver,
})
cv.check()
cv.close()
assert.Equal(t, tc.want, cv.status())
})
}
}
func TestUpstreamConfigValidator_Check_once(t *testing.T) {
type signal = struct{}
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
reqCh := make(chan signal)
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
hdlr := dns.HandlerFunc(func(w dns.ResponseWriter, m *dns.Msg) {
pt := testutil.PanicT{}
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
err := w.WriteMsg(new(dns.Msg).SetReply(m))
require.NoError(pt, err)
testutil.RequireSend(pt, reqCh, signal{}, testTimeout)
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
})
addr := (&url.URL{
Scheme: "tcp",
Host: newLocalUpstreamListener(t, 0, hdlr).String(),
}).String()
twoAddrs := strings.Join([]string{addr, addr}, " ")
wantStatus := map[string]string{
addr: "OK",
}
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
testCases := []struct {
name string
ups []string
}{{
name: "common",
ups: []string{addr, addr, addr},
}, {
name: "domain-specific",
ups: []string{"[/one.example/]" + addr, "[/two.example/]" + twoAddrs},
}, {
name: "both",
ups: []string{addr, "[/one.example/]" + addr, addr, "[/two.example/]" + twoAddrs},
}}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
cv := newUpstreamConfigValidator(tc.ups, nil, nil, &upstream.Options{
Timeout: testTimeout,
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
})
go func() {
cv.check()
testutil.RequireSend(testutil.PanicT{}, reqCh, signal{}, testTimeout)
}()
// Wait for the only request to be sent.
testutil.RequireReceive(t, reqCh, testTimeout)
// Wait for the check to finish.
testutil.RequireReceive(t, reqCh, testTimeout)
cv.close()
require.Equal(t, wantStatus, cv.status())
Pull request 2080: AG-27539 imp upstream test Squashed commit of the following: commit 5a9e8c0c2e4b68c0ff6508c47fbd8abde0d05e95 Merge: 85820c173 c4e69cd96 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 16:09:53 2023 +0300 Merge branch 'master' into AG-27539-imp-upstream-test commit 85820c173dddb6391dabe9615b821b585b1ecdef Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 28 15:48:53 2023 +0300 dnsforward: split code commit dac0148a4d4780bea19fb7622b46ac08fbf1ee74 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 15:47:05 2023 +0300 dnsforward: fix docs commit 9f0015b255d547f31d34513aa6bb2faf65a39e0e Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 24 14:45:43 2023 +0300 dnsforward: imp code commit 49fefc373972b7c8991abcb46d7730288b92c24c Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 23 14:12:02 2023 +0300 dnsforward: imp code commit 120ba4b1f727bba537471c4a8aa4b412eac30f85 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 17:02:01 2023 +0300 dnsforward: add tests commit 70775975ced46191a6ba64504c7bac0e3d1eed7f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 22 15:48:05 2023 +0300 dnsforward: imp code commit 9487f1fd62b821efb242267d9972f3ae3785ad19 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 18:06:00 2023 +0300 dnsforward: imp code commit e2612e0e6fd1c9116872939edd0e86f2e9af07d7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 21 16:12:20 2023 +0300 dnsforward: add ups checker commit 09db7d2a604809669affbeef2f0536fa6605a39b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 14 17:31:04 2023 +0300 dnsforward: separate upstream code
2023-11-28 13:40:52 +00:00
})
}
}