Skip to content

Commit b2e35cb

Browse files
DRIVERS-2234 Run a ping after initializing a MongoClient in DNS seedlist tests. (#1173)
Co-authored-by: Kevin Albertson <[email protected]>
1 parent 5174162 commit b2e35cb

File tree

55 files changed

+135
-48
lines changed

Some content is hidden

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

55 files changed

+135
-48
lines changed

source/initial-dns-seedlist-discovery/tests/README.rst

Lines changed: 44 additions & 24 deletions

source/initial-dns-seedlist-discovery/tests/load-balanced/loadBalanced-directConnection.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
"loadBalanced": true,
1111
"ssl": true,
1212
"directConnection": false
13-
}
13+
},
14+
"ping": true
1415
}

source/initial-dns-seedlist-discovery/tests/load-balanced/loadBalanced-directConnection.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ options:
1111
loadBalanced: true
1212
ssl: true
1313
directConnection: false
14+
ping: true

source/initial-dns-seedlist-discovery/tests/load-balanced/loadBalanced-true-txt.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
"options": {
1010
"loadBalanced": true,
1111
"ssl": true
12-
}
12+
},
13+
"ping": true
1314
}

source/initial-dns-seedlist-discovery/tests/load-balanced/loadBalanced-true-txt.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ hosts:
88
options:
99
loadBalanced: true
1010
ssl: true
11+
ping: true

source/initial-dns-seedlist-discovery/tests/load-balanced/srvMaxHosts-zero-txt.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
"loadBalanced": true,
1111
"srvMaxHosts": 0,
1212
"ssl": true
13-
}
13+
},
14+
"ping": true
1415
}

source/initial-dns-seedlist-discovery/tests/load-balanced/srvMaxHosts-zero-txt.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ options:
88
loadBalanced: true
99
srvMaxHosts: 0
1010
ssl: true
11+
ping: true

source/initial-dns-seedlist-discovery/tests/load-balanced/srvMaxHosts-zero.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
"loadBalanced": true,
1111
"srvMaxHosts": 0,
1212
"ssl": true
13-
}
13+
},
14+
"ping": true
1415
}

source/initial-dns-seedlist-discovery/tests/load-balanced/srvMaxHosts-zero.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ options:
88
loadBalanced: true
99
srvMaxHosts: 0
1010
ssl: true
11+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/direct-connection-false.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"options": {
1212
"ssl": true,
1313
"directConnection": false
14-
}
14+
},
15+
"ping": true
1516
}

source/initial-dns-seedlist-discovery/tests/replica-set/direct-connection-false.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ hosts:
88
options:
99
ssl: true
1010
directConnection: false
11+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/encoded-userinfo-and-db.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
"password": "$4to@L8=MC",
1818
"db": "mydb?"
1919
},
20+
"ping": false,
2021
"comment": "Encoded user, pass, and DB parse correctly"
2122
}

source/initial-dns-seedlist-discovery/tests/replica-set/encoded-userinfo-and-db.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ parsed_options:
1212
user: "b*b@f3tt="
1313
password: "$4to@L8=MC"
1414
db: "mydb?"
15+
# Don't run a ping for URIs that include userinfo. Ping doesn't require authentication, so missing
16+
# userinfo isn't a problem, but some drivers will fail handshake on a connection if userinfo is
17+
# provided but incorrect.
18+
ping: false
1519
comment: Encoded user, pass, and DB parse correctly

source/initial-dns-seedlist-discovery/tests/replica-set/loadBalanced-false-txt.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"options": {
1212
"loadBalanced": false,
1313
"ssl": true
14-
}
14+
},
15+
"ping": true
1516
}

source/initial-dns-seedlist-discovery/tests/replica-set/loadBalanced-false-txt.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ hosts:
88
options:
99
loadBalanced: false
1010
ssl: true
11+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/longer-parent-in-return.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"replicaSet": "repl0",
1313
"ssl": true
1414
},
15+
"ping": true,
1516
"comment": "Is correct, as returned host name shared the URI root \"test.build.10gen.cc\"."
1617
}

source/initial-dns-seedlist-discovery/tests/replica-set/longer-parent-in-return.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ hosts:
88
options:
99
replicaSet: repl0
1010
ssl: true
11+
ping: true
1112
comment: Is correct, as returned host name shared the URI root "test.build.10gen.cc".

source/initial-dns-seedlist-discovery/tests/replica-set/one-result-default-port.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"options": {
1212
"replicaSet": "repl0",
1313
"ssl": true
14-
}
14+
},
15+
"ping": true
1516
}

source/initial-dns-seedlist-discovery/tests/replica-set/one-result-default-port.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ hosts:
88
options:
99
replicaSet: repl0
1010
ssl: true
11+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/one-txt-record-multiple-strings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"options": {
1212
"replicaSet": "repl0",
1313
"ssl": true
14-
}
14+
},
15+
"ping": true
1516
}

source/initial-dns-seedlist-discovery/tests/replica-set/one-txt-record-multiple-strings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ hosts:
88
options:
99
replicaSet: repl0
1010
ssl: true
11+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/one-txt-record.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"replicaSet": "repl0",
1313
"authSource": "thisDB",
1414
"ssl": true
15-
}
15+
},
16+
"ping": true
1617
}

source/initial-dns-seedlist-discovery/tests/replica-set/one-txt-record.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ options:
99
replicaSet: repl0
1010
authSource: thisDB
1111
ssl: true
12+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/srv-service-name.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"options": {
1313
"ssl": true,
1414
"srvServiceName": "customname"
15-
}
15+
},
16+
"ping": true
1617
}

source/initial-dns-seedlist-discovery/tests/replica-set/srv-service-name.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ hosts:
99
options:
1010
ssl: true
1111
srvServiceName: "customname"
12+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/srvMaxHosts-equal_to_srv_records.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"options": {
1414
"srvMaxHosts": 2,
1515
"ssl": true
16-
}
16+
},
17+
"ping": true
1718
}

source/initial-dns-seedlist-discovery/tests/replica-set/srvMaxHosts-equal_to_srv_records.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ hosts:
1414
options:
1515
srvMaxHosts: 2
1616
ssl: true
17+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/srvMaxHosts-greater_than_srv_records.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"options": {
1313
"srvMaxHosts": 3,
1414
"ssl": true
15-
}
15+
},
16+
"ping": true
1617
}

source/initial-dns-seedlist-discovery/tests/replica-set/srvMaxHosts-greater_than_srv_records.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ hosts:
1313
options:
1414
srvMaxHosts: 3
1515
ssl: true
16+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/srvMaxHosts-less_than_srv_records.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
"options": {
1010
"srvMaxHosts": 1,
1111
"ssl": true
12-
}
12+
},
13+
"ping": true
1314
}

source/initial-dns-seedlist-discovery/tests/replica-set/srvMaxHosts-less_than_srv_records.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ hosts:
1313
options:
1414
srvMaxHosts: 1
1515
ssl: true
16+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/srvMaxHosts-zero-txt.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"replicaSet": "repl0",
1414
"srvMaxHosts": 0,
1515
"ssl": true
16-
}
16+
},
17+
"ping": true
1718
}

source/initial-dns-seedlist-discovery/tests/replica-set/srvMaxHosts-zero-txt.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ options:
1313
replicaSet: repl0
1414
srvMaxHosts: 0
1515
ssl: true
16+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/srvMaxHosts-zero.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"replicaSet": "repl0",
1414
"srvMaxHosts": 0,
1515
"ssl": true
16-
}
16+
},
17+
"ping": true
1718
}

source/initial-dns-seedlist-discovery/tests/replica-set/srvMaxHosts-zero.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ options:
1313
replicaSet: repl0
1414
srvMaxHosts: 0
1515
ssl: true
16+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/two-results-default-port.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"options": {
1313
"replicaSet": "repl0",
1414
"ssl": true
15-
}
15+
},
16+
"ping": true
1617
}

source/initial-dns-seedlist-discovery/tests/replica-set/two-results-default-port.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ hosts:
99
options:
1010
replicaSet: repl0
1111
ssl: true
12+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/two-results-nonstandard-port.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"options": {
1313
"replicaSet": "repl0",
1414
"ssl": true
15-
}
15+
},
16+
"ping": true
1617
}

source/initial-dns-seedlist-discovery/tests/replica-set/two-results-nonstandard-port.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ hosts:
99
options:
1010
replicaSet: repl0
1111
ssl: true
12+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/txt-record-with-overridden-ssl-option.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"replicaSet": "repl0",
1313
"authSource": "thisDB",
1414
"ssl": false
15-
}
15+
},
16+
"ping": true
1617
}

source/initial-dns-seedlist-discovery/tests/replica-set/txt-record-with-overridden-ssl-option.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ options:
99
replicaSet: repl0
1010
authSource: thisDB
1111
ssl: false
12+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/txt-record-with-overridden-uri-option.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"replicaSet": "repl0",
1313
"authSource": "otherDB",
1414
"ssl": true
15-
}
15+
},
16+
"ping": true
1617
}

source/initial-dns-seedlist-discovery/tests/replica-set/txt-record-with-overridden-uri-option.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ options:
99
replicaSet: repl0
1010
authSource: otherDB
1111
ssl: true
12+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/uri-with-admin-database.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
},
1616
"parsed_options": {
1717
"auth_database": "adminDB"
18-
}
18+
},
19+
"ping": true
1920
}

source/initial-dns-seedlist-discovery/tests/replica-set/uri-with-admin-database.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ options:
1111
ssl: true
1212
parsed_options:
1313
auth_database: adminDB
14+
ping: true

source/initial-dns-seedlist-discovery/tests/replica-set/uri-with-auth.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@
99
"localhost:27018",
1010
"localhost:27019"
1111
],
12+
"options": {
13+
"replicaSet": "repl0",
14+
"ssl": true
15+
},
1216
"parsed_options": {
1317
"user": "auser",
1418
"password": "apass"
1519
},
20+
"ping": false,
1621
"comment": "Should preserve auth credentials"
1722
}

source/initial-dns-seedlist-discovery/tests/replica-set/uri-with-auth.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ hosts:
66
- localhost:27017
77
- localhost:27018
88
- localhost:27019
9+
options:
10+
replicaSet: repl0
11+
ssl: true
912
parsed_options:
1013
user: auser
1114
password: apass
15+
# Don't run a ping for URIs that include userinfo. Ping doesn't require authentication, so missing
16+
# userinfo isn't a problem, but some drivers will fail handshake on a connection if userinfo is
17+
# provided but incorrect.
18+
ping: false
1219
comment: Should preserve auth credentials

0 commit comments

Comments
 (0)