Skip to content

Commit f32514e

Browse files
committed
CDRIVER-3532 associated spec tests
1 parent 5916dda commit f32514e

31 files changed

+706
-22
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"uri": "mongodb+srv://test3.test.build.10gen.cc/?directConnection=false",
3+
"seeds": [
4+
"localhost.test.build.10gen.cc:27017"
5+
],
6+
"hosts": [
7+
"localhost:27017",
8+
"localhost:27018",
9+
"localhost:27019"
10+
],
11+
"options": {
12+
"ssl": true
13+
}
14+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"uri": "mongodb+srv://test3.test.build.10gen.cc/?directConnection=true",
3+
"seeds": [],
4+
"hosts": [],
5+
"error": true,
6+
"comment": "Should fail because directConnection=true is incompatible with SRV URIs."
7+
}

src/libmongoc/tests/json/server_discovery_and_monitoring/rs/discover_arbiters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"description": "Discover arbiters",
3-
"uri": "mongodb://a/?replicaSet=rs",
2+
"description": "Discover arbiters with directConnection URI option",
3+
"uri": "mongodb://a/?directConnection=false",
44
"phases": [
55
{
66
"responses": [
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"description": "Discover arbiters with replicaSet URI option",
3+
"uri": "mongodb://a/?replicaSet=rs",
4+
"phases": [
5+
{
6+
"responses": [
7+
[
8+
"a:27017",
9+
{
10+
"ok": 1,
11+
"ismaster": true,
12+
"hosts": [
13+
"a:27017"
14+
],
15+
"arbiters": [
16+
"b:27017"
17+
],
18+
"setName": "rs",
19+
"minWireVersion": 0,
20+
"maxWireVersion": 6
21+
}
22+
]
23+
],
24+
"outcome": {
25+
"servers": {
26+
"a:27017": {
27+
"type": "RSPrimary",
28+
"setName": "rs"
29+
},
30+
"b:27017": {
31+
"type": "Unknown",
32+
"setName": null
33+
}
34+
},
35+
"topologyType": "ReplicaSetWithPrimary",
36+
"logicalSessionTimeoutMinutes": null,
37+
"setName": "rs"
38+
}
39+
}
40+
]
41+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"description": "Discover ghost with directConnection URI option",
3+
"uri": "mongodb://b/?directConnection=false",
4+
"phases": [
5+
{
6+
"responses": [
7+
[
8+
"b:27017",
9+
{
10+
"ok": 1,
11+
"ismaster": false,
12+
"isreplicaset": true,
13+
"minWireVersion": 0,
14+
"maxWireVersion": 6
15+
}
16+
]
17+
],
18+
"outcome": {
19+
"servers": {
20+
"b:27017": {
21+
"type": "RSGhost",
22+
"setName": null
23+
}
24+
},
25+
"topologyType": "Unknown",
26+
"logicalSessionTimeoutMinutes": null,
27+
"setName": null
28+
}
29+
}
30+
]
31+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"description": "Discover ghost with replicaSet URI option",
3+
"uri": "mongodb://a,b/?replicaSet=rs",
4+
"phases": [
5+
{
6+
"responses": [
7+
[
8+
"b:27017",
9+
{
10+
"ok": 1,
11+
"ismaster": false,
12+
"isreplicaset": true,
13+
"minWireVersion": 0,
14+
"maxWireVersion": 6
15+
}
16+
]
17+
],
18+
"outcome": {
19+
"servers": {
20+
"a:27017": {
21+
"type": "Unknown",
22+
"setName": null
23+
},
24+
"b:27017": {
25+
"type": "RSGhost",
26+
"setName": null
27+
}
28+
},
29+
"topologyType": "ReplicaSetNoPrimary",
30+
"logicalSessionTimeoutMinutes": null,
31+
"setName": "rs"
32+
}
33+
}
34+
]
35+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"description": "Discover hidden with directConnection URI option",
3+
"uri": "mongodb://a/?directConnection=false",
4+
"phases": [
5+
{
6+
"responses": [
7+
[
8+
"a:27017",
9+
{
10+
"ok": 1,
11+
"ismaster": false,
12+
"secondary": true,
13+
"hidden": true,
14+
"hosts": [
15+
"c:27017",
16+
"d:27017"
17+
],
18+
"setName": "rs",
19+
"minWireVersion": 0,
20+
"maxWireVersion": 6
21+
}
22+
]
23+
],
24+
"outcome": {
25+
"servers": {
26+
"a:27017": {
27+
"type": "RSOther",
28+
"setName": "rs"
29+
},
30+
"c:27017": {
31+
"type": "Unknown",
32+
"setName": null
33+
},
34+
"d:27017": {
35+
"type": "Unknown",
36+
"setName": null
37+
}
38+
},
39+
"topologyType": "ReplicaSetNoPrimary",
40+
"logicalSessionTimeoutMinutes": null,
41+
"setName": "rs"
42+
}
43+
}
44+
]
45+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"description": "Discover hidden with replicaSet URI option",
3+
"uri": "mongodb://a/?replicaSet=rs",
4+
"phases": [
5+
{
6+
"responses": [
7+
[
8+
"a:27017",
9+
{
10+
"ok": 1,
11+
"ismaster": false,
12+
"secondary": true,
13+
"hidden": true,
14+
"hosts": [
15+
"c:27017",
16+
"d:27017"
17+
],
18+
"setName": "rs",
19+
"minWireVersion": 0,
20+
"maxWireVersion": 6
21+
}
22+
]
23+
],
24+
"outcome": {
25+
"servers": {
26+
"a:27017": {
27+
"type": "RSOther",
28+
"setName": "rs"
29+
},
30+
"c:27017": {
31+
"type": "Unknown",
32+
"setName": null
33+
},
34+
"d:27017": {
35+
"type": "Unknown",
36+
"setName": null
37+
}
38+
},
39+
"topologyType": "ReplicaSetNoPrimary",
40+
"logicalSessionTimeoutMinutes": null,
41+
"setName": "rs"
42+
}
43+
}
44+
]
45+
}

src/libmongoc/tests/json/server_discovery_and_monitoring/rs/discover_passives.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"description": "Discover passives",
3-
"uri": "mongodb://a/?replicaSet=rs",
2+
"description": "Discover passives with directConnection URI option",
3+
"uri": "mongodb://a/?directConnection=false",
44
"phases": [
55
{
66
"responses": [
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"description": "Discover passives with replicaSet URI option",
3+
"uri": "mongodb://a/?replicaSet=rs",
4+
"phases": [
5+
{
6+
"responses": [
7+
[
8+
"a:27017",
9+
{
10+
"ok": 1,
11+
"ismaster": true,
12+
"hosts": [
13+
"a:27017"
14+
],
15+
"passives": [
16+
"b:27017"
17+
],
18+
"setName": "rs",
19+
"minWireVersion": 0,
20+
"maxWireVersion": 6
21+
}
22+
]
23+
],
24+
"outcome": {
25+
"servers": {
26+
"a:27017": {
27+
"type": "RSPrimary",
28+
"setName": "rs"
29+
},
30+
"b:27017": {
31+
"type": "Unknown",
32+
"setName": null
33+
}
34+
},
35+
"topologyType": "ReplicaSetWithPrimary",
36+
"logicalSessionTimeoutMinutes": null,
37+
"setName": "rs"
38+
}
39+
},
40+
{
41+
"responses": [
42+
[
43+
"b:27017",
44+
{
45+
"ok": 1,
46+
"ismaster": false,
47+
"secondary": true,
48+
"passive": true,
49+
"hosts": [
50+
"a:27017"
51+
],
52+
"passives": [
53+
"b:27017"
54+
],
55+
"setName": "rs",
56+
"minWireVersion": 0,
57+
"maxWireVersion": 6
58+
}
59+
]
60+
],
61+
"outcome": {
62+
"servers": {
63+
"a:27017": {
64+
"type": "RSPrimary",
65+
"setName": "rs"
66+
},
67+
"b:27017": {
68+
"type": "RSSecondary",
69+
"setName": "rs"
70+
}
71+
},
72+
"topologyType": "ReplicaSetWithPrimary",
73+
"logicalSessionTimeoutMinutes": null,
74+
"setName": "rs"
75+
}
76+
}
77+
]
78+
}

0 commit comments

Comments
 (0)