Skip to content

Commit 64e24c9

Browse files
authored
PYTHON-5327 Add test for SRV hostname validation (#2863)
1 parent f9c029e commit 64e24c9

4 files changed

Lines changed: 18 additions & 2 deletions

File tree

test/asynchronous/test_dns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ async def test_4_throw_when_return_address_does_not_contain_dot_separating_share
293293
]
294294
await self.run_initial_dns_seedlist_discovery_prose_tests(test_cases)
295295

296-
async def test_5_when_srv_hostname_has_two_dot_separated_parts_it_is_valid_for_the_returned_hostname_to_be_identical(
296+
async def test_5_when_srv_hostname_has_three_or_more_dot_separated_parts_it_is_valid_for_the_returned_hostname_to_be_identical(
297297
self,
298298
):
299299
test_cases = [
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"uri": "mongodb+srv://test.build.10gen.cc/",
3+
"seeds": [
4+
"test.build.10gen.cc:27017"
5+
],
6+
"ping": false,
7+
"comment": "Should not throw when SRV hostname and resolved hostname are identical and SRV hostname has four dot-separated parts."
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"uri": "mongodb+srv://build.10gen.cc/",
3+
"seeds": [
4+
"build.10gen.cc:27017"
5+
],
6+
"ping": false,
7+
"comment": "Should not throw when SRV hostname and resolved hostname are identical and SRV hostname has three dot-separated parts."
8+
}

test/test_dns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def test_4_throw_when_return_address_does_not_contain_dot_separating_shared_part
291291
]
292292
self.run_initial_dns_seedlist_discovery_prose_tests(test_cases)
293293

294-
def test_5_when_srv_hostname_has_two_dot_separated_parts_it_is_valid_for_the_returned_hostname_to_be_identical(
294+
def test_5_when_srv_hostname_has_three_or_more_dot_separated_parts_it_is_valid_for_the_returned_hostname_to_be_identical(
295295
self,
296296
):
297297
test_cases = [

0 commit comments

Comments
 (0)