Skip to content

Commit 249120b

Browse files
committed
update spec tests
1 parent 3f7bc45 commit 249120b

File tree

76 files changed

+532
-145
lines changed

Some content is hidden

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

76 files changed

+532
-145
lines changed

testdata/client-side-encryption/legacy/fle2v2-Compact.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@
130130
"command": {
131131
"compactStructuredEncryptionData": "default"
132132
}
133+
},
134+
"result": {
135+
"ok": 1
133136
}
134137
}
135138
],

testdata/client-side-encryption/legacy/fle2v2-Compact.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Requires libmongocrypt 1.8.0.
1+
# Requires libmongocrypt 1.8.0. libmongocrypt 1.10.0 has a bug (MONGOCRYPT-699) that may cause this test to fail on server version 7.
22
runOn:
33
- minServerVersion: "7.0.0"
44
# Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol.
@@ -22,6 +22,8 @@ tests:
2222
arguments:
2323
command:
2424
compactStructuredEncryptionData: *collection_name
25+
result:
26+
ok: 1
2527
expectations:
2628
- command_started_event:
2729
command:
Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
{
2+
"runOn": [
3+
{
4+
"minServerVersion": "8.0.0",
5+
"topology": [
6+
"replicaset",
7+
"sharded",
8+
"load-balanced"
9+
]
10+
}
11+
],
12+
"database_name": "default",
13+
"collection_name": "default",
14+
"data": [],
15+
"encrypted_fields": {
16+
"fields": [
17+
{
18+
"keyId": {
19+
"$binary": {
20+
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
21+
"subType": "04"
22+
}
23+
},
24+
"path": "encryptedInt",
25+
"bsonType": "int",
26+
"queries": {
27+
"queryType": "range",
28+
"contention": {
29+
"$numberLong": "0"
30+
},
31+
"trimFactor": {
32+
"$numberInt": "1"
33+
},
34+
"sparsity": {
35+
"$numberLong": "1"
36+
},
37+
"min": {
38+
"$numberInt": "0"
39+
},
40+
"max": {
41+
"$numberInt": "200"
42+
}
43+
}
44+
}
45+
]
46+
},
47+
"key_vault_data": [
48+
{
49+
"_id": {
50+
"$binary": {
51+
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
52+
"subType": "04"
53+
}
54+
},
55+
"keyMaterial": {
56+
"$binary": {
57+
"base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==",
58+
"subType": "00"
59+
}
60+
},
61+
"creationDate": {
62+
"$date": {
63+
"$numberLong": "1648914851981"
64+
}
65+
},
66+
"updateDate": {
67+
"$date": {
68+
"$numberLong": "1648914851981"
69+
}
70+
},
71+
"status": {
72+
"$numberInt": "0"
73+
},
74+
"masterKey": {
75+
"provider": "local"
76+
}
77+
}
78+
],
79+
"tests": [
80+
{
81+
"description": "Compact works with 'range' fields",
82+
"clientOptions": {
83+
"autoEncryptOpts": {
84+
"kmsProviders": {
85+
"local": {
86+
"key": {
87+
"$binary": {
88+
"base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
89+
"subType": "00"
90+
}
91+
}
92+
}
93+
}
94+
}
95+
},
96+
"operations": [
97+
{
98+
"name": "insertOne",
99+
"arguments": {
100+
"document": {
101+
"_id": 0,
102+
"encryptedInt": {
103+
"$numberInt": "0"
104+
}
105+
}
106+
}
107+
},
108+
{
109+
"name": "runCommand",
110+
"object": "database",
111+
"command_name": "compactStructuredEncryptionData",
112+
"arguments": {
113+
"command": {
114+
"compactStructuredEncryptionData": "default"
115+
}
116+
},
117+
"result": {
118+
"ok": 1
119+
}
120+
}
121+
],
122+
"expectations": [
123+
{
124+
"command_started_event": {
125+
"command": {
126+
"listCollections": 1,
127+
"filter": {
128+
"name": "default"
129+
}
130+
},
131+
"command_name": "listCollections"
132+
}
133+
},
134+
{
135+
"command_started_event": {
136+
"command": {
137+
"find": "datakeys",
138+
"filter": {
139+
"$or": [
140+
{
141+
"_id": {
142+
"$in": [
143+
{
144+
"$binary": {
145+
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
146+
"subType": "04"
147+
}
148+
}
149+
]
150+
}
151+
},
152+
{
153+
"keyAltNames": {
154+
"$in": []
155+
}
156+
}
157+
]
158+
},
159+
"$db": "keyvault",
160+
"readConcern": {
161+
"level": "majority"
162+
}
163+
},
164+
"command_name": "find"
165+
}
166+
},
167+
{
168+
"command_started_event": {
169+
"command": {
170+
"insert": "default",
171+
"documents": [
172+
{
173+
"_id": 0,
174+
"encryptedInt": {
175+
"$$type": "binData"
176+
}
177+
}
178+
],
179+
"ordered": true,
180+
"encryptionInformation": {
181+
"type": 1,
182+
"schema": {
183+
"default.default": {
184+
"escCollection": "enxcol_.default.esc",
185+
"ecocCollection": "enxcol_.default.ecoc",
186+
"fields": [
187+
{
188+
"keyId": {
189+
"$binary": {
190+
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
191+
"subType": "04"
192+
}
193+
},
194+
"path": "encryptedInt",
195+
"bsonType": "int",
196+
"queries": {
197+
"queryType": "range",
198+
"contention": {
199+
"$numberLong": "0"
200+
},
201+
"trimFactor": {
202+
"$numberInt": "1"
203+
},
204+
"sparsity": {
205+
"$numberLong": "1"
206+
},
207+
"min": {
208+
"$numberInt": "0"
209+
},
210+
"max": {
211+
"$numberInt": "200"
212+
}
213+
}
214+
}
215+
]
216+
}
217+
}
218+
}
219+
},
220+
"command_name": "insert"
221+
}
222+
},
223+
{
224+
"command_started_event": {
225+
"command": {
226+
"compactStructuredEncryptionData": "default",
227+
"compactionTokens": {
228+
"encryptedInt": {
229+
"ecoc": {
230+
"$binary": {
231+
"base64": "noN+05JsuO1oDg59yypIGj45i+eFH6HOTXOPpeZ//Mk=",
232+
"subType": "00"
233+
}
234+
},
235+
"anchorPaddingToken": {
236+
"$binary": {
237+
"base64": "QxKJD2If48p0l8NAXf2Kr0aleMd/dATSjBK6hTpNMyc=",
238+
"subType": "00"
239+
}
240+
}
241+
}
242+
},
243+
"encryptionInformation": {
244+
"type": 1,
245+
"schema": {
246+
"default.default": {
247+
"escCollection": "enxcol_.default.esc",
248+
"ecocCollection": "enxcol_.default.ecoc",
249+
"fields": [
250+
{
251+
"keyId": {
252+
"$binary": {
253+
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
254+
"subType": "04"
255+
}
256+
},
257+
"path": "encryptedInt",
258+
"bsonType": "int",
259+
"queries": {
260+
"queryType": "range",
261+
"contention": {
262+
"$numberLong": "0"
263+
},
264+
"trimFactor": {
265+
"$numberInt": "1"
266+
},
267+
"sparsity": {
268+
"$numberLong": "1"
269+
},
270+
"min": {
271+
"$numberInt": "0"
272+
},
273+
"max": {
274+
"$numberInt": "200"
275+
}
276+
}
277+
}
278+
]
279+
}
280+
}
281+
}
282+
},
283+
"command_name": "compactStructuredEncryptionData"
284+
}
285+
}
286+
]
287+
}
288+
]
289+
}

0 commit comments

Comments
 (0)