Skip to content

Commit 186d0c8

Browse files
committed
test(NODE-4271): test create createIndexes and collmod
1 parent 74c261a commit 186d0c8

6 files changed

+1669
-0
lines changed
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{
2+
"runOn": [
3+
{
4+
"minServerVersion": "4.1.10"
5+
}
6+
],
7+
"database_name": "default",
8+
"collection_name": "default",
9+
"data": [],
10+
"tests": [
11+
{
12+
"description": "create is OK",
13+
"clientOptions": {
14+
"autoEncryptOpts": {
15+
"kmsProviders": {
16+
"local": {
17+
"key": {
18+
"$binary": {
19+
"base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
20+
"subType": "00"
21+
}
22+
}
23+
}
24+
}
25+
}
26+
},
27+
"operations": [
28+
{
29+
"name": "dropCollection",
30+
"object": "database",
31+
"arguments": {
32+
"collection": "unencryptedCollection"
33+
}
34+
},
35+
{
36+
"name": "createCollection",
37+
"object": "database",
38+
"arguments": {
39+
"collection": "unencryptedCollection",
40+
"validator": {
41+
"unencrypted_string": "foo"
42+
}
43+
}
44+
},
45+
{
46+
"name": "assertCollectionExists",
47+
"object": "testRunner",
48+
"arguments": {
49+
"database": "default",
50+
"collection": "unencryptedCollection"
51+
}
52+
}
53+
]
54+
},
55+
{
56+
"description": "createIndexes is OK",
57+
"clientOptions": {
58+
"autoEncryptOpts": {
59+
"kmsProviders": {
60+
"local": {
61+
"key": {
62+
"$binary": {
63+
"base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
64+
"subType": "00"
65+
}
66+
}
67+
}
68+
}
69+
}
70+
},
71+
"operations": [
72+
{
73+
"name": "dropCollection",
74+
"object": "database",
75+
"arguments": {
76+
"collection": "unencryptedCollection"
77+
}
78+
},
79+
{
80+
"name": "createCollection",
81+
"object": "database",
82+
"arguments": {
83+
"collection": "unencryptedCollection"
84+
}
85+
},
86+
{
87+
"name": "runCommand",
88+
"object": "database",
89+
"arguments": {
90+
"command": {
91+
"createIndexes": "unencryptedCollection",
92+
"indexes": [
93+
{
94+
"name": "name",
95+
"key": {
96+
"name": 1
97+
}
98+
}
99+
]
100+
}
101+
}
102+
},
103+
{
104+
"name": "assertIndexExists",
105+
"object": "testRunner",
106+
"arguments": {
107+
"database": "default",
108+
"collection": "unencryptedCollection",
109+
"index": "name"
110+
}
111+
}
112+
]
113+
}
114+
]
115+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
runOn:
2+
- minServerVersion: "4.1.10"
3+
database_name: &database_name "default"
4+
collection_name: &collection_name "default"
5+
6+
data: []
7+
tests:
8+
- description: "create is OK"
9+
clientOptions:
10+
autoEncryptOpts:
11+
kmsProviders:
12+
local: {'key': {'$binary': {'base64': 'Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk', 'subType': '00'}}}
13+
operations:
14+
# Drop to remove a collection that may exist from previous test runs.
15+
- name: dropCollection
16+
object: database
17+
arguments:
18+
collection: "unencryptedCollection"
19+
- name: createCollection
20+
object: database
21+
arguments:
22+
collection: "unencryptedCollection"
23+
validator:
24+
unencrypted_string: "foo"
25+
- name: assertCollectionExists
26+
object: testRunner
27+
arguments:
28+
database: *database_name
29+
collection: "unencryptedCollection"
30+
- description: "createIndexes is OK"
31+
clientOptions:
32+
autoEncryptOpts:
33+
kmsProviders:
34+
local: {'key': {'$binary': {'base64': 'Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk', 'subType': '00'}}}
35+
operations:
36+
# Drop to remove a collection that may exist from previous test runs.
37+
- name: dropCollection
38+
object: database
39+
arguments:
40+
collection: "unencryptedCollection"
41+
- name: createCollection
42+
object: database
43+
arguments:
44+
collection: "unencryptedCollection"
45+
- name: runCommand
46+
object: database
47+
arguments:
48+
command:
49+
createIndexes: "unencryptedCollection"
50+
indexes:
51+
- name: "name"
52+
key: { name: 1 }
53+
- name: assertIndexExists
54+
object: testRunner
55+
arguments:
56+
database: *database_name
57+
collection: "unencryptedCollection"
58+
index: name

0 commit comments

Comments
 (0)