Skip to content

Commit 53c8c19

Browse files
author
Jessica Lord
authored
Add tests for auth in DNS Seedlist specs
#262
1 parent 9ad414d commit 53c8c19

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ These YAML and JSON files contain the following fields:
7373
- ``hosts``: the discovered topology's list of hosts once SDAM completes a scan
7474
- ``options``: the parsed connection string options as discovered from URI and
7575
TXT records
76+
- ``parsed_options``: additional options present in the URI such as user/password
77+
credentials
7678
- ``error``: indicates that the parsing of the URI, or the resolving or
7779
contents of the SRV or TXT records included errors.
7880
- ``comment``: a comment to indicate why a test would fail.
@@ -83,5 +85,8 @@ seeds. You MUST verify that the set of ServerDescriptions in the client's
8385
TopologyDescription eventually matches the list of hosts. You MUST verify that
8486
each of the values of the Connection String Options under ``options`` match the
8587
Client's parsed value for that option. There may be other options parsed by
86-
the Client as well, which a test does not verify. You MUST verify that an
87-
error has been thrown if ``error`` is present.
88+
the Client as well, which a test does not verify. In ``uri-with-auth`` the URI
89+
contains a user/password set and additional options are provided in
90+
``parsed_options`` so that tests can verify authentication is maintained when
91+
evaluating URIs. You MUST verify that an error has been thrown if ``error`` is
92+
present.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"uri": "mongodb+srv://auser:[email protected]/?replicaSet=repl0",
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+
"parsed_options": {
13+
"user": "auser",
14+
"password": "apass"
15+
},
16+
"comment": "Should preserve auth credentials"
17+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
uri: "mongodb+srv://auser:[email protected]/?replicaSet=repl0"
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+
parsed_options:
10+
user: auser
11+
password: apass
12+
comment: Should preserve auth credentials

0 commit comments

Comments
 (0)