@@ -14,8 +14,9 @@ replica set name ``repl0``.
14
14
15
15
The tests in the ``load-balanced `` directory MUST be executed against a
16
16
load-balanced sharded cluster with the mongos servers running on localhost ports
17
- 27017 and 27018 (corresponding to the script in `drivers-evergreen-tools `_). The
18
- load balancers, shard servers, and config servers may run on any open ports.
17
+ 27017 and 27018 and ``--loadBalancerPort `` 27050 and 27051, respectively
18
+ (corresponding to the script in `drivers-evergreen-tools `_). The load balancers,
19
+ shard servers, and config servers may run on any open ports.
19
20
20
21
.. _`drivers-evergreen-tools` : https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/run-load-balancer.sh
21
22
@@ -56,7 +57,9 @@ these tests::
56
57
_mongodb._tcp.test19.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc.
57
58
_mongodb._tcp.test20.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc.
58
59
_mongodb._tcp.test21.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc.
59
- _customname._tcp.test22.test.build.10gen.cc 86400 IN SRV 27017 localhost.test.build.10gen.cc
60
+ _customname._tcp.test22.test.build.10gen.cc 86400 IN SRV 27017 localhost.test.build.10gen.cc.
61
+ _mongodb._tcp.test23.test.build.10gen.cc. 86400 IN SRV 8000 localhost.test.build.10gen.cc.
62
+ _mongodb._tcp.test24.test.build.10gen.cc. 86400 IN SRV 8000 localhost.test.build.10gen.cc.
60
63
61
64
Record TTL Class Text
62
65
test5.test.build.10gen.cc. 86400 IN TXT "replicaSet=repl0&authSource=thisDB"
@@ -68,12 +71,18 @@ these tests::
68
71
test11.test.build.10gen.cc. 86400 IN TXT "replicaS" "et=rep" "l0"
69
72
test20.test.build.10gen.cc. 86400 IN TXT "loadBalanced=true"
70
73
test21.test.build.10gen.cc. 86400 IN TXT "loadBalanced=false"
74
+ test24.test.build.10gen.cc. 86400 IN TXT "loadBalanced=true"
71
75
72
- Note that ``test4 `` is omitted deliberately to test what happens with no SRV
73
- record. ``test9 `` is missing because it was deleted during the development of
74
- the tests. The missing ``test. `` sub-domain in the SRV record target for
75
- ``test12 `` is deliberate. ``test22 `` is used to test a custom service name
76
- (``customname ``).
76
+ Notes:
77
+
78
+ - ``test4 `` is omitted deliberately to test what happens with no SRV record.
79
+ - ``test9 `` is missing because it was deleted during the development of the
80
+ tests.
81
+ - The missing ``test. `` sub-domain in the SRV record target for ``test12 `` is
82
+ deliberate.
83
+ - ``test22 `` is used to test a custom service name (``customname ``).
84
+ - ``test23 `` and ``test24 `` point to port 8000 (HAProxy) and are used for
85
+ load-balanced tests.
77
86
78
87
In our tests we have used ``localhost.test.build.10gen.cc `` as the domain, and
79
88
then configured ``localhost.test.build.10gen.cc `` to resolve to 127.0.0.1.
@@ -105,31 +114,51 @@ These YAML and JSON files contain the following fields:
105
114
- ``error ``: indicates that the parsing of the URI, or the resolving or
106
115
contents of the SRV or TXT records included errors.
107
116
- ``comment ``: a comment to indicate why a test would fail.
117
+ - ``ping ``: if false, the test runner should not run a "ping" operation.
108
118
109
119
.. _`Connection String` : ../../connection-string/connection-string-spec.rst
110
120
.. _`URI options` : ../../uri-options/uri-options.rst
111
121
112
- For each file, create a MongoClient initialized with the ``mongodb+srv ``
113
- connection string.
114
-
115
- If ``seeds `` is specified, drivers SHOULD verify that the set of hosts in the
116
- client's initial seedlist matches the list in ``seeds ``. If ``numSeeds `` is
117
- specified, drivers SHOULD verify that the size of that set matches ``numSeeds ``.
118
-
119
- If ``hosts `` is specified, drivers MUST verify that the set of
120
- ServerDescriptions in the client's TopologyDescription eventually matches the
121
- list in ``hosts ``. If ``numHosts `` is specified, drivers MUST verify that the
122
- size of that set matches ``numHosts ``.
123
-
124
- If ``options `` is specified, drivers MUST verify each of the values under
125
- ``options `` match the MongoClient's parsed value for that option. There may be
126
- other options parsed by the MongoClient as well, which a test does not verify.
127
-
128
- If ``parsed_options `` is specified, drivers MUST verify that each of the values
129
- under ``parsed_options `` match the MongoClient's parsed value for that option.
130
- Supported values include, but are not limited to, ``user `` and ``password ``
131
- (parsed from ``UserInfo ``) and ``auth_database `` (parsed from
132
- ``Auth database ``).
133
-
134
- If ``error `` is specified and ``true ``, drivers MUST verify that an error has
135
- been thrown.
122
+ For each YAML file:
123
+
124
+ - Create a MongoClient initialized with the ``mongodb+srv ``
125
+ connection string.
126
+ - Run a "ping" operation unless ``ping `` is false or ``error `` is true.
127
+
128
+ Assertions:
129
+
130
+ - If ``seeds `` is specified, drivers SHOULD verify that the set of hosts in the
131
+ client's initial seedlist matches the list in ``seeds ``. If ``numSeeds `` is
132
+ specified, drivers SHOULD verify that the size of that set matches
133
+ ``numSeeds ``.
134
+
135
+ - If ``hosts `` is specified, drivers MUST verify that the set of
136
+ ServerDescriptions in the client's TopologyDescription eventually matches the
137
+ list in ``hosts ``. If ``numHosts `` is specified, drivers MUST verify that the
138
+ size of that set matches ``numHosts ``.
139
+
140
+ - If ``options `` is specified, drivers MUST verify each of the values under
141
+ ``options `` match the MongoClient's parsed value for that option. There may be
142
+ other options parsed by the MongoClient as well, which a test does not verify.
143
+
144
+ - If ``parsed_options `` is specified, drivers MUST verify that each of the
145
+ values under ``parsed_options `` match the MongoClient's parsed value for that
146
+ option. Supported values include, but are not limited to, ``user `` and
147
+ ``password `` (parsed from ``UserInfo ``) and ``auth_database `` (parsed from
148
+ ``Auth database ``).
149
+
150
+ - If ``error `` is specified and ``true ``, drivers MUST verify that initializing
151
+ the MongoClient throws an error. If ``error `` is not specified or is
152
+ ``false ``, both initializing the MongoClient and running a ping operation must
153
+ succeed without throwing any errors.
154
+
155
+ - If ``ping `` is not specified or ``true ``, drivers MUST verify that running a
156
+ "ping" operation using the initialized MongoClient succeeds. If ``ping `` is
157
+ ``false ``, drivers MUST NOT run a "ping" operation.
158
+
159
+ **Note: ** These tests are expected to be run against MongoDB databases with
160
+ and without authentication enabled. The "ping" operation does not require
161
+ authentication so should succeed with URIs that contain no userinfo (i.e.
162
+ no username and password). Tests with URIs that contain userinfo always set
163
+ ``ping `` to ``false `` because some drivers will fail handshake on a
164
+ connection if userinfo is provided but incorrect.
0 commit comments