Skip to content

Commit f730c4d

Browse files
committed
Update SDAM spec tests to latest version
1 parent 9e3d80f commit f730c4d

File tree

152 files changed

+14826
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+14826
-115
lines changed

src/libmongoc/tests/json-test.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "json-test-monitoring.h"
2727
#include "json-test-operations.h"
2828

29-
#define MAX_NUM_TESTS 100
29+
#define MAX_NUM_TESTS 150
3030

3131
typedef void (*test_hook) (bson_t *test);
3232

src/libmongoc/tests/json/server_discovery_and_monitoring/errors/non-stale-topologyVersion-greater-NotMaster.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"description": "Non-stale topologyVersion greater NotMaster error",
2+
"description": "Non-stale topologyVersion greater NotWritablePrimary error",
33
"uri": "mongodb://a/?replicaSet=rs",
44
"phases": [
55
{
@@ -51,7 +51,7 @@
5151
}
5252
},
5353
{
54-
"description": "Non-stale topologyVersion greater NotMaster error marks server Unknown",
54+
"description": "Non-stale topologyVersion greater NotWritablePrimary error marks server Unknown",
5555
"applicationErrors": [
5656
{
5757
"address": "a:27017",
@@ -60,7 +60,7 @@
6060
"type": "command",
6161
"response": {
6262
"ok": 0,
63-
"errmsg": "NotMaster",
63+
"errmsg": "NotWritablePrimary",
6464
"code": 10107,
6565
"topologyVersion": {
6666
"processId": {

src/libmongoc/tests/json/server_discovery_and_monitoring/errors/non-stale-topologyVersion-greater-NotMasterNoSlaveOk.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"description": "Non-stale topologyVersion greater NotMasterNoSlaveOk error",
2+
"description": "Non-stale topologyVersion greater NotPrimaryNoSecondaryOk error",
33
"uri": "mongodb://a/?replicaSet=rs",
44
"phases": [
55
{
@@ -51,7 +51,7 @@
5151
}
5252
},
5353
{
54-
"description": "Non-stale topologyVersion greater NotMasterNoSlaveOk error marks server Unknown",
54+
"description": "Non-stale topologyVersion greater NotPrimaryNoSecondaryOk error marks server Unknown",
5555
"applicationErrors": [
5656
{
5757
"address": "a:27017",
@@ -60,7 +60,7 @@
6060
"type": "command",
6161
"response": {
6262
"ok": 0,
63-
"errmsg": "NotMasterNoSlaveOk",
63+
"errmsg": "NotPrimaryNoSecondaryOk",
6464
"code": 13435,
6565
"topologyVersion": {
6666
"processId": {

src/libmongoc/tests/json/server_discovery_and_monitoring/errors/non-stale-topologyVersion-greater-NotMasterOrSecondary.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"description": "Non-stale topologyVersion greater NotMasterOrSecondary error",
2+
"description": "Non-stale topologyVersion greater NotPrimaryOrSecondary error",
33
"uri": "mongodb://a/?replicaSet=rs",
44
"phases": [
55
{
@@ -51,7 +51,7 @@
5151
}
5252
},
5353
{
54-
"description": "Non-stale topologyVersion greater NotMasterOrSecondary error marks server Unknown",
54+
"description": "Non-stale topologyVersion greater NotPrimaryOrSecondary error marks server Unknown",
5555
"applicationErrors": [
5656
{
5757
"address": "a:27017",
@@ -60,7 +60,7 @@
6060
"type": "command",
6161
"response": {
6262
"ok": 0,
63-
"errmsg": "NotMasterOrSecondary",
63+
"errmsg": "NotPrimaryOrSecondary",
6464
"code": 13436,
6565
"topologyVersion": {
6666
"processId": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"description": "Non-stale topologyVersion greater NotPrimaryNoSecondaryOk error",
3+
"uri": "mongodb://a/?replicaSet=rs",
4+
"phases": [
5+
{
6+
"description": "Primary A is discovered",
7+
"responses": [
8+
[
9+
"a:27017",
10+
{
11+
"ok": 1,
12+
"isWritablePrimary": true,
13+
"hosts": [
14+
"a:27017"
15+
],
16+
"setName": "rs",
17+
"minWireVersion": 0,
18+
"maxWireVersion": 9,
19+
"topologyVersion": {
20+
"processId": {
21+
"$oid": "000000000000000000000001"
22+
},
23+
"counter": {
24+
"$numberLong": "1"
25+
}
26+
}
27+
}
28+
]
29+
],
30+
"outcome": {
31+
"servers": {
32+
"a:27017": {
33+
"type": "RSPrimary",
34+
"setName": "rs",
35+
"topologyVersion": {
36+
"processId": {
37+
"$oid": "000000000000000000000001"
38+
},
39+
"counter": {
40+
"$numberLong": "1"
41+
}
42+
},
43+
"pool": {
44+
"generation": 0
45+
}
46+
}
47+
},
48+
"topologyType": "ReplicaSetWithPrimary",
49+
"logicalSessionTimeoutMinutes": null,
50+
"setName": "rs"
51+
}
52+
},
53+
{
54+
"description": "Non-stale topologyVersion greater NotPrimaryNoSecondaryOk error marks server Unknown",
55+
"applicationErrors": [
56+
{
57+
"address": "a:27017",
58+
"when": "afterHandshakeCompletes",
59+
"maxWireVersion": 9,
60+
"type": "command",
61+
"response": {
62+
"ok": 0,
63+
"errmsg": "NotPrimaryNoSecondaryOk",
64+
"code": 13435,
65+
"topologyVersion": {
66+
"processId": {
67+
"$oid": "000000000000000000000001"
68+
},
69+
"counter": {
70+
"$numberLong": "2"
71+
}
72+
}
73+
}
74+
}
75+
],
76+
"outcome": {
77+
"servers": {
78+
"a:27017": {
79+
"type": "Unknown",
80+
"topologyVersion": {
81+
"processId": {
82+
"$oid": "000000000000000000000001"
83+
},
84+
"counter": {
85+
"$numberLong": "2"
86+
}
87+
},
88+
"pool": {
89+
"generation": 0
90+
}
91+
}
92+
},
93+
"topologyType": "ReplicaSetNoPrimary",
94+
"logicalSessionTimeoutMinutes": null,
95+
"setName": "rs"
96+
}
97+
}
98+
]
99+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"description": "Non-stale topologyVersion greater NotPrimaryOrSecondary error",
3+
"uri": "mongodb://a/?replicaSet=rs",
4+
"phases": [
5+
{
6+
"description": "Primary A is discovered",
7+
"responses": [
8+
[
9+
"a:27017",
10+
{
11+
"ok": 1,
12+
"isWritablePrimary": true,
13+
"hosts": [
14+
"a:27017"
15+
],
16+
"setName": "rs",
17+
"minWireVersion": 0,
18+
"maxWireVersion": 9,
19+
"topologyVersion": {
20+
"processId": {
21+
"$oid": "000000000000000000000001"
22+
},
23+
"counter": {
24+
"$numberLong": "1"
25+
}
26+
}
27+
}
28+
]
29+
],
30+
"outcome": {
31+
"servers": {
32+
"a:27017": {
33+
"type": "RSPrimary",
34+
"setName": "rs",
35+
"topologyVersion": {
36+
"processId": {
37+
"$oid": "000000000000000000000001"
38+
},
39+
"counter": {
40+
"$numberLong": "1"
41+
}
42+
},
43+
"pool": {
44+
"generation": 0
45+
}
46+
}
47+
},
48+
"topologyType": "ReplicaSetWithPrimary",
49+
"logicalSessionTimeoutMinutes": null,
50+
"setName": "rs"
51+
}
52+
},
53+
{
54+
"description": "Non-stale topologyVersion greater NotPrimaryOrSecondary error marks server Unknown",
55+
"applicationErrors": [
56+
{
57+
"address": "a:27017",
58+
"when": "afterHandshakeCompletes",
59+
"maxWireVersion": 9,
60+
"type": "command",
61+
"response": {
62+
"ok": 0,
63+
"errmsg": "NotPrimaryOrSecondary",
64+
"code": 13436,
65+
"topologyVersion": {
66+
"processId": {
67+
"$oid": "000000000000000000000001"
68+
},
69+
"counter": {
70+
"$numberLong": "2"
71+
}
72+
}
73+
}
74+
}
75+
],
76+
"outcome": {
77+
"servers": {
78+
"a:27017": {
79+
"type": "Unknown",
80+
"topologyVersion": {
81+
"processId": {
82+
"$oid": "000000000000000000000001"
83+
},
84+
"counter": {
85+
"$numberLong": "2"
86+
}
87+
},
88+
"pool": {
89+
"generation": 0
90+
}
91+
}
92+
},
93+
"topologyType": "ReplicaSetNoPrimary",
94+
"logicalSessionTimeoutMinutes": null,
95+
"setName": "rs"
96+
}
97+
}
98+
]
99+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
{
2+
"description": "Non-stale topologyVersion greater NotWritablePrimary error",
3+
"uri": "mongodb://a/?replicaSet=rs",
4+
"phases": [
5+
{
6+
"description": "Primary A is discovered",
7+
"responses": [
8+
[
9+
"a:27017",
10+
{
11+
"ok": 1,
12+
"isWritablePrimary": true,
13+
"hosts": [
14+
"a:27017"
15+
],
16+
"setName": "rs",
17+
"minWireVersion": 0,
18+
"maxWireVersion": 9,
19+
"topologyVersion": {
20+
"processId": {
21+
"$oid": "000000000000000000000001"
22+
},
23+
"counter": {
24+
"$numberLong": "1"
25+
}
26+
}
27+
}
28+
]
29+
],
30+
"outcome": {
31+
"servers": {
32+
"a:27017": {
33+
"type": "RSPrimary",
34+
"setName": "rs",
35+
"topologyVersion": {
36+
"processId": {
37+
"$oid": "000000000000000000000001"
38+
},
39+
"counter": {
40+
"$numberLong": "1"
41+
}
42+
},
43+
"pool": {
44+
"generation": 0
45+
}
46+
}
47+
},
48+
"topologyType": "ReplicaSetWithPrimary",
49+
"logicalSessionTimeoutMinutes": null,
50+
"setName": "rs"
51+
}
52+
},
53+
{
54+
"description": "Non-stale topologyVersion greater NotWritablePrimary error marks server Unknown",
55+
"applicationErrors": [
56+
{
57+
"address": "a:27017",
58+
"when": "afterHandshakeCompletes",
59+
"maxWireVersion": 9,
60+
"type": "command",
61+
"response": {
62+
"ok": 0,
63+
"errmsg": "NotWritablePrimary",
64+
"code": 10107,
65+
"topologyVersion": {
66+
"processId": {
67+
"$oid": "000000000000000000000001"
68+
},
69+
"counter": {
70+
"$numberLong": "2"
71+
}
72+
}
73+
}
74+
}
75+
],
76+
"outcome": {
77+
"servers": {
78+
"a:27017": {
79+
"type": "Unknown",
80+
"topologyVersion": {
81+
"processId": {
82+
"$oid": "000000000000000000000001"
83+
},
84+
"counter": {
85+
"$numberLong": "2"
86+
}
87+
},
88+
"pool": {
89+
"generation": 0
90+
}
91+
}
92+
},
93+
"topologyType": "ReplicaSetNoPrimary",
94+
"logicalSessionTimeoutMinutes": null,
95+
"setName": "rs"
96+
}
97+
}
98+
]
99+
}

0 commit comments

Comments
 (0)