Skip to content

Commit

Permalink
GODRIVER-2420 sync validatorAndPartialFieldExpression + create-and-cr…
Browse files Browse the repository at this point in the history
…eateIndexes tests (#967)

* resync tests

* use 1.5.0-alpha2
  • Loading branch information
kevinAlbs committed May 31, 2022
1 parent a80272f commit 29d083a
Show file tree
Hide file tree
Showing 7 changed files with 1,669 additions and 0 deletions.
115 changes: 115 additions & 0 deletions data/client-side-encryption/create-and-createIndexes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"runOn": [
{
"minServerVersion": "4.1.10"
}
],
"database_name": "default",
"collection_name": "default",
"data": [],
"tests": [
{
"description": "create is OK",
"clientOptions": {
"autoEncryptOpts": {
"kmsProviders": {
"local": {
"key": {
"$binary": {
"base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
"subType": "00"
}
}
}
}
}
},
"operations": [
{
"name": "dropCollection",
"object": "database",
"arguments": {
"collection": "unencryptedCollection"
}
},
{
"name": "createCollection",
"object": "database",
"arguments": {
"collection": "unencryptedCollection",
"validator": {
"unencrypted_string": "foo"
}
}
},
{
"name": "assertCollectionExists",
"object": "testRunner",
"arguments": {
"database": "default",
"collection": "unencryptedCollection"
}
}
]
},
{
"description": "createIndexes is OK",
"clientOptions": {
"autoEncryptOpts": {
"kmsProviders": {
"local": {
"key": {
"$binary": {
"base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk",
"subType": "00"
}
}
}
}
}
},
"operations": [
{
"name": "dropCollection",
"object": "database",
"arguments": {
"collection": "unencryptedCollection"
}
},
{
"name": "createCollection",
"object": "database",
"arguments": {
"collection": "unencryptedCollection"
}
},
{
"name": "runCommand",
"object": "database",
"arguments": {
"command": {
"createIndexes": "unencryptedCollection",
"indexes": [
{
"name": "name",
"key": {
"name": 1
}
}
]
}
}
},
{
"name": "assertIndexExists",
"object": "testRunner",
"arguments": {
"database": "default",
"collection": "unencryptedCollection",
"index": "name"
}
}
]
}
]
}
58 changes: 58 additions & 0 deletions data/client-side-encryption/create-and-createIndexes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
runOn:
- minServerVersion: "4.1.10"
database_name: &database_name "default"
collection_name: &collection_name "default"

data: []
tests:
- description: "create is OK"
clientOptions:
autoEncryptOpts:
kmsProviders:
local: {'key': {'$binary': {'base64': 'Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk', 'subType': '00'}}}
operations:
# Drop to remove a collection that may exist from previous test runs.
- name: dropCollection
object: database
arguments:
collection: "unencryptedCollection"
- name: createCollection
object: database
arguments:
collection: "unencryptedCollection"
validator:
unencrypted_string: "foo"
- name: assertCollectionExists
object: testRunner
arguments:
database: *database_name
collection: "unencryptedCollection"
- description: "createIndexes is OK"
clientOptions:
autoEncryptOpts:
kmsProviders:
local: {'key': {'$binary': {'base64': 'Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk', 'subType': '00'}}}
operations:
# Drop to remove a collection that may exist from previous test runs.
- name: dropCollection
object: database
arguments:
collection: "unencryptedCollection"
- name: createCollection
object: database
arguments:
collection: "unencryptedCollection"
- name: runCommand
object: database
arguments:
command:
createIndexes: "unencryptedCollection"
indexes:
- name: "name"
key: { name: 1 }
- name: assertIndexExists
object: testRunner
arguments:
database: *database_name
collection: "unencryptedCollection"
index: name
Loading

0 comments on commit 29d083a

Please sign in to comment.