summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2020-07-06 20:14:21 -0700
committerBob Halley <halley@dnspython.org>2020-07-06 20:14:21 -0700
commit72d3987c86ec143f4c5f38ca4c865c35bbc44b41 (patch)
treef9fa3c94a3ce0c8b21448cf2c7b01e3c83895087
parent8b9f344a97be43eb449ba68659be1dda2d8da61c (diff)
downloaddnspython-72d3987c86ec143f4c5f38ca4c865c35bbc44b41.tar.gz
Give up on socket.getfqdn() testing with CDN-hosted resources as it has too much magic.
-rw-r--r--tests/test_resolver_override.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/test_resolver_override.py b/tests/test_resolver_override.py
index 5f93281..73484f6 100644
--- a/tests/test_resolver_override.py
+++ b/tests/test_resolver_override.py
@@ -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')