Skip to content

Commit 970e2c3

Browse files
authored
test(NODE-3710): sync max srv hosts tests (#3015)
1 parent 01d5aa0 commit 970e2c3

File tree

115 files changed

+849
-137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+849
-137
lines changed

test/spec/initial-dns-seedlist-discovery/README.rst

+78-46

test/spec/initial-dns-seedlist-discovery/dbname-with-commas.json

-19
This file was deleted.

test/spec/initial-dns-seedlist-discovery/dbname-with-commas.yml

-13
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"uri": "mongodb+srv://test20.test.build.10gen.cc/?directConnection=false",
3+
"seeds": [
4+
"localhost.test.build.10gen.cc:27017"
5+
],
6+
"hosts": [
7+
"localhost.test.build.10gen.cc:27017"
8+
],
9+
"options": {
10+
"loadBalanced": true,
11+
"ssl": true,
12+
"directConnection": false
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# The TXT record for test20.test.build.10gen.cc contains loadBalanced=true.
2+
# DRIVERS-1721 introduced this test as passing.
3+
uri: "mongodb+srv://test20.test.build.10gen.cc/?directConnection=false"
4+
seeds:
5+
- localhost.test.build.10gen.cc:27017
6+
hosts:
7+
# In LB mode, the driver does not do server discovery, so the hostname does
8+
# not get resolved to localhost:27017.
9+
- localhost.test.build.10gen.cc:27017
10+
options:
11+
loadBalanced: true
12+
ssl: true
13+
directConnection: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"uri": "mongodb+srv://test4.test.build.10gen.cc/?loadBalanced=true",
3+
"seeds": [],
4+
"hosts": [],
5+
"error": true,
6+
"comment": "Should fail because no SRV records are present for this URI."
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
uri: "mongodb+srv://test4.test.build.10gen.cc/?loadBalanced=true"
2+
seeds: []
3+
hosts: []
4+
error: true
5+
comment: Should fail because no SRV records are present for this URI.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"uri": "mongodb+srv://test20.test.build.10gen.cc/?srvMaxHosts=1",
3+
"seeds": [],
4+
"hosts": [],
5+
"error": true,
6+
"comment": "Should fail because positive integer for srvMaxHosts conflicts with loadBalanced=true (TXT)"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
uri: "mongodb+srv://test20.test.build.10gen.cc/?srvMaxHosts=1"
2+
seeds: []
3+
hosts: []
4+
error: true
5+
comment: Should fail because positive integer for srvMaxHosts conflicts with loadBalanced=true (TXT)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"uri": "mongodb+srv://test3.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=1",
3+
"seeds": [],
4+
"hosts": [],
5+
"error": true,
6+
"comment": "Should fail because positive integer for srvMaxHosts conflicts with loadBalanced=true"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
uri: "mongodb+srv://test3.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=1"
2+
seeds: []
3+
hosts: []
4+
error: true
5+
comment: Should fail because positive integer for srvMaxHosts conflicts with loadBalanced=true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"uri": "mongodb+srv://test20.test.build.10gen.cc/?srvMaxHosts=0",
3+
"seeds": [
4+
"localhost.test.build.10gen.cc:27017"
5+
],
6+
"hosts": [
7+
"localhost.test.build.10gen.cc:27017"
8+
],
9+
"options": {
10+
"loadBalanced": true,
11+
"srvMaxHosts": 0,
12+
"ssl": true
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# loadBalanced=true (TXT) is permitted because srvMaxHosts is non-positive
2+
uri: "mongodb+srv://test20.test.build.10gen.cc/?srvMaxHosts=0"
3+
seeds:
4+
- localhost.test.build.10gen.cc:27017
5+
hosts:
6+
- localhost.test.build.10gen.cc:27017
7+
options:
8+
loadBalanced: true
9+
srvMaxHosts: 0
10+
ssl: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"uri": "mongodb+srv://test3.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=0",
3+
"seeds": [
4+
"localhost.test.build.10gen.cc:27017"
5+
],
6+
"hosts": [
7+
"localhost.test.build.10gen.cc:27017"
8+
],
9+
"options": {
10+
"loadBalanced": true,
11+
"srvMaxHosts": 0,
12+
"ssl": true
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# loadBalanced=true is permitted because srvMaxHosts is non-positive
2+
uri: "mongodb+srv://test3.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=0"
3+
seeds:
4+
- localhost.test.build.10gen.cc:27017
5+
hosts:
6+
- localhost.test.build.10gen.cc:27017
7+
options:
8+
loadBalanced: true
9+
srvMaxHosts: 0
10+
ssl: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"uri": "mongodb+srv://test21.test.build.10gen.cc/",
3+
"seeds": [
4+
"localhost.test.build.10gen.cc:27017"
5+
],
6+
"hosts": [
7+
"localhost:27017",
8+
"localhost:27018",
9+
"localhost:27019"
10+
],
11+
"options": {
12+
"loadBalanced": false,
13+
"ssl": true
14+
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
uri: "mongodb+srv://test21.test.build.10gen.cc/"
2+
seeds:
3+
- localhost.test.build.10gen.cc:27017
4+
hosts:
5+
- localhost:27017
6+
- localhost:27018
7+
- localhost:27019
8+
options:
9+
loadBalanced: false
10+
ssl: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"uri": "mongodb+srv://test22.test.build.10gen.cc/?srvServiceName=customname",
3+
"seeds": [
4+
"localhost.test.build.10gen.cc:27017",
5+
"localhost.test.build.10gen.cc:27018"
6+
],
7+
"hosts": [
8+
"localhost:27017",
9+
"localhost:27018",
10+
"localhost:27019"
11+
],
12+
"options": {
13+
"ssl": true,
14+
"srvServiceName": "customname"
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
uri: "mongodb+srv://test22.test.build.10gen.cc/?srvServiceName=customname"
2+
seeds:
3+
- localhost.test.build.10gen.cc:27017
4+
- localhost.test.build.10gen.cc:27018
5+
hosts:
6+
- localhost:27017
7+
- localhost:27018
8+
- localhost:27019
9+
options:
10+
ssl: true
11+
srvServiceName: "customname"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"uri": "mongodb+srv://test5.test.build.10gen.cc/?srvMaxHosts=1",
3+
"seeds": [],
4+
"hosts": [],
5+
"error": true,
6+
"comment": "Should fail because positive integer for srvMaxHosts conflicts with replicaSet option (TXT)"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
uri: "mongodb+srv://test5.test.build.10gen.cc/?srvMaxHosts=1"
2+
seeds: []
3+
hosts: []
4+
error: true
5+
comment: Should fail because positive integer for srvMaxHosts conflicts with replicaSet option (TXT)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"uri": "mongodb+srv://test1.test.build.10gen.cc/?replicaSet=repl0&srvMaxHosts=1",
3+
"seeds": [],
4+
"hosts": [],
5+
"error": true,
6+
"comment": "Should fail because positive integer for srvMaxHosts conflicts with replicaSet option"
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
uri: "mongodb+srv://test1.test.build.10gen.cc/?replicaSet=repl0&srvMaxHosts=1"
2+
seeds: []
3+
hosts: []
4+
error: true
5+
comment: Should fail because positive integer for srvMaxHosts conflicts with replicaSet option

0 commit comments

Comments
 (0)