From 922f6194137e0fcd92114c52772e94edff4963d1 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Wed, 21 Aug 2024 10:04:03 +0200 Subject: [PATCH] test: Use crc.dev records for DNS tests test/basic_test.go has some DNS resolution tests for various types of DNS records. These tests use wikipedia.org or google.com, which means they have to be updated once in a while when the admins of these sites decide to change these records. Lately this has happened a few times with wikipedia SRV and MX record. This commit switches to crc.dev for these tests, as it's a domain we control, and thus we have more control over DNS record changes. Signed-off-by: Christophe Fergeau --- test/basic_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/basic_test.go b/test/basic_test.go index a3db89e7e..4b9d354c3 100644 --- a/test/basic_test.go +++ b/test/basic_test.go @@ -53,15 +53,15 @@ var _ = ginkgo.Describe("dns", func() { gomega.Expect(string(out)).To(gomega.ContainSubstring("Address: 52.200.142.250")) }) - ginkgo.It("should resolve CNAME record for www.wikipedia.org", func() { - out, err := sshExec("nslookup -query=cname www.wikipedia.org") + ginkgo.It("should resolve CNAME record for docs.crc.dev", func() { + out, err := sshExec("nslookup -query=cname docs.crc.dev") gomega.Expect(err).ShouldNot(gomega.HaveOccurred()) - gomega.Expect(string(out)).To(gomega.ContainSubstring("www.wikipedia.org canonical name = dyna.wikimedia.org.")) + gomega.Expect(string(out)).To(gomega.ContainSubstring("docs.crc.dev canonical name = webredir.gandi.net.")) }) - ginkgo.It("should resolve MX record for wikipedia.org", func() { - out, err := sshExec("nslookup -query=mx wikipedia.org") + ginkgo.It("should resolve MX record for crc.dev", func() { + out, err := sshExec("nslookup -query=mx crc.dev") gomega.Expect(err).ShouldNot(gomega.HaveOccurred()) - gomega.Expect(string(out)).To(gomega.ContainSubstring("wikipedia.org mail exchanger = 10 mx1001.wikimedia.org.")) + gomega.Expect(string(out)).To(gomega.ContainSubstring("crc.dev mail exchanger = 10 spool.mail.gandi.net.")) }) ginkgo.It("should resolve NS record for wikipedia.org", func() { @@ -69,10 +69,10 @@ var _ = ginkgo.Describe("dns", func() { gomega.Expect(err).ShouldNot(gomega.HaveOccurred()) gomega.Expect(string(out)).To(gomega.ContainSubstring("wikipedia.org nameserver = ns0.wikimedia.org.")) }) - ginkgo.It("should resolve LDAP SRV record for google.com", func() { - out, err := sshExec("nslookup -query=srv _ldap._tcp.google.com 8.8.8.8") + ginkgo.It("should resolve IMAPS SRV record for crc.dev", func() { + out, err := sshExec("nslookup -query=srv _imaps._tcp.crc.dev") gomega.Expect(err).ShouldNot(gomega.HaveOccurred()) - gomega.Expect(string(out)).To(gomega.ContainSubstring(`_ldap._tcp.google.com service = 5 0 389 ldap.google.com.`)) + gomega.Expect(string(out)).To(gomega.ContainSubstring(`_imaps._tcp.crc.dev service = 0 1 993 mail.gandi.net.`)) }) ginkgo.It("should resolve TXT for crc.dev", func() { out, err := sshExec("nslookup -query=txt crc.dev")