1
+ # This test requires libmongocrypt 1.5.0-alpha2.
2
+ runOn:
3
+ # Require server version 6.0.0 to get behavior added in SERVER-64911.
4
+ - minServerVersion: "6.0.0"
5
+ # FLE 2 Encrypted collections are not supported on standalone.
6
+ topology: [ "replicaset", "sharded" ]
7
+
8
+ database_name: &database_name "default"
9
+ collection_name: &collection_name "default"
10
+ data: []
11
+ tests:
12
+ - description: "create with a validator on an unencrypted field is OK"
13
+ clientOptions:
14
+ autoEncryptOpts:
15
+ kmsProviders:
16
+ local: {{ local_provider() }}
17
+ encryptedFieldsMap:
18
+ "default.encryptedCollection": {{ yamlfile ("encryptedFields.json") }}
19
+ operations:
20
+ # Drop to remove a collection that may exist from previous test runs.
21
+ - name: dropCollection
22
+ object: database
23
+ arguments:
24
+ collection: "encryptedCollection"
25
+ - name: createCollection
26
+ object: database
27
+ arguments:
28
+ collection: "encryptedCollection"
29
+ validator:
30
+ unencrypted_string: "foo"
31
+ - name: assertCollectionExists
32
+ object: testRunner
33
+ arguments:
34
+ database: *database_name
35
+ collection: "encryptedCollection"
36
+ - description: "create with a validator on an encrypted field is an error"
37
+ clientOptions:
38
+ autoEncryptOpts:
39
+ kmsProviders:
40
+ local: {{ local_provider() }}
41
+ encryptedFieldsMap:
42
+ "default.encryptedCollection": {{ yamlfile ("encryptedFields.json") }}
43
+ operations:
44
+ # Drop to remove a collection that may exist from previous test runs.
45
+ - name: dropCollection
46
+ object: database
47
+ arguments:
48
+ collection: "encryptedCollection"
49
+ - name: createCollection
50
+ object: database
51
+ arguments:
52
+ collection: "encryptedCollection"
53
+ validator:
54
+ encryptedIndexed: "foo"
55
+ result:
56
+ errorContains: "Comparison to encrypted fields not supported"
57
+ - description: "collMod with a validator on an unencrypted field is OK"
58
+ clientOptions:
59
+ autoEncryptOpts:
60
+ kmsProviders:
61
+ local: {{ local_provider() }}
62
+ encryptedFieldsMap:
63
+ "default.encryptedCollection": {{ yamlfile ("encryptedFields.json") }}
64
+ operations:
65
+ # Drop to remove a collection that may exist from previous test runs.
66
+ - name: dropCollection
67
+ object: database
68
+ arguments:
69
+ collection: "encryptedCollection"
70
+ - name: createCollection
71
+ object: database
72
+ arguments:
73
+ collection: "encryptedCollection"
74
+ - name: runCommand
75
+ object: database
76
+ arguments:
77
+ command:
78
+ collMod: "encryptedCollection"
79
+ validator:
80
+ unencrypted_string: "foo"
81
+ - description: "collMod with a validator on an encrypted field is an error"
82
+ clientOptions:
83
+ autoEncryptOpts:
84
+ kmsProviders:
85
+ local: {{ local_provider() }}
86
+ encryptedFieldsMap:
87
+ "default.encryptedCollection": {{ yamlfile ("encryptedFields.json") }}
88
+ operations:
89
+ # Drop to remove a collection that may exist from previous test runs.
90
+ - name: dropCollection
91
+ object: database
92
+ arguments:
93
+ collection: "encryptedCollection"
94
+ - name: createCollection
95
+ object: database
96
+ arguments:
97
+ collection: "encryptedCollection"
98
+ - name: runCommand
99
+ object: database
100
+ arguments:
101
+ command:
102
+ collMod: "encryptedCollection"
103
+ validator:
104
+ encryptedIndexed: "foo"
105
+ result:
106
+ errorContains: "Comparison to encrypted fields not supported"
107
+ - description: "createIndexes with a partialFilterExpression on an unencrypted field is OK"
108
+ clientOptions:
109
+ autoEncryptOpts:
110
+ kmsProviders:
111
+ local: {{ local_provider() }}
112
+ encryptedFieldsMap:
113
+ "default.encryptedCollection": {{ yamlfile ("encryptedFields.json") }}
114
+ operations:
115
+ # Drop to remove a collection that may exist from previous test runs.
116
+ - name: dropCollection
117
+ object: database
118
+ arguments:
119
+ collection: "encryptedCollection"
120
+ - name: createCollection
121
+ object: database
122
+ arguments:
123
+ collection: "encryptedCollection"
124
+ - name: runCommand
125
+ object: database
126
+ arguments:
127
+ command:
128
+ createIndexes: "encryptedCollection"
129
+ indexes:
130
+ - name: "name"
131
+ key: { name: 1 }
132
+ partialFilterExpression:
133
+ unencrypted_string: "foo"
134
+ - name: assertIndexExists
135
+ object: testRunner
136
+ arguments:
137
+ database: *database_name
138
+ collection: "encryptedCollection"
139
+ index: name
140
+ - description: "createIndexes with a partialFilterExpression on an encrypted field is an error"
141
+ clientOptions:
142
+ autoEncryptOpts:
143
+ kmsProviders:
144
+ local: {{ local_provider() }}
145
+ encryptedFieldsMap:
146
+ "default.encryptedCollection": {{ yamlfile ("encryptedFields.json") }}
147
+ operations:
148
+ # Drop to remove a collection that may exist from previous test runs.
149
+ - name: dropCollection
150
+ object: database
151
+ arguments:
152
+ collection: "encryptedCollection"
153
+ - name: createCollection
154
+ object: database
155
+ arguments:
156
+ collection: "encryptedCollection"
157
+ - name: runCommand
158
+ object: database
159
+ arguments:
160
+ command:
161
+ createIndexes: "encryptedCollection"
162
+ indexes:
163
+ - name: "name"
164
+ key: { name: 1 }
165
+ partialFilterExpression:
166
+ encryptedIndexed: "foo"
167
+ result:
168
+ errorContains: "Comparison to encrypted fields not supported"
0 commit comments