summaryrefslogtreecommitdiff
path: root/src/mongo/client/mongo_uri_tests/mongo-uri-host-identifiers.json
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/client/mongo_uri_tests/mongo-uri-host-identifiers.json')
-rw-r--r--src/mongo/client/mongo_uri_tests/mongo-uri-host-identifiers.json203
1 files changed, 203 insertions, 0 deletions
diff --git a/src/mongo/client/mongo_uri_tests/mongo-uri-host-identifiers.json b/src/mongo/client/mongo_uri_tests/mongo-uri-host-identifiers.json
new file mode 100644
index 00000000000..8a1fda580a8
--- /dev/null
+++ b/src/mongo/client/mongo_uri_tests/mongo-uri-host-identifiers.json
@@ -0,0 +1,203 @@
+{
+ "tests": [
+ {
+ "description": "Single IPv4 host without port",
+ "uri": "mongodb://127.0.0.1",
+ "valid": true,
+ "warning": false,
+ "hosts": [
+ {
+ "type": "ipv4",
+ "host": "127.0.0.1",
+ "port": null
+ }
+ ],
+ "auth": null,
+ "options": null
+ },
+ {
+ "description": "Single IPv4 host with port",
+ "uri": "mongodb://127.0.0.1:27018",
+ "valid": true,
+ "warning": false,
+ "hosts": [
+ {
+ "type": "ipv4",
+ "host": "127.0.0.1",
+ "port": 27018
+ }
+ ],
+ "auth": null,
+ "options": null
+ },
+ {
+ "description": "Single IP literal host without port",
+ "uri": "mongodb://[::1]",
+ "valid": true,
+ "warning": false,
+ "hosts": [
+ {
+ "type": "ip_literal",
+ "host": "::1",
+ "port": null
+ }
+ ],
+ "auth": null,
+ "options": null
+ },
+ {
+ "description": "Single IP literal host with port",
+ "uri": "mongodb://[::1]:27019",
+ "valid": true,
+ "warning": false,
+ "hosts": [
+ {
+ "type": "ip_literal",
+ "host": "::1",
+ "port": 27019
+ }
+ ],
+ "auth": null,
+ "options": null
+ },
+ {
+ "description": "Single hostname without port",
+ "uri": "mongodb://example.com",
+ "valid": true,
+ "warning": false,
+ "hosts": [
+ {
+ "type": "hostname",
+ "host": "example.com",
+ "port": null
+ }
+ ],
+ "auth": null,
+ "options": null
+ },
+ {
+ "description": "Single hostname with port",
+ "uri": "mongodb://example.com:27020",
+ "valid": true,
+ "warning": false,
+ "hosts": [
+ {
+ "type": "hostname",
+ "host": "example.com",
+ "port": 27020
+ }
+ ],
+ "auth": null,
+ "options": null
+ },
+ {
+ "description": "Single hostname (resembling IPv4) without port",
+ "uri": "mongodb://256.0.0.1",
+ "valid": true,
+ "warning": false,
+ "hosts": [
+ {
+ "type": "hostname",
+ "host": "256.0.0.1",
+ "port": null
+ }
+ ],
+ "auth": null,
+ "options": null
+ },
+ {
+ "description": "Multiple hosts (mixed formats)",
+ "uri": "mongodb://127.0.0.1,[::1]:27018,example.com:27019",
+ "valid": false,
+ "warning": false,
+ "hosts": [
+ {
+ "type": "ipv4",
+ "host": "127.0.0.1",
+ "port": null
+ },
+ {
+ "type": "ip_literal",
+ "host": "::1",
+ "port": 27018
+ },
+ {
+ "type": "hostname",
+ "host": "example.com",
+ "port": 27019
+ }
+ ],
+ "auth": null,
+ "options": null
+ },
+ {
+ "description": "Multiple hosts (mixed formats)",
+ "uri": "mongodb://127.0.0.1,[::1]:27018,example.com:27019/?replicaSet=replset",
+ "valid": true,
+ "warning": false,
+ "hosts": [
+ {
+ "type": "ipv4",
+ "host": "127.0.0.1",
+ "port": null
+ },
+ {
+ "type": "ip_literal",
+ "host": "::1",
+ "port": 27018
+ },
+ {
+ "type": "hostname",
+ "host": "example.com",
+ "port": 27019
+ }
+ ],
+ "auth": null,
+ "options": {
+ "replicaSet": "replset"
+ }
+ },
+ {
+ "description": "UTF-8 hosts",
+ "uri": "mongodb://bücher.example.com,umläut.example.com/",
+ "valid": false,
+ "warning": false,
+ "hosts": [
+ {
+ "type": "hostname",
+ "host": "bücher.example.com",
+ "port": null
+ },
+ {
+ "type": "hostname",
+ "host": "umläut.example.com",
+ "port": null
+ }
+ ],
+ "auth": null,
+ "options": null
+ },
+ {
+ "description": "UTF-8 hosts",
+ "uri": "mongodb://bücher.example.com,umläut.example.com/?replicaSet=replset",
+ "valid": true,
+ "warning": false,
+ "hosts": [
+ {
+ "type": "hostname",
+ "host": "bücher.example.com",
+ "port": null
+ },
+ {
+ "type": "hostname",
+ "host": "umläut.example.com",
+ "port": null
+ }
+ ],
+ "auth": null,
+ "options": {
+ "replicaSet": "replset"
+ }
+ }
+ ]
+} \ No newline at end of file