From a40c9c498ee5ffcf6b9c920dac0c5a88d214218e Mon Sep 17 00:00:00 2001 From: Jeffrey 'Alex' Clark Date: Fri, 16 Oct 2026 19:46:48 -0400 Subject: [PATCH] PYTHON-5942 Remove redundant local SRV hostname validation tests --- test/asynchronous/test_dns.py | 11 ----------- .../identical-hostnames-valid-four-parts.json | 8 ++++++++ .../identical-hostnames-valid-three-parts.json | 8 ++++++++ test/test_dns.py | 11 ----------- 4 files changed, 16 insertions(+), 22 deletions(-) create mode 100644 test/srv_seedlist/replica-set/identical-hostnames-valid-four-parts.json create mode 100644 test/srv_seedlist/replica-set/identical-hostnames-valid-three-parts.json diff --git a/test/asynchronous/test_dns.py b/test/asynchronous/test_dns.py index 26398ed866..6c8e864a44 100644 --- a/test/asynchronous/test_dns.py +++ b/test/asynchronous/test_dns.py @@ -416,17 +416,6 @@ async def test_15_accept_an_underscore_in_srv_allowed_hosts_suffix(self): ) self.assertEqual(["cluster.my_domain.net"], [node[0] for node in res["nodelist"]]) - async def test_srv_hostname_with_three_or_more_parts_may_equal_the_returned_hostname( - self, - ): - test_cases = [ - { - "query": "_mongodb._tcp.blogs.mongodb.com", - "mock_target": "blogs.mongodb.com", - }, - ] - await self.run_initial_dns_seedlist_discovery_prose_tests(test_cases) - class TestPublicSuffixListParsing(unittest.TestCase): def test_1_multi_label_ordinary_rule(self): diff --git a/test/srv_seedlist/replica-set/identical-hostnames-valid-four-parts.json b/test/srv_seedlist/replica-set/identical-hostnames-valid-four-parts.json new file mode 100644 index 0000000000..b28a9276b1 --- /dev/null +++ b/test/srv_seedlist/replica-set/identical-hostnames-valid-four-parts.json @@ -0,0 +1,8 @@ +{ + "uri": "mongodb+srv://test.build.10gen.cc/", + "seeds": [ + "test.build.10gen.cc:27017" + ], + "ping": false, + "comment": "Should not throw when SRV hostname and resolved hostname are identical and SRV hostname has four dot-separated parts." +} diff --git a/test/srv_seedlist/replica-set/identical-hostnames-valid-three-parts.json b/test/srv_seedlist/replica-set/identical-hostnames-valid-three-parts.json new file mode 100644 index 0000000000..7a578ab4cc --- /dev/null +++ b/test/srv_seedlist/replica-set/identical-hostnames-valid-three-parts.json @@ -0,0 +1,8 @@ +{ + "uri": "mongodb+srv://build.10gen.cc/", + "seeds": [ + "build.10gen.cc:27017" + ], + "ping": false, + "comment": "Should not throw when SRV hostname and resolved hostname are identical and SRV hostname has three dot-separated parts." +} diff --git a/test/test_dns.py b/test/test_dns.py index 9d34455b45..bd7308c3d4 100644 --- a/test/test_dns.py +++ b/test/test_dns.py @@ -412,17 +412,6 @@ def test_15_accept_an_underscore_in_srv_allowed_hosts_suffix(self): ) self.assertEqual(["cluster.my_domain.net"], [node[0] for node in res["nodelist"]]) - def test_srv_hostname_with_three_or_more_parts_may_equal_the_returned_hostname( - self, - ): - test_cases = [ - { - "query": "_mongodb._tcp.blogs.mongodb.com", - "mock_target": "blogs.mongodb.com", - }, - ] - self.run_initial_dns_seedlist_discovery_prose_tests(test_cases) - class TestPublicSuffixListParsing(unittest.TestCase): def test_1_multi_label_ordinary_rule(self):