Skip to content

Commit 578024e

Browse files
authored
PYTHON-3170 Run ping command in SRV spec tests (mongodb#1424)
1 parent 83d0e7a commit 578024e

28 files changed

+57
-24
lines changed

test/srv_seedlist/load-balanced/loadBalanced-directConnection.json

+2-1
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
}

test/srv_seedlist/load-balanced/loadBalanced-true-txt.json

+2-1
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
}

test/srv_seedlist/load-balanced/srvMaxHosts-zero-txt.json

+2-1
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
}

test/srv_seedlist/load-balanced/srvMaxHosts-zero.json

+2-1
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
}

test/srv_seedlist/replica-set/direct-connection-false.json

+2-1
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
}

test/srv_seedlist/replica-set/encoded-userinfo-and-db.json

+1
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
}

test/srv_seedlist/replica-set/loadBalanced-false-txt.json

+2-1
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
}

test/srv_seedlist/replica-set/longer-parent-in-return.json

+1
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
}

test/srv_seedlist/replica-set/one-result-default-port.json

+2-1
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
}

test/srv_seedlist/replica-set/one-txt-record-multiple-strings.json

+2-1
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
}

test/srv_seedlist/replica-set/one-txt-record.json

+2-1
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
}

test/srv_seedlist/replica-set/srv-service-name.json

+2-1
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
}

test/srv_seedlist/replica-set/srvMaxHosts-equal_to_srv_records.json

+2-1
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
}

test/srv_seedlist/replica-set/srvMaxHosts-greater_than_srv_records.json

+2-1
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
}

test/srv_seedlist/replica-set/srvMaxHosts-less_than_srv_records.json

+2-1
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
}

test/srv_seedlist/replica-set/srvMaxHosts-zero-txt.json

+2-1
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
}

test/srv_seedlist/replica-set/srvMaxHosts-zero.json

+2-1
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
}

test/srv_seedlist/replica-set/two-results-default-port.json

+2-1
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
}

test/srv_seedlist/replica-set/two-results-nonstandard-port.json

+2-1
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
}

test/srv_seedlist/replica-set/txt-record-with-overridden-ssl-option.json

+2-1
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
}

test/srv_seedlist/replica-set/txt-record-with-overridden-uri-option.json

+2-1
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
}

test/srv_seedlist/replica-set/uri-with-admin-database.json

+2-1
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
}

test/srv_seedlist/replica-set/uri-with-auth.json

+5
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
}

test/srv_seedlist/sharded/srvMaxHosts-equal_to_srv_records.json

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

test/srv_seedlist/sharded/srvMaxHosts-greater_than_srv_records.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"options": {
1212
"srvMaxHosts": 3,
1313
"ssl": true
14-
}
14+
},
15+
"ping": true
1516
}

test/srv_seedlist/sharded/srvMaxHosts-less_than_srv_records.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"options": {
66
"srvMaxHosts": 1,
77
"ssl": true
8-
}
8+
},
9+
"ping": true
910
}

test/srv_seedlist/sharded/srvMaxHosts-zero.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"options": {
1212
"srvMaxHosts": 0,
1313
"ssl": true
14-
}
14+
},
15+
"ping": true
1516
}

test/test_dns.py

+2
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ def run_test(self):
132132
wait_until(
133133
lambda: num_hosts == len(client.nodes), "wait to connect to num_hosts"
134134
)
135+
if test_case.get("ping", True):
136+
client.admin.command("ping")
135137
# XXX: we should block until SRV poller runs at least once
136138
# and re-run these assertions.
137139
else:

0 commit comments

Comments
 (0)