bson/testdata/uri-options/srv-options.yml
2025-03-17 20:58:26 +01:00

89 lines
2.8 KiB
YAML

tests:
- description: "SRV URI with custom srvServiceName"
uri: "mongodb+srv://test22.test.build.10gen.cc/?srvServiceName=customname"
valid: true
warning: false
hosts: ~
auth: ~
options:
srvServiceName: "customname"
- description: "Non-SRV URI with custom srvServiceName"
uri: "mongodb://example.com/?srvServiceName=customname"
valid: false
warning: false
hosts: ~
auth: ~
options: {}
- description: "SRV URI with srvMaxHosts"
uri: "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2"
valid: true
warning: false
hosts: ~
auth: ~
options:
srvMaxHosts: 2
- description: "SRV URI with negative integer for srvMaxHosts"
uri: "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=-1"
valid: true
warning: true
hosts: ~
auth: ~
options: {}
- description: "SRV URI with invalid type for srvMaxHosts"
uri: "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=foo"
valid: true
warning: true
hosts: ~
auth: ~
options: {}
- description: "Non-SRV URI with srvMaxHosts"
uri: "mongodb://example.com/?srvMaxHosts=2"
valid: false
warning: false
hosts: ~
auth: ~
options: {}
# Note: Testing URI validation for srvMaxHosts conflicting with either
# loadBalanced=true or replicaSet specified via TXT records is covered by
# the Initial DNS Seedlist Discovery test suite.
- description: "SRV URI with positive srvMaxHosts and replicaSet"
uri: "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&replicaSet=foo"
valid: false
warning: false
hosts: ~
auth: ~
options: {}
- description: "SRV URI with positive srvMaxHosts and loadBalanced=true"
uri: "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&loadBalanced=true"
valid: false
warning: false
hosts: ~
auth: ~
options: {}
- description: "SRV URI with positive srvMaxHosts and loadBalanced=false"
uri: "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&loadBalanced=false"
valid: true
warning: false
hosts: ~
auth: ~
options:
loadBalanced: false
srvMaxHosts: 2
- description: "SRV URI with srvMaxHosts=0 and replicaSet"
uri: "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=0&replicaSet=foo"
valid: true
warning: false
hosts: ~
auth: ~
options:
replicaSet: foo
srvMaxHosts: 0
- description: "SRV URI with srvMaxHosts=0 and loadBalanced=true"
uri: "mongodb+srv://test3.test.build.10gen.cc/?srvMaxHosts=0&loadBalanced=true"
valid: true
warning: false
hosts: ~
auth: ~
options:
loadBalanced: true
srvMaxHosts: 0