From dd3d20413bb7ed7e12b8b133be6b53763687a4ad Mon Sep 17 00:00:00 2001 From: Jeffrey 'Alex' Clark Date: Wed, 27 May 2026 16:31:45 -0400 Subject: [PATCH 1/2] DRIVERS-3162 Add test for SRV hostname validation - Fix test name to reflect three parts --- test/asynchronous/test_dns.py | 2 +- .../identical-hostnames-valid-three-parts.json | 8 ++++++++ test/test_dns.py | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) 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 5666612218..11ea4bf2f3 100644 --- a/test/asynchronous/test_dns.py +++ b/test/asynchronous/test_dns.py @@ -292,7 +292,7 @@ async def test_4_throw_when_return_address_does_not_contain_dot_separating_share ] await self.run_initial_dns_seedlist_discovery_prose_tests(test_cases) - async def test_5_when_srv_hostname_has_two_dot_separated_parts_it_is_valid_for_the_returned_hostname_to_be_identical( + async def test_5_when_srv_hostname_has_three_or_more_dot_separated_parts_it_is_valid_for_the_returned_hostname_to_be_identical( self ): test_cases = [ 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 8f88562e3f..d68f13fcb3 100644 --- a/test/test_dns.py +++ b/test/test_dns.py @@ -290,7 +290,7 @@ def test_4_throw_when_return_address_does_not_contain_dot_separating_shared_part ] self.run_initial_dns_seedlist_discovery_prose_tests(test_cases) - def test_5_when_srv_hostname_has_two_dot_separated_parts_it_is_valid_for_the_returned_hostname_to_be_identical( + def test_5_when_srv_hostname_has_three_or_more_dot_separated_parts_it_is_valid_for_the_returned_hostname_to_be_identical( self ): test_cases = [ From ad622792d55e2e8863dee69354fba7c4bdf1542e Mon Sep 17 00:00:00 2001 From: Jeffrey 'Alex' Clark Date: Tue, 2 Jun 2026 12:12:39 -0400 Subject: [PATCH 2/2] DRIVERS-3162 Add spec test for SRV hostname with four dot-separated parts --- .../replica-set/identical-hostnames-valid-four-parts.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/srv_seedlist/replica-set/identical-hostnames-valid-four-parts.json 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." +}