mirror of https://github.com/golang/go.git
[release-branch.go1.18] net: reenable SRV tests with _ldap._tcp.google.com
TestLookupDotsWithRemoteSource and TestLookupGoogleSRV were disabled because they look up the no-longer-present SRV record for _xmpp-server._tcp.google.com. Change the tests to look for _ldap._tcp.google.com and reenable them. For #56708. Fixes #56711. Change-Id: I26475fa3ff6fc008048a4e5f24f0e96ee12f655c Reviewed-on: https://go-review.googlesource.com/c/go/+/453861 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit cb42bbddeb80ff08599079ee6b94088e5be88e5b) Reviewed-on: https://go-review.googlesource.com/c/go/+/454295 Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Jenny Rakoczy <jenny@golang.org>
This commit is contained in:
parent
0b12684a4a
commit
11f8a85e7e
|
|
@ -49,21 +49,21 @@ var lookupGoogleSRVTests = []struct {
|
|||
cname, target string
|
||||
}{
|
||||
{
|
||||
"xmpp-server", "tcp", "google.com",
|
||||
"ldap", "tcp", "google.com",
|
||||
"google.com.", "google.com.",
|
||||
},
|
||||
{
|
||||
"xmpp-server", "tcp", "google.com.",
|
||||
"ldap", "tcp", "google.com.",
|
||||
"google.com.", "google.com.",
|
||||
},
|
||||
|
||||
// non-standard back door
|
||||
{
|
||||
"", "", "_xmpp-server._tcp.google.com",
|
||||
"", "", "_ldap._tcp.google.com",
|
||||
"google.com.", "google.com.",
|
||||
},
|
||||
{
|
||||
"", "", "_xmpp-server._tcp.google.com.",
|
||||
"", "", "_ldap._tcp.google.com.",
|
||||
"google.com.", "google.com.",
|
||||
},
|
||||
}
|
||||
|
|
@ -71,10 +71,6 @@ var lookupGoogleSRVTests = []struct {
|
|||
var backoffDuration = [...]time.Duration{time.Second, 5 * time.Second, 30 * time.Second}
|
||||
|
||||
func TestLookupGoogleSRV(t *testing.T) {
|
||||
// TODO(mknyszek): Figure out next steps for this test. This is just
|
||||
// a quick fix.
|
||||
t.Skip("fails consistently due to an upstream DNS change; see #56707.")
|
||||
|
||||
t.Parallel()
|
||||
mustHaveExternalNetwork(t)
|
||||
|
||||
|
|
@ -635,10 +631,6 @@ func TestLookupDotsWithLocalSource(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestLookupDotsWithRemoteSource(t *testing.T) {
|
||||
// TODO(mknyszek): Figure out next steps for this test. This is just
|
||||
// a quick fix.
|
||||
t.Skip("fails consistently due to an upstream DNS change; see #56707.")
|
||||
|
||||
if runtime.GOOS == "darwin" || runtime.GOOS == "ios" {
|
||||
testenv.SkipFlaky(t, 27992)
|
||||
}
|
||||
|
|
@ -709,16 +701,16 @@ func testDots(t *testing.T, mode string) {
|
|||
}
|
||||
}
|
||||
|
||||
cname, srvs, err := LookupSRV("xmpp-server", "tcp", "google.com")
|
||||
cname, srvs, err := LookupSRV("ldap", "tcp", "google.com")
|
||||
if err != nil {
|
||||
t.Errorf("LookupSRV(xmpp-server, tcp, google.com): %v (mode=%v)", err, mode)
|
||||
t.Errorf("LookupSRV(ldap, tcp, google.com): %v (mode=%v)", err, mode)
|
||||
} else {
|
||||
if !hasSuffixFold(cname, ".google.com.") {
|
||||
t.Errorf("LookupSRV(xmpp-server, tcp, google.com) returned cname=%v, want name ending in .google.com. with trailing dot (mode=%v)", cname, mode)
|
||||
t.Errorf("LookupSRV(ldap, tcp, google.com) returned cname=%v, want name ending in .google.com. with trailing dot (mode=%v)", cname, mode)
|
||||
}
|
||||
for _, srv := range srvs {
|
||||
if !hasSuffixFold(srv.Target, ".google.com.") {
|
||||
t.Errorf("LookupSRV(xmpp-server, tcp, google.com) returned addrs=%v, want names ending in .google.com. with trailing dot (mode=%v)", srvString(srvs), mode)
|
||||
t.Errorf("LookupSRV(ldap, tcp, google.com) returned addrs=%v, want names ending in .google.com. with trailing dot (mode=%v)", srvString(srvs), mode)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue