diff --git a/test/auth/legacy/connection-string.json b/test/auth/legacy/connection-string.json index 3a099c8137..8982b61d5a 100644 --- a/test/auth/legacy/connection-string.json +++ b/test/auth/legacy/connection-string.json @@ -440,6 +440,21 @@ } } }, + { + "description": "should throw an exception if username provided (MONGODB-AWS)", + "uri": "mongodb://user@localhost.com/?authMechanism=MONGODB-AWS", + "valid": false + }, + { + "description": "should throw an exception if username and password provided (MONGODB-AWS)", + "uri": "mongodb://user:pass@localhost.com/?authMechanism=MONGODB-AWS", + "valid": false + }, + { + "description": "should throw an exception if AWS_SESSION_TOKEN provided (MONGODB-AWS)", + "uri": "mongodb://localhost/?authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:token", + "valid": false + }, { "description": "should recognise the mechanism with test environment (MONGODB-OIDC)", "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:test", diff --git a/test/client-side-encryption/etc/data/encryptedFields-prefix-suffix-ci-di.json b/test/client-side-encryption/etc/data/encryptedFields-prefix-suffix-ci-di.json index c43bf9390d..3002c642b2 100644 --- a/test/client-side-encryption/etc/data/encryptedFields-prefix-suffix-ci-di.json +++ b/test/client-side-encryption/etc/data/encryptedFields-prefix-suffix-ci-di.json @@ -11,7 +11,7 @@ "bsonType": "string", "queries": [ { - "queryType": "prefixPreview", + "queryType": "prefix", "strMinQueryLength": { "$numberInt": "2" }, @@ -23,7 +23,7 @@ "diacriticSensitive": false }, { - "queryType": "suffixPreview", + "queryType": "suffix", "strMinQueryLength": { "$numberInt": "2" }, diff --git a/test/client-side-encryption/etc/data/encryptedFields-prefix-suffix.json b/test/client-side-encryption/etc/data/encryptedFields-prefix-suffix.json index ec4489fa09..141c372dbe 100644 --- a/test/client-side-encryption/etc/data/encryptedFields-prefix-suffix.json +++ b/test/client-side-encryption/etc/data/encryptedFields-prefix-suffix.json @@ -1,6 +1,6 @@ { - "fields": [ - { + "fields": [ + { "keyId": { "$binary": { "base64": "EjRWeBI0mHYSNBI0VniQEg==", @@ -11,7 +11,7 @@ "bsonType": "string", "queries": [ { - "queryType": "prefixPreview", + "queryType": "prefix", "strMinQueryLength": { "$numberInt": "2" }, @@ -22,7 +22,7 @@ "diacriticSensitive": true }, { - "queryType": "suffixPreview", + "queryType": "suffix", "strMinQueryLength": { "$numberInt": "2" }, @@ -34,5 +34,5 @@ } ] } - ] + ] } diff --git a/test/client-side-encryption/spec/unified/QE-Text-cleanupStructuredEncryptionData.json b/test/client-side-encryption/spec/unified/QE-Text-cleanupStructuredEncryptionData.json index fd74573ea2..dc979b5019 100644 --- a/test/client-side-encryption/spec/unified/QE-Text-cleanupStructuredEncryptionData.json +++ b/test/client-side-encryption/spec/unified/QE-Text-cleanupStructuredEncryptionData.json @@ -3,15 +3,14 @@ "schemaVersion": "1.25", "runOnRequirements": [ { - "minServerVersion": "8.2.0", - "maxServerVersion": "8.99.99", + "minServerVersion": "9.0.0", "topologies": [ "replicaset", "sharded", "load-balanced" ], "csfle": { - "minLibmongocryptVersion": "1.15.0" + "minLibmongocryptVersion": "1.19.0" } } ], @@ -102,7 +101,7 @@ "bsonType": "string", "queries": [ { - "queryType": "suffixPreview", + "queryType": "suffix", "contention": { "$numberLong": "0" }, diff --git a/test/client-side-encryption/spec/unified/QE-Text-compactStructuredEncryptionData.json b/test/client-side-encryption/spec/unified/QE-Text-compactStructuredEncryptionData.json index a89ab96fc4..1c3c6cc0de 100644 --- a/test/client-side-encryption/spec/unified/QE-Text-compactStructuredEncryptionData.json +++ b/test/client-side-encryption/spec/unified/QE-Text-compactStructuredEncryptionData.json @@ -3,15 +3,14 @@ "schemaVersion": "1.25", "runOnRequirements": [ { - "minServerVersion": "8.2.0", - "maxServerVersion": "8.99.99", + "minServerVersion": "9.0.0", "topologies": [ "replicaset", "sharded", "load-balanced" ], "csfle": { - "minLibmongocryptVersion": "1.15.0" + "minLibmongocryptVersion": "1.19.0" } } ], @@ -102,7 +101,7 @@ "bsonType": "string", "queries": [ { - "queryType": "suffixPreview", + "queryType": "suffix", "contention": { "$numberLong": "0" }, @@ -210,7 +209,7 @@ "bsonType": "string", "queries": [ { - "queryType": "suffixPreview", + "queryType": "suffix", "contention": { "$numberLong": "0" }, diff --git a/test/client-side-encryption/spec/unified/QE-Text-prefixPreview.json b/test/client-side-encryption/spec/unified/QE-Text-prefix.json similarity index 97% rename from test/client-side-encryption/spec/unified/QE-Text-prefixPreview.json rename to test/client-side-encryption/spec/unified/QE-Text-prefix.json index c193608e88..25475e2c3a 100644 --- a/test/client-side-encryption/spec/unified/QE-Text-prefixPreview.json +++ b/test/client-side-encryption/spec/unified/QE-Text-prefix.json @@ -1,17 +1,16 @@ { - "description": "QE-Text-prefixPreview", + "description": "QE-Text-prefix", "schemaVersion": "1.25", "runOnRequirements": [ { - "minServerVersion": "8.2.0", - "maxServerVersion": "8.99.99", + "minServerVersion": "9.0.0", "topologies": [ "replicaset", "sharded", "load-balanced" ], "csfle": { - "minLibmongocryptVersion": "1.15.0" + "minLibmongocryptVersion": "1.19.0" } } ], @@ -102,7 +101,7 @@ "bsonType": "string", "queries": [ { - "queryType": "prefixPreview", + "queryType": "prefix", "contention": { "$numberLong": "0" }, @@ -124,7 +123,7 @@ ], "tests": [ { - "description": "Insert QE prefixPreview", + "description": "Insert QE prefix", "operations": [ { "name": "insertOne", diff --git a/test/client-side-encryption/spec/unified/QE-Text-suffixPreview.json b/test/client-side-encryption/spec/unified/QE-Text-suffix.json similarity index 96% rename from test/client-side-encryption/spec/unified/QE-Text-suffixPreview.json rename to test/client-side-encryption/spec/unified/QE-Text-suffix.json index 2de5cde4a4..ad6cdc06c9 100644 --- a/test/client-side-encryption/spec/unified/QE-Text-suffixPreview.json +++ b/test/client-side-encryption/spec/unified/QE-Text-suffix.json @@ -1,17 +1,16 @@ { - "description": "QE-Text-suffixPreview", + "description": "QE-Text-suffix", "schemaVersion": "1.25", "runOnRequirements": [ { - "minServerVersion": "8.2.0", - "maxServerVersion": "8.99.99", + "minServerVersion": "9.0.0", "topologies": [ "replicaset", "sharded", "load-balanced" ], "csfle": { - "minLibmongocryptVersion": "1.15.0" + "minLibmongocryptVersion": "1.19.0" } } ], @@ -102,7 +101,7 @@ "bsonType": "string", "queries": [ { - "queryType": "suffixPreview", + "queryType": "suffix", "contention": { "$numberLong": "0" }, @@ -124,7 +123,7 @@ ], "tests": [ { - "description": "Insert QE suffixPreview", + "description": "Insert QE suffix", "operations": [ { "name": "insertOne", @@ -207,7 +206,7 @@ ] }, { - "description": "Query with matching $encStrStartsWith", + "description": "Query with matching $encStrEndsWith", "operations": [ { "name": "insertOne", diff --git a/test/client-side-encryption/spec/unified/accessToken-azure.json b/test/client-side-encryption/spec/unified/accessToken-azure.json new file mode 100644 index 0000000000..510d87956f --- /dev/null +++ b/test/client-side-encryption/spec/unified/accessToken-azure.json @@ -0,0 +1,186 @@ +{ + "description": "accessToken-azure", + "schemaVersion": "1.28", + "runOnRequirements": [ + { + "minServerVersion": "4.1.10", + "csfle": { + "minLibmongocryptVersion": "1.6.0" + } + } + ], + "createEntities": [ + { + "client": { + "id": "client", + "autoEncryptOpts": { + "keyVaultNamespace": "keyvault.datakeys", + "kmsProviders": { + "azure": { + "accessToken": { + "$$placeholder": 1 + } + } + } + } + } + }, + { + "database": { + "id": "db", + "client": "client", + "databaseName": "db" + } + }, + { + "collection": { + "id": "coll", + "database": "db", + "collectionName": "coll" + } + }, + { + "clientEncryption": { + "id": "clientEncryption", + "clientEncryptionOpts": { + "keyVaultClient": "client", + "keyVaultNamespace": "keyvault.datakeys", + "kmsProviders": { + "azure": { + "accessToken": { + "$$placeholder": 1 + } + } + } + } + } + } + ], + "initialData": [ + { + "databaseName": "db", + "collectionName": "coll", + "documents": [], + "createOptions": { + "validator": { + "$jsonSchema": { + "properties": { + "secret": { + "encrypt": { + "keyId": [ + { + "$binary": { + "base64": "AZURE+AAAAAAAAAAAAAAAA==", + "subType": "04" + } + } + ], + "bsonType": "string", + "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" + } + } + }, + "bsonType": "object" + } + } + } + }, + { + "databaseName": "keyvault", + "collectionName": "datakeys", + "documents": [ + { + "_id": { + "$binary": { + "base64": "AZURE+AAAAAAAAAAAAAAAA==", + "subType": "04" + } + }, + "keyAltNames": [ + "my-key" + ], + "keyMaterial": { + "$binary": { + "base64": "n+HWZ0ZSVOYA3cvQgP7inN4JSXfOH85IngmeQxRpQHjCCcqT3IFqEWNlrsVHiz3AELimHhX4HKqOLWMUeSIT6emUDDoQX9BAv8DR1+E1w4nGs/NyEneac78EYFkK3JysrFDOgl2ypCCTKAypkn9CkAx1if4cfgQE93LW4kczcyHdGiH36CIxrCDGv1UzAvERN5Qa47DVwsM6a+hWsF2AAAJVnF0wYLLJU07TuRHdMrrphPWXZsFgyV+lRqJ7DDpReKNO8nMPLV/mHqHBHGPGQiRdb9NoJo8CvokGz4+KE8oLwzKf6V24dtwZmRkrsDV4iOhvROAzz+Euo1ypSkL3mw==", + "subType": "00" + } + }, + "creationDate": { + "$date": { + "$numberLong": "1552949630483" + } + }, + "updateDate": { + "$date": { + "$numberLong": "1552949630483" + } + }, + "status": { + "$numberInt": "0" + }, + "masterKey": { + "provider": "azure", + "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", + "keyName": "key-name-csfle" + } + } + ] + } + ], + "tests": [ + { + "description": "Auto encrypt using access token Azure credentials", + "operations": [ + { + "name": "insertOne", + "arguments": { + "document": { + "_id": 1, + "secret": "string0" + } + }, + "object": "coll" + } + ], + "outcome": [ + { + "documents": [ + { + "_id": 1, + "secret": { + "$binary": { + "base64": "AQGVERPgAAAAAAAAAAAAAAAC5DbBSwPwfSlBrDtRuglvNvCXD1KzDuCKY2P+4bRFtHDjpTOE2XuytPAUaAbXf1orsPq59PVZmsbTZbt2CB8qaQ==", + "subType": "06" + } + } + } + ], + "collectionName": "coll", + "databaseName": "db" + } + ] + }, + { + "description": "Explicit encrypt using access token Azure credentials", + "operations": [ + { + "name": "encrypt", + "object": "clientEncryption", + "arguments": { + "value": "string0", + "opts": { + "keyAltName": "my-key", + "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" + } + }, + "expectResult": { + "$binary": { + "base64": "AQGVERPgAAAAAAAAAAAAAAAC5DbBSwPwfSlBrDtRuglvNvCXD1KzDuCKY2P+4bRFtHDjpTOE2XuytPAUaAbXf1orsPq59PVZmsbTZbt2CB8qaQ==", + "subType": "06" + } + } + } + ] + } + ] +} diff --git a/test/client-side-encryption/spec/unified/accessToken-gcp.json b/test/client-side-encryption/spec/unified/accessToken-gcp.json new file mode 100644 index 0000000000..f5cf8914f2 --- /dev/null +++ b/test/client-side-encryption/spec/unified/accessToken-gcp.json @@ -0,0 +1,188 @@ +{ + "description": "accessToken-gcp", + "schemaVersion": "1.28", + "runOnRequirements": [ + { + "minServerVersion": "4.1.10", + "csfle": { + "minLibmongocryptVersion": "1.6.0" + } + } + ], + "createEntities": [ + { + "client": { + "id": "client", + "autoEncryptOpts": { + "keyVaultNamespace": "keyvault.datakeys", + "kmsProviders": { + "gcp": { + "accessToken": { + "$$placeholder": 1 + } + } + } + } + } + }, + { + "database": { + "id": "db", + "client": "client", + "databaseName": "db" + } + }, + { + "collection": { + "id": "coll", + "database": "db", + "collectionName": "coll" + } + }, + { + "clientEncryption": { + "id": "clientEncryption", + "clientEncryptionOpts": { + "keyVaultClient": "client", + "keyVaultNamespace": "keyvault.datakeys", + "kmsProviders": { + "gcp": { + "accessToken": { + "$$placeholder": 1 + } + } + } + } + } + } + ], + "initialData": [ + { + "databaseName": "db", + "collectionName": "coll", + "documents": [], + "createOptions": { + "validator": { + "$jsonSchema": { + "properties": { + "secret": { + "encrypt": { + "keyId": [ + { + "$binary": { + "base64": "GCP+AAAAAAAAAAAAAAAAAA==", + "subType": "04" + } + } + ], + "bsonType": "string", + "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" + } + } + }, + "bsonType": "object" + } + } + } + }, + { + "databaseName": "keyvault", + "collectionName": "datakeys", + "documents": [ + { + "_id": { + "$binary": { + "base64": "GCP+AAAAAAAAAAAAAAAAAA==", + "subType": "04" + } + }, + "keyAltNames": [ + "my-key" + ], + "keyMaterial": { + "$binary": { + "base64": "CiQAIgLj0WyktnB4dfYHo5SLZ41K4ASQrjJUaSzl5vvVH0G12G0SiQEAjlV8XPlbnHDEDFbdTO4QIe8ER2/172U1ouLazG0ysDtFFIlSvWX5ZnZUrRMmp/R2aJkzLXEt/zf8Mn4Lfm+itnjgo5R9K4pmPNvvPKNZX5C16lrPT+aA+rd+zXFSmlMg3i5jnxvTdLHhg3G7Q/Uv1ZIJskKt95bzLoe0tUVzRWMYXLIEcohnQg==", + "subType": "00" + } + }, + "creationDate": { + "$date": { + "$numberLong": "1552949630483" + } + }, + "updateDate": { + "$date": { + "$numberLong": "1552949630483" + } + }, + "status": { + "$numberInt": "0" + }, + "masterKey": { + "provider": "gcp", + "projectId": "devprod-drivers", + "location": "global", + "keyRing": "key-ring-csfle", + "keyName": "key-name-csfle" + } + } + ] + } + ], + "tests": [ + { + "description": "Auto encrypt using access token GCP credentials", + "operations": [ + { + "name": "insertOne", + "arguments": { + "document": { + "_id": 1, + "secret": "string0" + } + }, + "object": "coll" + } + ], + "outcome": [ + { + "documents": [ + { + "_id": 1, + "secret": { + "$binary": { + "base64": "ARgj/gAAAAAAAAAAAAAAAAACwFd+Y5Ojw45GUXNvbcIpN9YkRdoHDHkR4kssdn0tIMKlDQOLFkWFY9X07IRlXsxPD8DcTiKnl6XINK28vhcGlg==", + "subType": "06" + } + } + } + ], + "collectionName": "coll", + "databaseName": "db" + } + ] + }, + { + "description": "Explicit encrypt using access token GCP credentials", + "operations": [ + { + "name": "encrypt", + "object": "clientEncryption", + "arguments": { + "value": "string0", + "opts": { + "keyAltName": "my-key", + "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" + } + }, + "expectResult": { + "$binary": { + "base64": "ARgj/gAAAAAAAAAAAAAAAAACwFd+Y5Ojw45GUXNvbcIpN9YkRdoHDHkR4kssdn0tIMKlDQOLFkWFY9X07IRlXsxPD8DcTiKnl6XINK28vhcGlg==", + "subType": "06" + } + } + } + ] + } + ] +} diff --git a/test/connection_logging/connection-logging.json b/test/connection_logging/connection-logging.json index 5799e834d7..72103b3cab 100644 --- a/test/connection_logging/connection-logging.json +++ b/test/connection_logging/connection-logging.json @@ -446,6 +446,22 @@ } } }, + { + "level": "debug", + "component": "connection", + "data": { + "message": "Connection pool cleared", + "serverHost": { + "$$type": "string" + }, + "serverPort": { + "$$type": [ + "int", + "long" + ] + } + } + }, { "level": "debug", "component": "connection", @@ -498,22 +514,6 @@ ] } } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool cleared", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } } ] } diff --git a/test/connection_monitoring/pool-create-min-size-error.json b/test/connection_monitoring/pool-create-min-size-error.json index 5c8ad02dbd..fe7489f401 100644 --- a/test/connection_monitoring/pool-create-min-size-error.json +++ b/test/connection_monitoring/pool-create-min-size-error.json @@ -49,15 +49,15 @@ "type": "ConnectionCreated", "address": 42 }, + { + "type": "ConnectionPoolCleared", + "address": 42 + }, { "type": "ConnectionClosed", "address": 42, "connectionId": 42, "reason": "error" - }, - { - "type": "ConnectionPoolCleared", - "address": 42 } ], "ignore": [ diff --git a/test/discovery_and_monitoring/unified/serverMonitoringMode.json b/test/discovery_and_monitoring/unified/serverMonitoringMode.json index e44fad1bcd..4b492f7d85 100644 --- a/test/discovery_and_monitoring/unified/serverMonitoringMode.json +++ b/test/discovery_and_monitoring/unified/serverMonitoringMode.json @@ -5,7 +5,8 @@ { "topologies": [ "single", - "sharded" + "sharded", + "sharded-replicaset" ], "serverless": "forbid" } diff --git a/test/load_balancer/cursors.json b/test/load_balancer/cursors.json index 27aaddd5b6..b11bf2c6fa 100644 --- a/test/load_balancer/cursors.json +++ b/test/load_balancer/cursors.json @@ -385,7 +385,7 @@ ] }, { - "description": "pinned connections are returned after an network error during getMore", + "description": "pinned connections are not returned after an network error during getMore", "operations": [ { "name": "failPoint", @@ -449,7 +449,7 @@ "object": "testRunner", "arguments": { "client": "client0", - "connections": 0 + "connections": 1 } }, { @@ -677,7 +677,7 @@ ] }, { - "description": "pinned connections are returned to the pool after a non-network error on getMore", + "description": "pinned connections are not returned to the pool after a non-network error on getMore", "operations": [ { "name": "failPoint", @@ -733,7 +733,7 @@ "object": "testRunner", "arguments": { "client": "client0", - "connections": 0 + "connections": 1 } }, { diff --git a/test/load_balancer/sdam-error-handling.json b/test/load_balancer/sdam-error-handling.json index 41bc90be7f..2107afe5b3 100644 --- a/test/load_balancer/sdam-error-handling.json +++ b/test/load_balancer/sdam-error-handling.json @@ -372,6 +372,9 @@ { "connectionCreatedEvent": {} }, + { + "poolClearedEvent": {} + }, { "connectionClosedEvent": { "reason": "error" @@ -381,9 +384,6 @@ "connectionCheckOutFailedEvent": { "reason": "connectionError" } - }, - { - "poolClearedEvent": {} } ] } diff --git a/test/server_selection_logging/operation-id.json b/test/server_selection_logging/operation-id.json index ccc2623166..72ebff60d8 100644 --- a/test/server_selection_logging/operation-id.json +++ b/test/server_selection_logging/operation-id.json @@ -197,7 +197,7 @@ } }, { - "level": "debug", + "level": "info", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", @@ -383,7 +383,7 @@ } }, { - "level": "debug", + "level": "info", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", diff --git a/test/server_selection_logging/replica-set.json b/test/server_selection_logging/replica-set.json index 830b1ea51a..5eba784bf2 100644 --- a/test/server_selection_logging/replica-set.json +++ b/test/server_selection_logging/replica-set.json @@ -184,7 +184,7 @@ } }, { - "level": "debug", + "level": "info", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", diff --git a/test/server_selection_logging/sharded.json b/test/server_selection_logging/sharded.json index 346c050f9e..d42fba9100 100644 --- a/test/server_selection_logging/sharded.json +++ b/test/server_selection_logging/sharded.json @@ -193,7 +193,7 @@ } }, { - "level": "debug", + "level": "info", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", diff --git a/test/server_selection_logging/standalone.json b/test/server_selection_logging/standalone.json index fa01ad9911..3b3eddd841 100644 --- a/test/server_selection_logging/standalone.json +++ b/test/server_selection_logging/standalone.json @@ -191,7 +191,7 @@ } }, { - "level": "debug", + "level": "info", "component": "serverSelection", "data": { "message": "Waiting for suitable server to become available", diff --git a/test/sessions/snapshot-sessions.json b/test/sessions/snapshot-sessions.json index 260f8b6f48..8f806ea759 100644 --- a/test/sessions/snapshot-sessions.json +++ b/test/sessions/snapshot-sessions.json @@ -988,6 +988,810 @@ } } ] + }, + { + "description": "Find operation with snapshot and snapshot time", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": {} + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + } + ] + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 3, + "x": 33 + } + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {} + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + } + ] + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {} + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + } + ] + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": {} + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 11 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "$$exists": false + } + }, + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "Distinct operation with snapshot and snapshot time", + "operations": [ + { + "name": "distinct", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": {}, + "fieldName": "x" + }, + "expectResult": [ + 11 + ] + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 3, + "x": 33 + } + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {}, + "fieldName": "x" + }, + "expectResult": [ + 11 + ] + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {}, + "fieldName": "x" + }, + "expectResult": [ + 11 + ] + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "filter": {}, + "fieldName": "x" + }, + "expectResult": [ + 11, + 33 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "$$exists": false + } + }, + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "Aggregate operation with snapshot and snapshot time", + "operations": [ + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "session": "session0", + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 1, + "x": 12 + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "session": "session2", + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "session": "session2", + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 1, + "x": 12 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "$$exists": false + } + }, + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "countDocuments operation with snapshot and snapshot time", + "operations": [ + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": {} + }, + "expectResult": 2 + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 3, + "x": 33 + } + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {} + }, + "expectResult": 2 + }, + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "session": "session2", + "filter": {} + }, + "expectResult": 2 + }, + { + "name": "countDocuments", + "object": "collection0", + "arguments": { + "filter": {} + }, + "expectResult": 3 + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + }, + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "$$exists": false + } + }, + "databaseName": "database0" + } + } + ] + } + ] + }, + { + "description": "Mixed operation with snapshot and snapshotTime", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "session": "session0", + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "getSnapshotTime", + "object": "session0", + "saveResultAsEntity": "savedSnapshotTime" + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "After" + }, + "expectResult": { + "_id": 1, + "x": 12 + } + }, + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "snapshot": true, + "snapshotTime": "savedSnapshotTime" + } + } + } + ] + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + } + }, + "expectResult": [ + { + "_id": 1, + "x": 12 + } + ] + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": 1 + } + } + ], + "session": "session2" + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "name": "distinct", + "object": "collection0", + "arguments": { + "fieldName": "x", + "filter": {}, + "session": "session2" + }, + "expectResult": [ + 11 + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$exists": false + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "find": "collection0", + "readConcern": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + } + } + }, + { + "commandStartedEvent": { + "command": { + "distinct": "collection0", + "readConcern": { + "level": "snapshot", + "atClusterTime": { + "$$matchesEntity": "savedSnapshotTime" + } + } + } + } + } + ] + } + ] } ] } diff --git a/test/unified-test-format/invalid/clientEncryptionOpts-kmsProviders-azure-accessToken-type.json b/test/unified-test-format/invalid/clientEncryptionOpts-kmsProviders-azure-accessToken-type.json new file mode 100644 index 0000000000..8fe5c150a1 --- /dev/null +++ b/test/unified-test-format/invalid/clientEncryptionOpts-kmsProviders-azure-accessToken-type.json @@ -0,0 +1,31 @@ +{ + "description": "clientEncryptionOpts-kmsProviders-azure-accessToken-type", + "schemaVersion": "1.28", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "clientEncryption": { + "id": "clientEncryption0", + "clientEncryptionOpts": { + "keyVaultClient": "client0", + "keyVaultNamespace": "keyvault.datakeys", + "kmsProviders": { + "azure": { + "accessToken": 0 + } + } + } + } + } + ], + "tests": [ + { + "description": "", + "operations": [] + } + ] +} diff --git a/test/unified-test-format/invalid/clientEncryptionOpts-kmsProviders-gcp-accessToken-type.json b/test/unified-test-format/invalid/clientEncryptionOpts-kmsProviders-gcp-accessToken-type.json new file mode 100644 index 0000000000..2284e26cb6 --- /dev/null +++ b/test/unified-test-format/invalid/clientEncryptionOpts-kmsProviders-gcp-accessToken-type.json @@ -0,0 +1,31 @@ +{ + "description": "clientEncryptionOpts-kmsProviders-gcp-accessToken-type", + "schemaVersion": "1.28", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "clientEncryption": { + "id": "clientEncryption0", + "clientEncryptionOpts": { + "keyVaultClient": "client0", + "keyVaultNamespace": "keyvault.datakeys", + "kmsProviders": { + "gcp": { + "accessToken": 0 + } + } + } + } + } + ], + "tests": [ + { + "description": "", + "operations": [] + } + ] +} diff --git a/test/unified-test-format/invalid/entity-client-observeTracingMessages-additionalProperties.json b/test/unified-test-format/invalid/entity-client-observeTracingMessages-additionalProperties.json new file mode 100644 index 0000000000..aa8046d28e --- /dev/null +++ b/test/unified-test-format/invalid/entity-client-observeTracingMessages-additionalProperties.json @@ -0,0 +1,20 @@ +{ + "description": "entity-client-observeTracingMessages-additionalProperties", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0", + "observeTracingMessages": { + "foo": "bar" + } + } + } + ], + "tests": [ + { + "description": "observeTracingMessages must not have additional properties'", + "operations": [] + } + ] +} diff --git a/test/unified-test-format/invalid/entity-client-observeTracingMessages-additionalPropertyType.json b/test/unified-test-format/invalid/entity-client-observeTracingMessages-additionalPropertyType.json new file mode 100644 index 0000000000..0b3a65f587 --- /dev/null +++ b/test/unified-test-format/invalid/entity-client-observeTracingMessages-additionalPropertyType.json @@ -0,0 +1,20 @@ +{ + "description": "entity-client-observeTracingMessages-additionalPropertyType", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0", + "observeTracingMessages": { + "enableCommandPayload": 0 + } + } + } + ], + "tests": [ + { + "description": "observeTracingMessages enableCommandPayload must be boolean", + "operations": [] + } + ] +} diff --git a/test/unified-test-format/invalid/entity-client-observeTracingMessages-type.json b/test/unified-test-format/invalid/entity-client-observeTracingMessages-type.json new file mode 100644 index 0000000000..de3ef39ab1 --- /dev/null +++ b/test/unified-test-format/invalid/entity-client-observeTracingMessages-type.json @@ -0,0 +1,18 @@ +{ + "description": "entity-client-observeTracingMessages-type", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0", + "observeTracingMessages": "foo" + } + } + ], + "tests": [ + { + "description": "observeTracingMessages must be an object", + "operations": [] + } + ] +} diff --git a/test/unified-test-format/invalid/expectedTracingSpans-additionalProperties.json b/test/unified-test-format/invalid/expectedTracingSpans-additionalProperties.json new file mode 100644 index 0000000000..5947a286b2 --- /dev/null +++ b/test/unified-test-format/invalid/expectedTracingSpans-additionalProperties.json @@ -0,0 +1,30 @@ +{ + "description": "expectedTracingSpans-additionalProperties", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "additional property foo not allowed in expectTracingMessages", + "operations": [], + "expectTracingMessages": { + "client": "client0", + "ignoreExtraSpans": false, + "spans": [ + { + "name": "command", + "tags": { + "db.system": "mongodb" + } + } + ], + "foo": 0 + } + } + ] +} diff --git a/test/unified-test-format/invalid/expectedTracingSpans-clientType.json b/test/unified-test-format/invalid/expectedTracingSpans-clientType.json new file mode 100644 index 0000000000..2fe7faea34 --- /dev/null +++ b/test/unified-test-format/invalid/expectedTracingSpans-clientType.json @@ -0,0 +1,28 @@ +{ + "description": "expectedTracingSpans-clientType", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "client type must be string", + "operations": [], + "expectTracingMessages": { + "client": 0, + "spans": [ + { + "name": "command", + "tags": { + "db.system": "mongodb" + } + } + ] + } + } + ] +} diff --git a/test/unified-test-format/invalid/expectedTracingSpans-emptyNestedSpan.json b/test/unified-test-format/invalid/expectedTracingSpans-emptyNestedSpan.json new file mode 100644 index 0000000000..8a98d5ba81 --- /dev/null +++ b/test/unified-test-format/invalid/expectedTracingSpans-emptyNestedSpan.json @@ -0,0 +1,29 @@ +{ + "description": "expectedTracingSpans-emptyNestedSpan", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "nested spans must not have fewer than 1 items'", + "operations": [], + "expectTracingMessages": { + "client": "client0", + "spans": [ + { + "name": "command", + "tags": { + "db.system": "mongodb" + }, + "nested": [] + } + ] + } + } + ] +} diff --git a/test/unified-test-format/invalid/expectedTracingSpans-invalidNestedSpan.json b/test/unified-test-format/invalid/expectedTracingSpans-invalidNestedSpan.json new file mode 100644 index 0000000000..79a86744fb --- /dev/null +++ b/test/unified-test-format/invalid/expectedTracingSpans-invalidNestedSpan.json @@ -0,0 +1,31 @@ +{ + "description": "expectedTracingSpans-invalidNestedSpan", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "nested span must have required property name", + "operations": [], + "expectTracingMessages": { + "client": "client0", + "spans": [ + { + "name": "command", + "tags": { + "db.system": "mongodb" + }, + "nested": [ + {} + ] + } + ] + } + } + ] +} diff --git a/test/unified-test-format/invalid/expectedTracingSpans-missingPropertyClient.json b/test/unified-test-format/invalid/expectedTracingSpans-missingPropertyClient.json new file mode 100644 index 0000000000..2fb1cd5bbc --- /dev/null +++ b/test/unified-test-format/invalid/expectedTracingSpans-missingPropertyClient.json @@ -0,0 +1,27 @@ +{ + "description": "expectedTracingSpans-missingPropertyClient", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "missing required property client", + "operations": [], + "expectTracingMessages": { + "spans": [ + { + "name": "command", + "tags": { + "db.system": "mongodb" + } + } + ] + } + } + ] +} diff --git a/test/unified-test-format/invalid/expectedTracingSpans-missingPropertySpans.json b/test/unified-test-format/invalid/expectedTracingSpans-missingPropertySpans.json new file mode 100644 index 0000000000..acd1030736 --- /dev/null +++ b/test/unified-test-format/invalid/expectedTracingSpans-missingPropertySpans.json @@ -0,0 +1,20 @@ +{ + "description": "expectedTracingSpans-missingPropertySpans", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "missing required property spans", + "operations": [], + "expectTracingMessages": { + "client": "client0" + } + } + ] +} diff --git a/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedAdditionalProperties.json b/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedAdditionalProperties.json new file mode 100644 index 0000000000..17299f8622 --- /dev/null +++ b/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedAdditionalProperties.json @@ -0,0 +1,28 @@ +{ + "description": "expectedTracingSpans-spanMalformedAdditionalProperties", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "Span must not have additional properties", + "operations": [], + "expectTracingMessages": { + "client": "client0", + "spans": [ + { + "name": "foo", + "tags": {}, + "nested": [], + "foo": "bar" + } + ] + } + } + ] +} diff --git a/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedMissingName.json b/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedMissingName.json new file mode 100644 index 0000000000..0257cd9b3d --- /dev/null +++ b/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedMissingName.json @@ -0,0 +1,27 @@ +{ + "description": "expectedTracingSpans-spanMalformedMissingName", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "missing required span name", + "operations": [], + "expectTracingMessages": { + "client": "client0", + "spans": [ + { + "tags": { + "db.system": "mongodb" + } + } + ] + } + } + ] +} diff --git a/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedMissingTags.json b/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedMissingTags.json new file mode 100644 index 0000000000..a09ca31c95 --- /dev/null +++ b/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedMissingTags.json @@ -0,0 +1,25 @@ +{ + "description": "expectedTracingSpans-spanMalformedMissingTags", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "missing required span tags", + "operations": [], + "expectTracingMessages": { + "client": "client0", + "spans": [ + { + "name": "foo" + } + ] + } + } + ] +} diff --git a/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedNestedMustBeArray.json b/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedNestedMustBeArray.json new file mode 100644 index 0000000000..ccff04108d --- /dev/null +++ b/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedNestedMustBeArray.json @@ -0,0 +1,27 @@ +{ + "description": "expectedTracingSpans-spanMalformedNestedMustBeArray", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "nested spans must be an array", + "operations": [], + "expectTracingMessages": { + "client": "client0", + "spans": [ + { + "name": "foo", + "tags": {}, + "nested": {} + } + ] + } + } + ] +} diff --git a/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedTagsMustBeObject.json b/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedTagsMustBeObject.json new file mode 100644 index 0000000000..72af1c29b1 --- /dev/null +++ b/test/unified-test-format/invalid/expectedTracingSpans-spanMalformedTagsMustBeObject.json @@ -0,0 +1,26 @@ +{ + "description": "expectedTracingSpans-spanMalformedNestedMustBeObject", + "schemaVersion": "1.26", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "span tags must be an object", + "operations": [], + "expectTracingMessages": { + "client": "client0", + "spans": [ + { + "name": "foo", + "tags": [] + } + ] + } + } + ] +}