Skip to content

Commit

Permalink
[release-branch.go1.19] net: reenable SRV tests with _ldap._tcp.googl…
Browse files Browse the repository at this point in the history
…e.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 #56712.

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 3b3ab61)
Reviewed-on: https://go-review.googlesource.com/c/go/+/454296
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Jenny Rakoczy <jenny@golang.org>
  • Loading branch information
neild authored and gopherbot committed Dec 9, 2022
1 parent c2a2fba commit 741e65d
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/net/lookup_test.go
Expand Up @@ -49,32 +49,28 @@ 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.",
},
}

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)

Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit 741e65d

Please sign in to comment.