mirror of https://github.com/hashicorp/consul
Backport of NET-7630 - Fix TXT record creation on node queries into release/1.18.x (#20500)
NET-7630 - Fix TXT record creation on node queries (#20483) Co-authored-by: John Murret <john.murret@hashicorp.com>pull/20509/head
parent
d9bedd02dc
commit
a118821da7
|
@ -14,6 +14,8 @@ import (
|
|||
"github.com/hashicorp/consul/testrpc"
|
||||
)
|
||||
|
||||
// TODO (v2-dns): Failing on "lookup a non-existing node, we should receive a SOA"
|
||||
// it is coming back empty.
|
||||
func TestDNS_NodeLookup(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -117,13 +119,12 @@ func TestDNS_NodeLookup(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestDNS_CaseInsensitiveNodeLookup(t *testing.T) {
|
||||
func TestDNS_NodeLookup_CaseInsensitive(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, experimentsHCL)
|
||||
defer a.Shutdown()
|
||||
|
@ -157,6 +158,8 @@ func TestDNS_CaseInsensitiveNodeLookup(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): NET-7632 - Fix node lookup when question name has a period in it.
|
||||
// Answer is coming back empty
|
||||
func TestDNS_NodeLookup_PeriodName(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -210,8 +213,7 @@ func TestDNS_NodeLookup_AAAA(t *testing.T) {
|
|||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, experimentsHCL)
|
||||
defer a.Shutdown()
|
||||
|
@ -256,6 +258,11 @@ func TestDNS_NodeLookup_AAAA(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): NET-7631 - Implement external CNAME references
|
||||
// Failing on answer assertion. some CNAMEs are not getting created
|
||||
// and the record type on the AAAA record is incorrect.
|
||||
// External services do not appear to be working properly here
|
||||
// and in the service lookup tests.
|
||||
func TestDNS_NodeLookup_CNAME(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -329,7 +336,7 @@ func TestDNS_NodeLookup_TXT(t *testing.T) {
|
|||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, experimentsHCL)
|
||||
defer a.Shutdown()
|
||||
|
@ -383,7 +390,7 @@ func TestDNS_NodeLookup_TXT_DontSuppress(t *testing.T) {
|
|||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, `dns_config = { enable_additional_node_meta_txt = false } `+experimentsHCL)
|
||||
defer a.Shutdown()
|
||||
|
@ -437,7 +444,7 @@ func TestDNS_NodeLookup_ANY(t *testing.T) {
|
|||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, experimentsHCL)
|
||||
defer a.Shutdown()
|
||||
|
@ -486,7 +493,7 @@ func TestDNS_NodeLookup_ANY_DontSuppressTXT(t *testing.T) {
|
|||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, `dns_config = { enable_additional_node_meta_txt = false } `+experimentsHCL)
|
||||
defer a.Shutdown()
|
||||
|
@ -535,7 +542,7 @@ func TestDNS_NodeLookup_A_SuppressTXT(t *testing.T) {
|
|||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, `dns_config = { enable_additional_node_meta_txt = false } `+experimentsHCL)
|
||||
defer a.Shutdown()
|
||||
|
@ -574,6 +581,9 @@ func TestDNS_NodeLookup_A_SuppressTXT(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): NET-7631 - Implement external CNAME references
|
||||
// Failing on "Should have the CNAME record + a few A records" comment
|
||||
// External services do not appear to be working properly here either.
|
||||
func TestDNS_NodeLookup_TTL(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
|
|
@ -461,7 +461,7 @@ func TestDNS_ServiceLookupMultiAddrNoCNAME(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
// TODO (v2-dns): NET-7640 - NS Record not populate on some invalid service / prepared query lookups.
|
||||
func TestDNS_ServiceLookup(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -657,6 +657,7 @@ func TestDNS_ServiceLookupWithInternalServiceAddress(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): NET-7659 - Fix Ingress and Connect Service Lookups
|
||||
func TestDNS_ConnectServiceLookup(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -710,6 +711,7 @@ func TestDNS_ConnectServiceLookup(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): NET-7659 - Fix Ingress and Connect Service Lookups
|
||||
func TestDNS_IngressServiceLookup(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -1128,7 +1130,7 @@ func TestDNS_ExternalServiceToConsulCNAMENestedLookup(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
// TODO (v2-dns): NET-7636 - Implement target having encoded IP address
|
||||
func TestDNS_ServiceLookup_ServiceAddress_A(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -1230,7 +1232,7 @@ func TestDNS_ServiceLookup_ServiceAddress_A(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
// TODO (v2-dns): NET-7636 - Implement target having encoded IP address
|
||||
func TestDNS_AltDomain_ServiceLookup_ServiceAddress_A(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -1461,7 +1463,7 @@ func TestDNS_ServiceLookup_ServiceAddress_SRV(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
// TODO (v2-dns): NET-7636 - Implement target having encoded IP address
|
||||
func TestDNS_ServiceLookup_ServiceAddressIPV6(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -1563,7 +1565,7 @@ func TestDNS_ServiceLookup_ServiceAddressIPV6(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
// TODO (v2-dns): NET-7636 - Implement target having encoded IP address
|
||||
func TestDNS_AltDomain_ServiceLookup_ServiceAddressIPV6(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -1672,7 +1674,7 @@ func TestDNS_AltDomain_ServiceLookup_ServiceAddressIPV6(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
// TODO (v2-dns): NET-7634 - Implement WAN translation
|
||||
func TestDNS_ServiceLookup_WanTranslation(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -1889,8 +1891,7 @@ func TestDNS_ServiceLookup_WanTranslation(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
func TestDNS_CaseInsensitiveServiceLookup(t *testing.T) {
|
||||
func TestDNS_ServiceLookup_CaseInsensitive(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
@ -1992,7 +1993,7 @@ func TestDNS_CaseInsensitiveServiceLookup(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this returns a response where the answer is an SOA record
|
||||
// TODO (v2-dns): NET-7632 - Fix node and prepared query lookups when question name has a period in it
|
||||
func TestDNS_ServiceLookup_TagPeriod(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2073,7 +2074,7 @@ func TestDNS_ServiceLookup_TagPeriod(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this returns a response where the answer is an SOA record
|
||||
// TODO (v2-dns): NET-7632 - Fix node and prepared query lookups when question name has a period in it.
|
||||
func TestDNS_ServiceLookup_PreparedQueryNamePeriod(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2273,7 +2274,7 @@ func TestDNS_ServiceLookup_Dedup(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
// TODO (v2-dns): NET-7641 - Service lookups not properly de-duping SRV records
|
||||
func TestDNS_ServiceLookup_Dedup_SRV(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2413,6 +2414,7 @@ func TestDNS_ServiceLookup_Dedup_SRV(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): NET-7637 - implementing health filtering
|
||||
func TestDNS_ServiceLookup_FilterCritical(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2577,6 +2579,7 @@ func TestDNS_ServiceLookup_FilterCritical(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): NET-7637 - implementing health filtering
|
||||
func TestDNS_ServiceLookup_OnlyFailing(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2698,6 +2701,7 @@ func TestDNS_ServiceLookup_OnlyFailing(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): NET-7637 - implementing health filtering
|
||||
func TestDNS_ServiceLookup_OnlyPassing(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2849,7 +2853,7 @@ func TestDNS_ServiceLookup_OnlyPassing(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
// TODO (v2-dns): NET-7635 - Fix dns: overflowing header size in tests
|
||||
func TestDNS_ServiceLookup_Randomize(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2949,7 +2953,7 @@ func TestDNS_ServiceLookup_Randomize(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
// TODO (v2-dns): NET-7635 - Fix dns: overflowing header size in tests
|
||||
func TestDNS_ServiceLookup_Truncate(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -3027,7 +3031,7 @@ func TestDNS_ServiceLookup_Truncate(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
// TODO (v2-dns): NET-7638 - Implemented truncated response
|
||||
func TestDNS_ServiceLookup_LargeResponses(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -3321,6 +3325,7 @@ func checkDNSService(
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): NET-7633 - implement answer limits.
|
||||
func TestDNS_ServiceLookup_ARecordLimits(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -3407,6 +3412,7 @@ func TestDNS_ServiceLookup_ARecordLimits(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): NET-7633 - implement answer limits.
|
||||
func TestDNS_ServiceLookup_AnswerLimits(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -3482,7 +3488,6 @@ func TestDNS_ServiceLookup_AnswerLimits(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
func TestDNS_ServiceLookup_CNAME(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -3497,7 +3502,7 @@ func TestDNS_ServiceLookup_CNAME(t *testing.T) {
|
|||
})
|
||||
defer recursor.Shutdown()
|
||||
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, `
|
||||
recursors = ["`+recursor.Addr+`"]
|
||||
|
@ -3588,7 +3593,6 @@ func TestDNS_ServiceLookup_CNAME(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): this requires a prepared query
|
||||
func TestDNS_ServiceLookup_ServiceAddress_CNAME(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -3603,7 +3607,7 @@ func TestDNS_ServiceLookup_ServiceAddress_CNAME(t *testing.T) {
|
|||
})
|
||||
defer recursor.Shutdown()
|
||||
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, `
|
||||
recursors = ["`+recursor.Addr+`"]
|
||||
|
@ -4010,7 +4014,7 @@ func TestDNS_ServiceLookup_FilterACL(t *testing.T) {
|
|||
}
|
||||
`
|
||||
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, hcl+experimentsHCL)
|
||||
defer a.Shutdown()
|
||||
|
|
|
@ -128,8 +128,7 @@ func getVersionHCL(enableV2 bool) map[string]string {
|
|||
}
|
||||
|
||||
// Copied to agent/dns/recursor_test.go
|
||||
func TestRecursorAddr(t *testing.T) {
|
||||
t.Parallel()
|
||||
func TestNDS_RecursorAddr(t *testing.T) {
|
||||
addr, err := recursorAddr("8.8.8.8")
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
|
@ -154,7 +153,7 @@ func TestRecursorAddr(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestEncodeKVasRFC1464(t *testing.T) {
|
||||
func TestDNS_EncodeKVasRFC1464(t *testing.T) {
|
||||
// Test cases are from rfc1464
|
||||
type rfc1464Test struct {
|
||||
key, value, internalForm, externalForm string
|
||||
|
@ -188,8 +187,7 @@ func TestDNS_Over_TCP(t *testing.T) {
|
|||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, experimentsHCL)
|
||||
defer a.Shutdown()
|
||||
|
@ -247,7 +245,7 @@ func TestDNS_EmptyAltDomain(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestDNSCycleRecursorCheck(t *testing.T) {
|
||||
func TestDNS_CycleRecursorCheck(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
@ -290,7 +288,7 @@ func TestDNSCycleRecursorCheck(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
func TestDNSCycleRecursorCheckAllFail(t *testing.T) {
|
||||
func TestDNS_CycleRecursorCheckAllFail(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
@ -330,6 +328,7 @@ func TestDNSCycleRecursorCheckAllFail(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(v2-dns): NET-7643 - Implement EDNS0 records when queried
|
||||
func TestDNS_EDNS0(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -378,6 +377,7 @@ func TestDNS_EDNS0(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(v2-dns): NET-7643 - Implement EDNS0 records when queried
|
||||
func TestDNS_EDNS0_ECS(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -623,6 +623,7 @@ func TestDNS_ReverseLookup_IPV6(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(v2-dns): NET-7640 - NS Record not populate on some invalid service / prepared query lookups
|
||||
func TestDNS_SOA_Settings(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -826,6 +827,9 @@ func TestDNS_InifiniteRecursion(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: NET-7640 - NS Record not populate on some invalid service / prepared query lookups
|
||||
// this is actually an I/O timeout so it might not be the same root cause listed in NET-7640
|
||||
// but going to cover investigating it there.
|
||||
func TestDNS_NSRecords(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -869,6 +873,7 @@ func TestDNS_NSRecords(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: NET-7640 - NS Record not populate on some invalid service / prepared query lookups
|
||||
func TestDNS_AltDomain_NSRecords(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -925,6 +930,7 @@ func TestDNS_AltDomain_NSRecords(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: NET-7640 - NS Record not populate on some invalid service / prepared query lookups
|
||||
func TestDNS_NSRecords_IPV6(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -969,6 +975,7 @@ func TestDNS_NSRecords_IPV6(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: NET-7640 - NS Record not populate on some invalid service / prepared query lookups
|
||||
func TestDNS_AltDomain_NSRecords_IPV6(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -1025,6 +1032,7 @@ func TestDNS_AltDomain_NSRecords_IPV6(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO NET-7644 - Implement service and prepared query lookup for tagged addresses
|
||||
func TestDNS_Lookup_TaggedIPAddresses(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -1622,8 +1630,8 @@ func TestDNS_RecursorTimeout(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestBinarySearch(t *testing.T) {
|
||||
t.Parallel()
|
||||
// TODO(v2-dns): NET-7646 - account for this functionality since there is
|
||||
func TestDNS_BinarySearch(t *testing.T) {
|
||||
msgSrc := new(dns.Msg)
|
||||
msgSrc.Compress = true
|
||||
msgSrc.SetQuestion("redis.service.consul.", dns.TypeSRV)
|
||||
|
@ -1663,6 +1671,7 @@ func TestBinarySearch(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(v2-dns): NET-7635 - Fix dns: overflowing header size or IO timeouts
|
||||
func TestDNS_TCP_and_UDP_Truncate(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2002,6 +2011,7 @@ func TestDNS_NonExistentDC_Server(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(v2-dns): NET-7647 - Fix non-existent dc tests
|
||||
// TestDNS_NonExistentDC_RPC verifies NXDOMAIN is returned when
|
||||
// Consul server agent is queried over RPC by a non-server agent
|
||||
// for a service in a non-existent domain
|
||||
|
@ -2047,6 +2057,7 @@ func TestDNS_NonExistentDC_RPC(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(v2-dns): NET-7647 - Fix non-existent dc tests
|
||||
func TestDNS_NonExistingLookup(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2084,6 +2095,7 @@ func TestDNS_NonExistingLookup(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(v2-dns): NET-7647 - Fix non-existent dc tests
|
||||
func TestDNS_NonExistingLookupEmptyAorAAAA(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2231,8 +2243,7 @@ func TestDNS_AltDomains_Service(t *testing.T) {
|
|||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, `
|
||||
alt_domain = "test-domain."
|
||||
|
@ -2325,6 +2336,7 @@ func TestDNS_AltDomains_Service(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(v2-dns): NET-7640 - NS or SOA Records not populate on some invalid service / prepared query lookups
|
||||
func TestDNS_AltDomains_SOA(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2386,8 +2398,7 @@ func TestDNS_AltDomains_Overlap(t *testing.T) {
|
|||
// this tests the domain matching logic in DNSServer when encountering more
|
||||
// than one potential match (i.e. ambiguous match)
|
||||
// it should select the longer matching domain when dispatching
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, `
|
||||
node_name = "test-node"
|
||||
|
@ -2437,8 +2448,7 @@ func TestDNS_AltDomain_DCName_Overlap(t *testing.T) {
|
|||
|
||||
// this tests the DC name overlap with the consul domain/alt-domain
|
||||
// we should get response when DC suffix is a prefix of consul alt-domain
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, `
|
||||
datacenter = "dc-test"
|
||||
|
@ -2478,8 +2488,7 @@ func TestDNS_PreparedQuery_AllowStale(t *testing.T) {
|
|||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, `
|
||||
dns_config {
|
||||
|
@ -2530,6 +2539,7 @@ func TestDNS_PreparedQuery_AllowStale(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO (v2-dns): NET-7640 - NS or SOA Records not populate on some invalid service / prepared query lookups
|
||||
func TestDNS_InvalidQueries(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2579,6 +2589,7 @@ func TestDNS_InvalidQueries(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(v2-dns): NET-7648 - Prepared Query - inject agent source and dc to RPC
|
||||
func TestDNS_PreparedQuery_AgentSource(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2620,6 +2631,7 @@ func TestDNS_PreparedQuery_AgentSource(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(v2-dns): NET-7648 - Prepared Query - inject agent source and dc to RPC
|
||||
func TestDNS_EDNS_Truncate_AgentSource(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("too slow for testing.Short")
|
||||
|
@ -2670,8 +2682,7 @@ func TestDNS_EDNS_Truncate_AgentSource(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDNS_trimUDPResponse_NoTrim(t *testing.T) {
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
|
||||
req := &dns.Msg{}
|
||||
|
@ -2733,8 +2744,7 @@ func TestDNS_trimUDPResponse_NoTrim(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDNS_trimUDPResponse_TrimLimit(t *testing.T) {
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
cfg := loadRuntimeConfig(t, `node_name = "test" data_dir = "a" bind_addr = "127.0.0.1" node_name = "dummy" `+experimentsHCL)
|
||||
|
||||
|
@ -2777,8 +2787,7 @@ func TestDNS_trimUDPResponse_TrimLimit(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDNS_trimUDPResponse_TrimLimitWithNS(t *testing.T) {
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
cfg := loadRuntimeConfig(t, `node_name = "test" data_dir = "a" bind_addr = "127.0.0.1" node_name = "dummy" `+experimentsHCL)
|
||||
|
||||
|
@ -2829,8 +2838,7 @@ func TestDNS_trimUDPResponse_TrimLimitWithNS(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDNS_trimTCPResponse_TrimLimitWithNS(t *testing.T) {
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
cfg := loadRuntimeConfig(t, `node_name = "test" data_dir = "a" bind_addr = "127.0.0.1" node_name = "dummy" `+experimentsHCL)
|
||||
|
||||
|
@ -2890,8 +2898,7 @@ func loadRuntimeConfig(t *testing.T, hcl string) *config.RuntimeConfig {
|
|||
}
|
||||
|
||||
func TestDNS_trimUDPResponse_TrimSize(t *testing.T) {
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
cfg := loadRuntimeConfig(t, `node_name = "test" data_dir = "a" bind_addr = "127.0.0.1" node_name = "dummy" `+experimentsHCL)
|
||||
|
||||
|
@ -2947,8 +2954,7 @@ func TestDNS_trimUDPResponse_TrimSize(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDNS_trimUDPResponse_TrimSizeEDNS(t *testing.T) {
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
|
||||
cfg := loadRuntimeConfig(t, `node_name = "test" data_dir = "a" bind_addr = "127.0.0.1" node_name = "dummy" `+experimentsHCL)
|
||||
|
@ -3031,8 +3037,7 @@ func TestDNS_trimUDPResponse_TrimSizeEDNS(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDNS_trimUDPResponse_TrimSizeMaxSize(t *testing.T) {
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
|
||||
cfg := loadRuntimeConfig(t, `node_name = "test" data_dir = "a" bind_addr = "127.0.0.1" node_name = "dummy" `+experimentsHCL)
|
||||
|
@ -3083,6 +3088,7 @@ func TestDNS_trimUDPResponse_TrimSizeMaxSize(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO(v2-dns): NET-7649 - Implement sync extra
|
||||
func TestDNS_syncExtra(t *testing.T) {
|
||||
t.Parallel()
|
||||
resp := &dns.Msg{
|
||||
|
@ -3308,8 +3314,7 @@ func TestDNS_syncExtra(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestDNS_Compression_trimUDPResponse(t *testing.T) {
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
|
||||
cfg := loadRuntimeConfig(t, `data_dir = "a" bind_addr = "127.0.0.1" node_name = "dummy" `+experimentsHCL)
|
||||
|
@ -3336,8 +3341,7 @@ func TestDNS_Compression_Query(t *testing.T) {
|
|||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
|
||||
a := NewTestAgent(t, experimentsHCL)
|
||||
|
@ -3669,8 +3673,7 @@ func TestDNS_ReloadConfig_DuringQuery(t *testing.T) {
|
|||
t.Skip("too slow for testing.Short")
|
||||
}
|
||||
|
||||
t.Parallel()
|
||||
for name, experimentsHCL := range getVersionHCL(false) {
|
||||
for name, experimentsHCL := range getVersionHCL(true) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
a := NewTestAgent(t, experimentsHCL)
|
||||
defer a.Shutdown()
|
||||
|
@ -3736,7 +3739,7 @@ func TestDNS_ReloadConfig_DuringQuery(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestECSNotGlobalError(t *testing.T) {
|
||||
func TestDNS_ECSNotGlobalError(t *testing.T) {
|
||||
t.Run("wrap nil", func(t *testing.T) {
|
||||
e := ecsNotGlobalError{}
|
||||
require.True(t, errors.Is(e, errECSNotGlobal))
|
||||
|
@ -3768,7 +3771,7 @@ func perfectlyRandomChoices(size int, frac float64) []bool {
|
|||
return out
|
||||
}
|
||||
|
||||
func TestPerfectlyRandomChoices(t *testing.T) {
|
||||
func TestDNS_PerfectlyRandomChoices(t *testing.T) {
|
||||
count := func(got []bool) int {
|
||||
var x int
|
||||
for _, v := range got {
|
||||
|
@ -3830,7 +3833,7 @@ type testCaseParseLocality struct {
|
|||
expectedOK bool
|
||||
}
|
||||
|
||||
func Test_ParseLocality(t *testing.T) {
|
||||
func TestDNS_ParseLocality(t *testing.T) {
|
||||
testCases := getTestCasesParseLocality()
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
|
@ -3848,7 +3851,7 @@ func Test_ParseLocality(t *testing.T) {
|
|||
|
||||
}
|
||||
|
||||
func Test_EffectiveDatacenter(t *testing.T) {
|
||||
func TestDNS_EffectiveDatacenter(t *testing.T) {
|
||||
type testCase struct {
|
||||
name string
|
||||
queryLocality queryLocality
|
||||
|
|
Loading…
Reference in New Issue