From 3d1c769f0ca6835e8c291fac738a6817895f0309 Mon Sep 17 00:00:00 2001 From: Jeffrey 'Alex' Clark Date: Wed, 27 May 2026 16:31:45 -0400 Subject: [PATCH] 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 = [