]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Give up on socket.getfqdn() testing with CDN-hosted resources as it has too much...
authorBob Halley <halley@dnspython.org>
Tue, 7 Jul 2020 03:14:21 +0000 (20:14 -0700)
committerBob Halley <halley@dnspython.org>
Tue, 7 Jul 2020 03:14:21 +0000 (20:14 -0700)
tests/test_resolver_override.py

index 5f93281e378236d6aae495681f31e48fb5758612..73484f66ab42dac037a1b2e8a0ef3330418fa4d3 100644 (file)
@@ -118,13 +118,22 @@ class OverrideSystemResolverTestCase(unittest.TestCase):
         except socket.gaierror as e:
             self.assertEqual(e.errno, socket.EAI_NONAME)
 
-    def test_getfqdn(self):
-        b = socket.getfqdn('www.dnspython.org')
-        # we do this now because python's original getfqdn calls
-        # gethostbyaddr() and we don't want it to call us!
-        dns.resolver.restore_system_resolver()
-        a = dns.resolver._original_getfqdn('www.dnspython.org')
-        self.assertEqual(dns.name.from_text(a), dns.name.from_text(b))
+# Give up on testing this for now as all of the names I've considered
+# using for testing are part of CDNs and there is deep magic in
+# gethostbyaddr() that python's getfqdn() is using.  At any rate,
+# the problem is that dnspython just gives up whereas the native python
+# code is looking up www.dnspython.org, picking a CDN IPv4 address
+# (sometimes) and returning the reverse lookup of that address (i.e.
+# the domain name of the CDN server).  This isn't what I'd consider the
+# FQDN of www.dnspython.org to be!
+#
+#    def test_getfqdn(self):
+#        b = socket.getfqdn('www.dnspython.org')
+#        # we do this now because python's original getfqdn calls
+#        # gethostbyaddr() and we don't want it to call us!
+#        dns.resolver.restore_system_resolver()
+#        a = dns.resolver._original_getfqdn('www.dnspython.org')
+#        self.assertEqual(dns.name.from_text(a), dns.name.from_text(b))
 
     def test_gethostbyaddr(self):
         a = dns.resolver._original_gethostbyaddr('8.8.8.8')