Skip to content

Commit e2368e1

Browse files
committed
sync tests
1 parent cff208c commit e2368e1

File tree

5 files changed

+1697
-0
lines changed

5 files changed

+1697
-0
lines changed
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
{
2+
"description": "QE-Text-cleanupStructuredEncryptionData",
3+
"schemaVersion": "1.23",
4+
"runOnRequirements": [
5+
{
6+
"minServerVersion": "8.2.0",
7+
"topologies": [
8+
"replicaset",
9+
"sharded",
10+
"load-balanced"
11+
],
12+
"csfle": true
13+
}
14+
],
15+
"createEntities": [
16+
{
17+
"client": {
18+
"id": "client",
19+
"autoEncryptOpts": {
20+
"keyVaultNamespace": "keyvault.datakeys",
21+
"kmsProviders": {
22+
"local": {
23+
"key": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk"
24+
}
25+
}
26+
},
27+
"observeEvents": [
28+
"commandStartedEvent"
29+
]
30+
}
31+
},
32+
{
33+
"database": {
34+
"id": "db",
35+
"client": "client",
36+
"databaseName": "db"
37+
}
38+
},
39+
{
40+
"collection": {
41+
"id": "coll",
42+
"database": "db",
43+
"collectionName": "coll"
44+
}
45+
}
46+
],
47+
"initialData": [
48+
{
49+
"databaseName": "db",
50+
"collectionName": "coll",
51+
"documents": [],
52+
"createOptions": {
53+
"encryptedFields": {
54+
"fields": [
55+
{
56+
"keyId": {
57+
"$binary": {
58+
"base64": "q83vqxI0mHYSNBI0VniQEg==",
59+
"subType": "04"
60+
}
61+
},
62+
"path": "encryptedText",
63+
"bsonType": "string",
64+
"queries": [
65+
{
66+
"queryType": "prefixPreview",
67+
"contention": {
68+
"$numberLong": "0"
69+
},
70+
"strMinQueryLength": {
71+
"$numberLong": "3"
72+
},
73+
"strMaxQueryLength": {
74+
"$numberLong": "30"
75+
},
76+
"caseSensitive": true,
77+
"diacriticSensitive": true
78+
}
79+
]
80+
}
81+
]
82+
}
83+
}
84+
},
85+
{
86+
"databaseName": "keyvault",
87+
"collectionName": "datakeys",
88+
"documents": [
89+
{
90+
"_id": {
91+
"$binary": {
92+
"base64": "q83vqxI0mHYSNBI0VniQEg==",
93+
"subType": "04"
94+
}
95+
},
96+
"keyMaterial": {
97+
"$binary": {
98+
"base64": "HBk9BWihXExNDvTp1lUxOuxuZK2Pe2ZdVdlsxPEBkiO1bS4mG5NNDsQ7zVxJAH8BtdOYp72Ku4Y3nwc0BUpIKsvAKX4eYXtlhv5zUQxWdeNFhg9qK7qb8nqhnnLeT0f25jFSqzWJoT379hfwDeu0bebJHr35QrJ8myZdPMTEDYF08QYQ48ShRBli0S+QzBHHAQiM2iJNr4svg2WR8JSeWQ==",
99+
"subType": "00"
100+
}
101+
},
102+
"creationDate": {
103+
"$date": {
104+
"$numberLong": "1648914851981"
105+
}
106+
},
107+
"updateDate": {
108+
"$date": {
109+
"$numberLong": "1648914851981"
110+
}
111+
},
112+
"status": {
113+
"$numberInt": "0"
114+
},
115+
"masterKey": {
116+
"provider": "local"
117+
}
118+
}
119+
]
120+
}
121+
],
122+
"tests": [
123+
{
124+
"description": "QE Text cleanupStructuredEncryptionData works",
125+
"operations": [
126+
{
127+
"name": "runCommand",
128+
"object": "db",
129+
"arguments": {
130+
"command": {
131+
"cleanupStructuredEncryptionData": "coll"
132+
},
133+
"commandName": "cleanupStructuredEncryptionData"
134+
},
135+
"expectResult": {
136+
"ok": 1
137+
}
138+
}
139+
],
140+
"expectEvents": [
141+
{
142+
"client": "client",
143+
"events": [
144+
{
145+
"commandStartedEvent": {
146+
"command": {
147+
"listCollections": 1,
148+
"filter": {
149+
"name": "coll"
150+
}
151+
},
152+
"commandName": "listCollections"
153+
}
154+
},
155+
{
156+
"commandStartedEvent": {
157+
"command": {
158+
"find": "datakeys",
159+
"filter": {
160+
"$or": [
161+
{
162+
"_id": {
163+
"$in": [
164+
{
165+
"$binary": {
166+
"base64": "q83vqxI0mHYSNBI0VniQEg==",
167+
"subType": "04"
168+
}
169+
}
170+
]
171+
}
172+
},
173+
{
174+
"keyAltNames": {
175+
"$in": []
176+
}
177+
}
178+
]
179+
},
180+
"$db": "keyvault",
181+
"readConcern": {
182+
"level": "majority"
183+
}
184+
},
185+
"commandName": "find"
186+
}
187+
},
188+
{
189+
"commandStartedEvent": {
190+
"command": {
191+
"cleanupStructuredEncryptionData": "coll",
192+
"cleanupTokens": {
193+
"encryptedText": {
194+
"ecoc": {
195+
"$binary": {
196+
"base64": "SWO8WEoZ2r2Kx/muQKb7+COizy85nIIUFiHh4K9kcvA=",
197+
"subType": "00"
198+
}
199+
},
200+
"anchorPaddingToken": {
201+
"$binary": {
202+
"base64": "YAiF7Iwhqq1UyfxPvm70xfQJtrIRPrjfD2yRLG1+saQ=",
203+
"subType": "00"
204+
}
205+
}
206+
}
207+
}
208+
},
209+
"commandName": "cleanupStructuredEncryptionData"
210+
}
211+
}
212+
]
213+
}
214+
]
215+
}
216+
]
217+
}

0 commit comments

Comments
 (0)