forked from mongodb/mongo-go-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GODRIVER-89 Implement Initial DNS Seedlist discovery spec
- Loading branch information
Will Banfield
committed
Nov 10, 2017
1 parent
79367d0
commit aec5f69
Showing
21 changed files
with
448 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
==================================== | ||
Initial DNS Seedlist Discovery tests | ||
==================================== | ||
|
||
This directory contains platform-independent tests that drivers can use | ||
to prove their conformance to the Initial DNS Seedlist Discovery spec. | ||
|
||
Test Setup | ||
---------- | ||
|
||
Start a three-node replica set on localhost, on ports 27017, 27018, and 27019, | ||
with replica set name "repl0". | ||
|
||
To run the tests that accompany this spec, you need to configure the SRV and | ||
TXT records with a real name server. The following records are required for | ||
these tests:: | ||
|
||
Record TTL Class Port Target | ||
_mongodb._tcp.test1.test.build.10gen.cc. 86400 IN SRV 27017 localhost.build.10gen.cc. | ||
_mongodb._tcp.test1.test.build.10gen.cc. 86400 IN SRV 27018 localhost.build.10gen.cc. | ||
_mongodb._tcp.test2.test.build.10gen.cc. 86400 IN SRV 27018 localhost.build.10gen.cc. | ||
_mongodb._tcp.test2.test.build.10gen.cc. 86400 IN SRV 27019 localhost.build.10gen.cc. | ||
_mongodb._tcp.test3.test.build.10gen.cc. 86400 IN SRV 27017 localhost.build.10gen.cc. | ||
_mongodb._tcp.test5.test.build.10gen.cc. 86400 IN SRV 27017 localhost.build.10gen.cc. | ||
_mongodb._tcp.test6.test.build.10gen.cc. 86400 IN SRV 27017 localhost.build.10gen.cc. | ||
|
||
Record TTL Class Text | ||
test5.test.build.10gen.cc. 86400 IN TXT "connectTimeoutMS=300000&socketTimeoutMS=300000" | ||
test6.test.build.10gen.cc. 86400 IN TXT "connectTimeoutMS=200000" | ||
test6.test.build.10gen.cc. 86400 IN TXT "socketTimeoutMS=200000" | ||
|
||
Note that ``test4`` is omitted deliberately to test what happens with no SRV | ||
record. | ||
|
||
In our tests we have used "localhost.build.10gen.cc" as the domain, and then | ||
configured "localhost.build.10gen.cc" to resolve to 127.0.0.1. | ||
|
||
You need to adapt the records shown above to replace ``build.10gen.cc`` with | ||
your own domain name, and update the "uri" field in the YAML or JSON files in | ||
this directory with the actual domain. | ||
|
||
Test Format and Use | ||
------------------- | ||
|
||
These YAML and JSON files contain the following fields: | ||
|
||
- ``uri``: a mongodb+srv connection string | ||
- ``seeds``: the expected set of initial seeds discovered from the SRV record | ||
- ``hosts``: the discovered topology's list of hosts once SDAM completes a scan | ||
- ``options``: the parsed connection string options as discovered from URI and | ||
TXT records | ||
|
||
For each file, create MongoClient initialized with the mongodb+srv connection | ||
string. You SHOULD verify that the client's initial seed list matches the list of | ||
seeds. You MUST verify that the set of ServerDescriptions in the client's | ||
TopologyDescription eventually matches the list of hosts. You MUST verify that | ||
the set of Connection String Options matches the client's parsed set. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"uri": "mongodb+srv://test4.test.build.10gen.cc/", | ||
"seeds": [], | ||
"hosts": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
uri: "mongodb+srv://test4.test.build.10gen.cc/" | ||
seeds: [] | ||
hosts: [] |
11 changes: 11 additions & 0 deletions
11
data/initial-dns-seedlist-discovery/one-result-default-port.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"uri": "mongodb+srv://test3.test.build.10gen.cc/?replicaSet=repl0", | ||
"seeds": [ | ||
"localhost.build.10gen.cc:27017" | ||
], | ||
"hosts": [ | ||
"localhost:27017", | ||
"localhost:27018", | ||
"localhost:27019" | ||
] | ||
} |
7 changes: 7 additions & 0 deletions
7
data/initial-dns-seedlist-discovery/one-result-default-port.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
uri: "mongodb+srv://test3.test.build.10gen.cc/?replicaSet=repl0" | ||
seeds: | ||
- localhost.build.10gen.cc:27017 | ||
hosts: | ||
- localhost:27017 | ||
- localhost:27018 | ||
- localhost:27019 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"uri": "mongodb+srv://test5.test.build.10gen.cc/?replicaSet=repl0", | ||
"seeds": [ | ||
"localhost.build.10gen.cc:27017" | ||
], | ||
"hosts": [ | ||
"localhost:27017", | ||
"localhost:27018", | ||
"localhost:27019" | ||
], | ||
"options": { | ||
"connectTimeoutMS": 300000, | ||
"replicaSet": "repl0", | ||
"socketTimeoutMS": 300000 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
uri: "mongodb+srv://test5.test.build.10gen.cc/?replicaSet=repl0" | ||
seeds: | ||
- localhost.build.10gen.cc:27017 | ||
hosts: | ||
- localhost:27017 | ||
- localhost:27018 | ||
- localhost:27019 | ||
options: | ||
connectTimeoutMS: 300000 | ||
replicaSet: repl0 | ||
socketTimeoutMS: 300000 |
12 changes: 12 additions & 0 deletions
12
data/initial-dns-seedlist-discovery/two-results-default-port.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"uri": "mongodb+srv://test1.test.build.10gen.cc/?replicaSet=repl0", | ||
"seeds": [ | ||
"localhost.build.10gen.cc:27017", | ||
"localhost.build.10gen.cc:27018" | ||
], | ||
"hosts": [ | ||
"localhost:27017", | ||
"localhost:27018", | ||
"localhost:27019" | ||
] | ||
} |
8 changes: 8 additions & 0 deletions
8
data/initial-dns-seedlist-discovery/two-results-default-port.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
uri: "mongodb+srv://test1.test.build.10gen.cc/?replicaSet=repl0" | ||
seeds: | ||
- localhost.build.10gen.cc:27017 | ||
- localhost.build.10gen.cc:27018 | ||
hosts: | ||
- localhost:27017 | ||
- localhost:27018 | ||
- localhost:27019 |
12 changes: 12 additions & 0 deletions
12
data/initial-dns-seedlist-discovery/two-results-nonstandard-port.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"uri": "mongodb+srv://test2.test.build.10gen.cc/?replicaSet=repl0", | ||
"seeds": [ | ||
"localhost.build.10gen.cc:27018", | ||
"localhost.build.10gen.cc:27019" | ||
], | ||
"hosts": [ | ||
"localhost:27017", | ||
"localhost:27018", | ||
"localhost:27019" | ||
] | ||
} |
8 changes: 8 additions & 0 deletions
8
data/initial-dns-seedlist-discovery/two-results-nonstandard-port.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
uri: "mongodb+srv://test2.test.build.10gen.cc/?replicaSet=repl0" | ||
seeds: | ||
- localhost.build.10gen.cc:27018 | ||
- localhost.build.10gen.cc:27019 | ||
hosts: | ||
- localhost:27017 | ||
- localhost:27018 | ||
- localhost:27019 |
16 changes: 16 additions & 0 deletions
16
data/initial-dns-seedlist-discovery/two-txt-records-with-override.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"uri": "mongodb+srv://test6.test.build.10gen.cc/?replicaSet=repl0&connectTimeoutMS=250000", | ||
"seeds": [ | ||
"localhost.build.10gen.cc:27017" | ||
], | ||
"hosts": [ | ||
"localhost:27017", | ||
"localhost:27018", | ||
"localhost:27019" | ||
], | ||
"options": { | ||
"connectTimeoutMS": 250000, | ||
"replicaSet": "repl0", | ||
"socketTimeoutMS": 200000 | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
data/initial-dns-seedlist-discovery/two-txt-records-with-override.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
uri: "mongodb+srv://test6.test.build.10gen.cc/?replicaSet=repl0&connectTimeoutMS=250000" | ||
seeds: | ||
- localhost.build.10gen.cc:27017 | ||
hosts: | ||
- localhost:27017 | ||
- localhost:27018 | ||
- localhost:27019 | ||
options: | ||
connectTimeoutMS: 250000 | ||
replicaSet: repl0 | ||
socketTimeoutMS: 200000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"uri": "mongodb+srv://test6.test.build.10gen.cc/?replicaSet=repl0", | ||
"seeds": [ | ||
"localhost.build.10gen.cc:27017" | ||
], | ||
"hosts": [ | ||
"localhost:27017", | ||
"localhost:27018", | ||
"localhost:27019" | ||
], | ||
"options": { | ||
"connectTimeoutMS": 200000, | ||
"replicaSet": "repl0", | ||
"socketTimeoutMS": 200000 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
uri: "mongodb+srv://test6.test.build.10gen.cc/?replicaSet=repl0" | ||
seeds: | ||
- localhost.build.10gen.cc:27017 | ||
hosts: | ||
- localhost:27017 | ||
- localhost:27018 | ||
- localhost:27019 | ||
options: | ||
connectTimeoutMS: 200000 | ||
replicaSet: repl0 | ||
socketTimeoutMS: 200000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.