diff --git a/.evergreen/.evg.yml b/.evergreen/.evg.yml index 7c1ae2250cc..b1685115e7d 100644 --- a/.evergreen/.evg.yml +++ b/.evergreen/.evg.yml @@ -31,6 +31,12 @@ functions: # Applies the subitted patch, if any # Deprecated. Should be removed. But still needed for certain agents (ZAP) - command: git.apply_patch + # Fetch the specifications submodule + - command: shell.exec + params: + working_dir: "src" + script: | + git submodule update --init # Make an evergreen expansion file with dynamic values - command: shell.exec params: @@ -285,7 +291,7 @@ functions: export AWS_TEMP_SESSION_TOKEN=$CSFLE_AWS_TEMP_SESSION_TOKEN export CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} - AUTH="${AUTH}" SSL="${SSL}" MONGODB_URI="${MONGODB_URI}" SAFE_FOR_MULTI_MONGOS="${SAFE_FOR_MULTI_MONGOS}" TOPOLOGY="${TOPOLOGY}" \ + AUTH="${AUTH}" SSL="${SSL}" MONGODB_URI="${MONGODB_URI}" TOPOLOGY="${TOPOLOGY}" \ COMPRESSOR="${COMPRESSOR}" JAVA_VERSION="${JAVA_VERSION}" REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \ TESTS="${TESTS}" .evergreen/run-tests.sh @@ -344,7 +350,7 @@ functions: working_dir: "src" script: | ${PREPARE_SHELL} - SCALA="${SCALA}" AUTH="${AUTH}" SSL="${SSL}" MONGODB_URI="${MONGODB_URI}" SAFE_FOR_MULTI_MONGOS="${SAFE_FOR_MULTI_MONGOS}" TOPOLOGY="${TOPOLOGY}" JAVA_VERSION="${JAVA_VERSION}" .evergreen/run-scala-tests.sh + SCALA="${SCALA}" AUTH="${AUTH}" SSL="${SSL}" MONGODB_URI="${MONGODB_URI}" TOPOLOGY="${TOPOLOGY}" JAVA_VERSION="${JAVA_VERSION}" .evergreen/run-scala-tests.sh "run kotlin tests": - command: shell.exec @@ -353,7 +359,7 @@ functions: working_dir: "src" script: | ${PREPARE_SHELL} - AUTH="${AUTH}" SSL="${SSL}" MONGODB_URI="${MONGODB_URI}" SAFE_FOR_MULTI_MONGOS="${SAFE_FOR_MULTI_MONGOS}" TOPOLOGY="${TOPOLOGY}" JAVA_VERSION="${JAVA_VERSION}" .evergreen/run-kotlin-tests.sh + AUTH="${AUTH}" SSL="${SSL}" MONGODB_URI="${MONGODB_URI}" TOPOLOGY="${TOPOLOGY}" JAVA_VERSION="${JAVA_VERSION}" .evergreen/run-kotlin-tests.sh "run socket tests": @@ -599,16 +605,6 @@ functions: LOGIN_CONTEXT_NAME=${LOGIN_CONTEXT_NAME} \ .evergreen/run-gssapi-auth-test.sh - "run mmapv1 storage test": - - command: shell.exec - type: test - params: - silent: true - working_dir: "src" - script: | - ${PREPARE_SHELL} - PROJECT_DIRECTORY=${PROJECT_DIRECTORY} JAVA_VERSION=${JAVA_VERSION} TOPOLOGY=${TOPOLOGY} STORAGE_ENGINE=${STORAGE_ENGINE} MONGODB_URI="${MONGODB_URI}" .evergreen/run-mmapv1-storage-test.sh - run socks5 tests: - command: shell.exec type: test @@ -780,14 +776,41 @@ functions: type: test params: working_dir: "src" + env: + PROVIDER: ${PROVIDER} script: | ${PREPARE_SHELL} PROJECT_DIRECTORY=${PROJECT_DIRECTORY} .evergreen/run-perf-tests.sh "send dashboard data": - - command: perf.send + - command: shell.exec params: - file: src/results.json + script: | + if [ "${requester}" == "commit" ]; then + is_mainline=true + else + is_mainline=false + fi + + parsed_order_id=$(echo "${revision_order_id}" | awk -F'_' '{print $NF}') + response=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X 'POST' \ + "https://performance-monitoring-api.corp.mongodb.com/raw_perf_results/cedar_report?project=${project_id}&version=${version_id}&variant=${build_variant}&order=$parsed_order_id&task_name=${task_name}&task_id=${task_id}&execution=${execution}&mainline=$is_mainline" \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d @src/results.json) + + http_status=$(echo "$response" | grep "HTTP_STATUS" | awk -F':' '{print $2}') + response_body=$(echo "$response" | sed '/HTTP_STATUS/d') + + # We want to throw an error if the data was not successfully submitted + if [ "$http_status" -ne 200 ]; then + echo "Error: Received HTTP status $http_status" + echo "Response Body: $response_body" + exit 1 + fi + + echo "Response Body: $response_body" + echo "HTTP Status: $http_status" "run graalvm native image app": - command: shell.exec @@ -1547,18 +1570,37 @@ tasks: product_name: mongo-java-driver - func: "create and upload SSDLC release assets" + # Do not rename this task – renaming resets the performance time series - name: "perf" tags: ["perf"] + # Benchmark could exceed 1 hour of execution. + exec_timeout_secs: 7200 commands: - func: "bootstrap mongo-orchestration" vars: - VERSION: "v6.0-perf" + VERSION: "v8.0-perf" TOPOLOGY: "server" SSL: "nossl" AUTH: "noauth" - func: "run perf tests" - func: "send dashboard data" + - name: "perf-netty" + tags: [ "perf" ] + # Benchmark could exceed 1 hour of execution. + exec_timeout_secs: 7200 + commands: + - func: "bootstrap mongo-orchestration" + vars: + VERSION: "v8.0-perf" + TOPOLOGY: "server" + SSL: "nossl" + AUTH: "noauth" + - func: "run perf tests" + vars: + PROVIDER: "Netty" + - func: "send dashboard data" + - name: "aws-lambda-deployed-task" commands: - command: ec2.assume_role @@ -1576,11 +1618,6 @@ tasks: TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/driver-lambda/ AWS_REGION: us-east-1 - - name: "mmapv1-storage-test" - commands: - - func: "bootstrap mongo-orchestration" - - func: "run mmapv1 storage test" - - name: "test-kms-tls-invalid-cert" tags: ["kms-tls"] commands: @@ -1716,55 +1753,30 @@ axes: display_name: "latest" variables: VERSION: "latest" - # Multiple mongos instances can be specified in the connection string - # for this version. - SAFE_FOR_MULTI_MONGOS: true - id: "8.0" display_name: "8.0" variables: VERSION: "8.0" - # Multiple mongos instances can be specified in the connection string - # for this version. - SAFE_FOR_MULTI_MONGOS: true - id: "7.0" display_name: "7.0" variables: VERSION: "7.0" - # Multiple mongos instances can be specified in the connection string - # for this version. - SAFE_FOR_MULTI_MONGOS: true - id: "6.0" display_name: "6.0" variables: VERSION: "6.0" - # Multiple mongos instances can be specified in the connection string - # for this version. - SAFE_FOR_MULTI_MONGOS: true - id: "5.0" display_name: "5.0" variables: VERSION: "5.0" - # Multiple mongos instances can be specified in the connection string - # for this version. - SAFE_FOR_MULTI_MONGOS: true - id: "4.4" display_name: "4.4" variables: VERSION: "4.4" - # Multiple mongos instances can be specified in the connection string - # for this version. - SAFE_FOR_MULTI_MONGOS: true - id: "4.2" display_name: "4.2" variables: VERSION: "4.2" - # Multiple mongos instances can be specified in the connection string - # for this version. - SAFE_FOR_MULTI_MONGOS: true - - id: "4.0" - display_name: "4.0" - variables: - VERSION: "4.0" - id: os display_name: OS values: @@ -1875,24 +1887,15 @@ axes: - id: "2.11" display_name: "Scala 2.11" variables: - SCALA: "2.11.12" + SCALA: "2.11" - id: "2.12" display_name: "Scala 2.12" variables: - SCALA: "2.12.20" + SCALA: "2.12" - id: "2.13" display_name: "Scala 2.13" variables: - SCALA: "2.13.15" - - # Choice of MongoDB storage engine - - id: storage-engine - display_name: Storage - values: - - id: mmapv1 - display_name: MMAPv1 - variables: - STORAGE_ENGINE: "mmapv1" + SCALA: "2.13" - id: api-version display_name: API Version @@ -1941,6 +1944,9 @@ axes: task_groups: - name: "atlas-deployed-task-group" + max_hosts: -1 + setup_group_can_fail_task: true + setup_group_timeout_secs: 1800 setup_group: - func: fetch source - func: prepare resources @@ -1964,8 +1970,6 @@ task_groups: add_expansions_to_env: true args: - ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh - setup_group_can_fail_task: true - setup_group_timeout_secs: 1800 tasks: - "atlas-search-index-management-task" - "aws-lambda-deployed-task" @@ -2199,7 +2203,7 @@ buildvariants: - name: "test-bson-and-crypt" - matrix_name: "tests-jdk8-unsecure" - matrix_spec: { auth: "noauth", ssl: "nossl", jdk: "jdk8", version: ["4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "latest"], + matrix_spec: { auth: "noauth", ssl: "nossl", jdk: "jdk8", version: ["4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "latest"], topology: "*", os: "linux" } display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} " tags: ["tests-variant"] @@ -2211,7 +2215,7 @@ buildvariants: - matrix_name: "tests-jdk-secure" matrix_spec: { auth: "auth", ssl: "ssl", jdk: [ "jdk8", "jdk17", "jdk21"], - version: ["4.0", "4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "latest" ], + version: ["4.2", "4.4", "5.0", "6.0", "7.0", "8.0", "latest" ], topology: "*", os: "linux" } display_name: "${version} ${topology} ${auth} ${ssl} ${jdk} ${os} " tags: ["tests-variant"] @@ -2310,6 +2314,7 @@ buildvariants: run_on: rhel90-dbx-perf-large tasks: - name: "perf" + - name: "perf-netty" - name: plain-auth-test display_name: "PLAIN (LDAP) Auth test" @@ -2425,12 +2430,6 @@ buildvariants: tasks: - name: "publish-release" -- matrix_name: "tests-storage-engines" - matrix_spec: { auth: "noauth", ssl: "nossl", jdk: "jdk8", os: "linux", version: ["4.0"], topology: ["replicaset", "sharded-cluster"], storage-engine: "mmapv1" } - display_name: "${version} Storage ${storage-engine} ${jdk} ${os} ${topology}" - tasks: - - name: "mmapv1-storage-test" - - matrix_name: "kms-tls-test" matrix_spec: { os: "linux", version: [ "5.0" ], topology: ["standalone"] } display_name: "CSFLE KMS TLS" diff --git a/.evergreen/publish.sh b/.evergreen/publish.sh index e3f9f365d42..9a3e9eb405f 100755 --- a/.evergreen/publish.sh +++ b/.evergreen/publish.sh @@ -27,5 +27,5 @@ SYSTEM_PROPERTIES="-Dorg.gradle.internal.publish.checksums.insecure=true -Dorg.g ./gradlew -version ./gradlew ${SYSTEM_PROPERTIES} --stacktrace --info ${TASK} # Scala 2.13 is published as result of this gradle execution. -./gradlew ${SYSTEM_PROPERTIES} --stacktrace --info :bson-scala:${TASK} :driver-scala:${TASK} -PdefaultScalaVersions=2.12.12 -./gradlew ${SYSTEM_PROPERTIES} --stacktrace --info :bson-scala:${TASK} :driver-scala:${TASK} -PdefaultScalaVersions=2.11.12 +./gradlew ${SYSTEM_PROPERTIES} --stacktrace --info :bson-scala:${TASK} :driver-scala:${TASK} -PscalaVersion=2.12 +./gradlew ${SYSTEM_PROPERTIES} --stacktrace --info :bson-scala:${TASK} :driver-scala:${TASK} -PscalaVersion=2.11 diff --git a/.evergreen/run-kotlin-tests.sh b/.evergreen/run-kotlin-tests.sh index a82c66e9e54..e240d7bc255 100755 --- a/.evergreen/run-kotlin-tests.sh +++ b/.evergreen/run-kotlin-tests.sh @@ -8,7 +8,6 @@ AUTH=${AUTH:-noauth} SSL=${SSL:-nossl} MONGODB_URI=${MONGODB_URI:-} TOPOLOGY=${TOPOLOGY:-standalone} -SAFE_FOR_MULTI_MONGOS=${SAFE_FOR_MULTI_MONGOS:-} ############################################ # Main Program # @@ -27,9 +26,7 @@ if [ "$AUTH" != "noauth" ]; then exit 1 fi -if [ "$SAFE_FOR_MULTI_MONGOS" == "true" ]; then - export MULTI_MONGOS_URI_SYSTEM_PROPERTY="-Dorg.mongodb.test.multi.mongos.uri=${MONGODB_URI}" -fi +export MULTI_MONGOS_URI_SYSTEM_PROPERTY="-Dorg.mongodb.test.multi.mongos.uri=${MONGODB_URI}" ./gradlew -version diff --git a/.evergreen/run-mmapv1-storage-test.sh b/.evergreen/run-mmapv1-storage-test.sh deleted file mode 100755 index 6061acff2d3..00000000000 --- a/.evergreen/run-mmapv1-storage-test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -o errexit # Exit the script with error if any of the commands fail - -# Supported/used environment variables: -# MONGODB_URI Set the URI, including username/password to use to connect to the server via PLAIN authentication mechanism -# JDK Set the version of java to be used. Java versions can be set from the java toolchain /opt/java -# "jdk5", "jdk6", "jdk7", "jdk8", "jdk9" - -############################################ -# Main Program # -############################################ -RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")" -. "${RELATIVE_DIR_PATH}/javaConfig.bash" - -echo "Running MMAPv1 Storage Test" - -echo "Running tests with Java ${JAVA_VERSION}" -./gradlew -version -for PACKAGE in driver-sync driver-reactive-streams ; do - ./gradlew -PjavaVersion=${JAVA_VERSION} --stacktrace --info \ - -Dorg.mongodb.test.uri=${MONGODB_URI} \ - ${PACKAGE}:test --tests RetryableWritesProseTest -done diff --git a/.evergreen/run-perf-tests.sh b/.evergreen/run-perf-tests.sh index d251c194860..76627a967cf 100755 --- a/.evergreen/run-perf-tests.sh +++ b/.evergreen/run-perf-tests.sh @@ -17,8 +17,14 @@ RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE:-$0}")" export TEST_PATH="${PROJECT_DIRECTORY}/driver-performance-test-data/" export OUTPUT_FILE="${PROJECT_DIRECTORY}/results.json" +if [ "${PROVIDER}" = "Netty" ]; then + TASK="driver-benchmarks:runNetty" +else + TASK="driver-benchmarks:run" +fi + start_time=$(date +%s) -./gradlew -Dorg.mongodb.benchmarks.data=${TEST_PATH} -Dorg.mongodb.benchmarks.output=${OUTPUT_FILE} driver-benchmarks:run +./gradlew -Dorg.mongodb.benchmarks.data=${TEST_PATH} -Dorg.mongodb.benchmarks.output=${OUTPUT_FILE} ${TASK} end_time=$(date +%s) elapsed_secs=$((end_time-start_time)) diff --git a/.evergreen/run-scala-tests.sh b/.evergreen/run-scala-tests.sh index 7854650a687..e82bb5a56c9 100755 --- a/.evergreen/run-scala-tests.sh +++ b/.evergreen/run-scala-tests.sh @@ -8,7 +8,6 @@ AUTH=${AUTH:-noauth} SSL=${SSL:-nossl} MONGODB_URI=${MONGODB_URI:-} TOPOLOGY=${TOPOLOGY:-standalone} -SAFE_FOR_MULTI_MONGOS=${SAFE_FOR_MULTI_MONGOS:-} ############################################ # Main Program # @@ -27,9 +26,7 @@ if [ "$AUTH" != "noauth" ]; then exit 1 fi -if [ "$SAFE_FOR_MULTI_MONGOS" == "true" ]; then - export MULTI_MONGOS_URI_SYSTEM_PROPERTY="-Dorg.mongodb.test.multi.mongos.uri=${MONGODB_URI}" -fi +export MULTI_MONGOS_URI_SYSTEM_PROPERTY="-Dorg.mongodb.test.multi.mongos.uri=${MONGODB_URI}" echo "Running scala tests with Scala $SCALA" diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index f8e90977e36..84481f90ce5 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -68,14 +68,10 @@ provision_multi_mongos_uri_for_ssl () { # Arguments for auth + SSL if [ "$AUTH" != "noauth" ] || [ "$TOPOLOGY" == "replica_set" ]; then export MONGODB_URI="${MONGODB_URI}&ssl=true&sslInvalidHostNameAllowed=true" - if [ "$SAFE_FOR_MULTI_MONGOS" == "true" ]; then - export MULTI_MONGOS_URI="${MULTI_MONGOS_URI}&ssl=true&sslInvalidHostNameAllowed=true" - fi + export MULTI_MONGOS_URI="${MULTI_MONGOS_URI}&ssl=true&sslInvalidHostNameAllowed=true" else export MONGODB_URI="${MONGODB_URI}/?ssl=true&sslInvalidHostNameAllowed=true" - if [ "$SAFE_FOR_MULTI_MONGOS" == "true" ]; then - export MULTI_MONGOS_URI="${MULTI_MONGOS_URI}/?ssl=true&sslInvalidHostNameAllowed=true" - fi + export MULTI_MONGOS_URI="${MULTI_MONGOS_URI}/?ssl=true&sslInvalidHostNameAllowed=true" fi } @@ -85,13 +81,11 @@ provision_multi_mongos_uri_for_ssl () { # Provision the correct connection string and set up SSL if needed if [ "$TOPOLOGY" == "sharded_cluster" ]; then - if [ "$SAFE_FOR_MULTI_MONGOS" == "true" ]; then - if [ "$AUTH" = "auth" ]; then - export MULTI_MONGOS_URI="mongodb://bob:pwd123@localhost:27017,localhost:27018/?authSource=admin" - else - export MULTI_MONGOS_URI="${MONGODB_URI}" - fi - fi + if [ "$AUTH" = "auth" ]; then + export MULTI_MONGOS_URI="mongodb://bob:pwd123@localhost:27017,localhost:27018/?authSource=admin" + else + export MULTI_MONGOS_URI="${MONGODB_URI}" + fi if [ "$AUTH" = "auth" ]; then export MONGODB_URI="mongodb://bob:pwd123@localhost:27017/?authSource=admin" @@ -107,12 +101,10 @@ if [ "$COMPRESSOR" != "" ]; then export MONGODB_URI="${MONGODB_URI}/?compressors=${COMPRESSOR}" fi - if [ "$SAFE_FOR_MULTI_MONGOS" == "true" ]; then - if [[ "$MULTI_MONGOS_URI" == *"?"* ]]; then - export MULTI_MONGOS_URI="${MULTI_MONGOS_URI}&compressors=${COMPRESSOR}" - else - export MULTI_MONGOS_URI="${MULTI_MONGOS_URI}/?compressors=${COMPRESSOR}" - fi + if [[ "$MULTI_MONGOS_URI" == *"?"* ]]; then + export MULTI_MONGOS_URI="${MULTI_MONGOS_URI}&compressors=${COMPRESSOR}" + else + export MULTI_MONGOS_URI="${MULTI_MONGOS_URI}/?compressors=${COMPRESSOR}" fi fi @@ -123,9 +115,7 @@ if [ "$SSL" != "nossl" ]; then provision_multi_mongos_uri_for_ssl fi -if [ "$SAFE_FOR_MULTI_MONGOS" == "true" ]; then - export MULTI_MONGOS_URI_SYSTEM_PROPERTY="-Dorg.mongodb.test.multi.mongos.uri=${MULTI_MONGOS_URI}" -fi +export MULTI_MONGOS_URI_SYSTEM_PROPERTY="-Dorg.mongodb.test.multi.mongos.uri=${MULTI_MONGOS_URI}" # For now it's sufficient to hard-code the API version to "1", since it's the only API version if [ ! -z "$REQUIRE_API_VERSION" ]; then diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..80bd0c9bf01 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 +updates: + - package-ecosystem: "gitsubmodule" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "build" + include: "scope" diff --git a/.github/workflows/bump-version.sh b/.github/workflows/bump-version.sh index 5f39df82d79..eaa92163bfa 100755 --- a/.github/workflows/bump-version.sh +++ b/.github/workflows/bump-version.sh @@ -9,5 +9,5 @@ fi FROM_VERSION=$1 TO_VERSION=$2 -sed --in-place "s/version = '${FROM_VERSION}'/version = '${TO_VERSION}'/g" build.gradle -git commit -m "Version: bump ${TO_VERSION}" build.gradle +sed --in-place "s/version=${FROM_VERSION}/version=${TO_VERSION}/g" gradle.properties +git commit -m "Version: bump ${TO_VERSION}" gradle.properties diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ab0c31e5ed..005ac768f3b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,9 +55,9 @@ jobs: - name: "Ensure current snapshot version matches release version" run: | - grep -q "version = '${{ env.RELEASE_VERSION_WITHOUT_SUFFIX }}-SNAPSHOT'" build.gradle + grep -q "version=${{ env.RELEASE_VERSION_WITHOUT_SUFFIX }}-SNAPSHOT" gradle.properties if [[ $? != 0 ]]; then - echo '❌ Release failed: version in build.gradle is not a snapshot for release version ${{ inputs.version }}' >> $GITHUB_STEP_SUMMARY + echo '❌ Release failed: version in gradle.properties is not a snapshot for release version ${{ inputs.version }}' >> $GITHUB_STEP_SUMMARY exit 1 fi @@ -110,7 +110,7 @@ jobs: git push origin ${{ github.ref_name }} git checkout ${{ env.RELEASE_BRANCH }} - # This step bumps version numbers in build.gradle and creates git artifacts for the release + # This step bumps version numbers in gradle.properties and creates git artifacts for the release - name: "Bump version numbers and create release tag" run: .github/workflows/bump-and-tag.sh "${{ env.RELEASE_VERSION_WITHOUT_SUFFIX }}" "${{ env.RELEASE_VERSION }}" "${{ env.NEXT_VERSION }}" diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000000..a9ac62f04bb --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "specifications"] + path = driver-core/src/test/resources/specifications + url = https://github.com/mongodb/specifications diff --git a/README.md b/README.md index 587a248ccc7..cc0fe3b9136 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ Example for Maven: Java 17+ and git is required to build and compile the source. To build and test the driver: ``` -$ git clone https://github.com/mongodb/mongo-java-driver.git +$ git clone --recurse-submodules https://github.com/mongodb/mongo-java-driver.git $ cd mongo-java-driver $ ./gradlew check ``` diff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICES index f881b103544..acca60ca973 100644 --- a/THIRD-PARTY-NOTICES +++ b/THIRD-PARTY-NOTICES @@ -184,3 +184,19 @@ https://github.com/mongodb/mongo-java-driver. See the License for the specific language governing permissions and limitations under the License. +9) The following files: BsonCodecUtils.kt + + Copyright 2008-present MongoDB, Inc. + Copyright 2017-2021 JetBrains s.r.o. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bom/build.gradle.kts b/bom/build.gradle.kts index 5d1fb81c384..806c4f20950 100644 --- a/bom/build.gradle.kts +++ b/bom/build.gradle.kts @@ -1,6 +1,30 @@ -group = "org.mongodb" -description = "This Bill of Materials POM simplifies dependency management when referencing multiple" + - " MongoDB Java Driver artifacts in projects using Gradle or Maven." +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ProjectExtensions.configureMavenPublication +import groovy.util.Node +import groovy.util.NodeList + +plugins { + id("java-platform") + id("project.base") + id("conventions.publishing") + id("conventions.spotless") +} + +base.archivesName.set("mongodb-driver-bom") dependencies { constraints { @@ -16,8 +40,116 @@ dependencies { api(project(":bson-kotlinx")) api(project(":driver-kotlin-coroutine")) api(project(":driver-kotlin-sync")) + api(project(":driver-kotlin-extensions")) api(project(":bson-scala")) api(project(":driver-scala")) } } + +/* + * Handle the multiple versions of Scala we support as defined in `gradle.properties` + */ +val defaultScalaVersion: String = project.findProperty("defaultScalaVersion")!!.toString() +val scalaVersions: List? = project.findProperty("supportedScalaVersions")?.toString()?.split(",") + +require(!scalaVersions.isNullOrEmpty()) { + "Scala versions must be provided as a comma-separated list in the 'supportedScalaVersions' project property" +} + +scalaVersions?.forEach { version -> + require(version.matches(Regex("\\d\\.\\d{2}"))) { "Scala version '$version' must be in the format X.YY" } +} +/* + * Apply the Java Platform plugin to create the BOM + * Modify the generated POM to include all supported versions of Scala for driver-scala or bson-scala. + */ +configureMavenPublication { + components.findByName("javaPlatform")?.let { from(it) } + + pom { + name.set("bom") + description.set( + "This Bill of Materials POM simplifies dependency management when referencing multiple MongoDB Java Driver artifacts in projects using Gradle or Maven.") + + withXml { + val pomXml: Node = asNode() + + val dependencyManagementNode = pomXml.getNode("dependencyManagement") + require(dependencyManagementNode != null) { + " node not found in the generated BOM POM" + } + val dependenciesNode = dependencyManagementNode.getNode("dependencies") + require(dependenciesNode != null) { " node not found in the generated BOM POM" } + + val existingScalaDeps = + dependenciesNode + .children() + .map { it as Node } + .filter { it.getNode("artifactId")?.text()?.contains("scala") ?: false } + + existingScalaDeps.forEach { + val groupId: String = it.getNode("groupId")!!.text() + val originalArtifactId: String = it.getNode("artifactId")!!.text() + val artifactVersion: String = it.getNode("version")!!.text() + + // Add multiple versions with Scala suffixes for each Scala-related dependency. + scalaVersions!!.forEach { scalaVersion -> + if (scalaVersion != defaultScalaVersion) { + // Replace scala version suffix + val newArtifactId: String = originalArtifactId.replace(defaultScalaVersion, scalaVersion) + val dependencyNode = dependenciesNode.appendNode("dependency") + dependencyNode.appendNode("groupId", groupId) + dependencyNode.appendNode("artifactId", newArtifactId) + dependencyNode.appendNode("version", artifactVersion) + } + } + } + } + } +} + +/* + * Validate the BOM file. + */ +tasks.withType { + pom.withXml { + val pomXml: Node = asNode() + val dependenciesNode = pomXml.getNode("dependencyManagement").getNode("dependencies") + require(dependenciesNode!!.children().isNotEmpty()) { + "BOM must contain more then one element:\n$destination" + } + + dependenciesNode + .children() + .map { it as Node } + .forEach { + val groupId: String = it.getNode("groupId")!!.text() + require(groupId.startsWith("org.mongodb")) { + "BOM must contain only 'org.mongodb' dependencies, but found '$groupId':\n$destination" + } + + /* + * The and tags should be omitted in BOM dependencies. + * This ensures that consuming projects have the flexibility to decide whether a dependency is optional in their context. + * + * The BOM's role is to provide version information, not to dictate inclusion or exclusion of dependencies. + */ + require(it.getNode("scope") == null) { + "BOM must not contain elements in dependency:\n$destination" + } + require(it.getNode("optional") == null) { + "BOM must not contain elements in dependency:\n$destination" + } + } + } +} + +/** A node lookup helper. */ +private fun Node?.getNode(nodeName: String): Node? { + val found = this?.get(nodeName) + if (found is NodeList && found.isNotEmpty()) { + return found[0] as Node + } + return null +} diff --git a/bson-kotlin/build.gradle.kts b/bson-kotlin/build.gradle.kts index 45e8c9c0e5d..2cfd4413637 100644 --- a/bson-kotlin/build.gradle.kts +++ b/bson-kotlin/build.gradle.kts @@ -13,133 +13,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import io.gitlab.arturbosch.detekt.Detekt -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication -plugins { - id("org.jetbrains.kotlin.jvm") - `java-library` - - // Test based plugins - id("com.diffplug.spotless") - id("org.jetbrains.dokka") - id("io.gitlab.arturbosch.detekt") -} - -repositories { - mavenCentral() - google() -} +plugins { id("project.kotlin") } base.archivesName.set("bson-kotlin") -description = "Bson Kotlin Codecs" - -ext.set("pomName", "Bson Kotlin") - dependencies { - // Align versions of all Kotlin components - implementation(platform("org.jetbrains.kotlin:kotlin-bom")) - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") - api(project(path = ":bson", configuration = "default")) - implementation("org.jetbrains.kotlin:kotlin-reflect") + implementation(libs.kotlin.reflect) - testImplementation("org.jetbrains.kotlin:kotlin-test-junit") + // Test case checks MongoClientSettings.getDefaultCodecRegistry() support testImplementation(project(path = ":driver-core", configuration = "default")) } -kotlin { explicitApi() } - -tasks.withType { kotlinOptions.jvmTarget = "1.8" } - -// =========================== -// Code Quality checks -// =========================== -spotless { - kotlinGradle { - ktfmt("0.39").dropboxStyle().configure { it.setMaxWidth(120) } - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - licenseHeaderFile(rootProject.file("config/mongodb.license"), "(group|plugins|import|buildscript|rootProject)") - } - - kotlin { - target("**/*.kt") - ktfmt().dropboxStyle().configure { it.setMaxWidth(120) } - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - licenseHeaderFile(rootProject.file("config/mongodb.license")) - } - - format("extraneous") { - target("*.xml", "*.yml", "*.md") - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() +configureMavenPublication { + pom { + name.set("BSON Kotlin") + description.set("The BSON Codec for Kotlin") + url.set("https://bsonspec.org/") } } -tasks.named("check") { dependsOn("spotlessApply") } - -detekt { - allRules = true // fail build on any finding - buildUponDefaultConfig = true // preconfigure defaults - config = rootProject.files("config/detekt/detekt.yml") // point to your custom config defining rules to run, - // overwriting default behavior - baseline = rootProject.file("config/detekt/baseline.xml") // a way of suppressing issues before introducing detekt - source = - files( - file("src/main/kotlin"), - file("src/test/kotlin"), - file("src/integrationTest/kotlin"), - ) -} - -tasks.withType().configureEach { - reports { - html.required.set(true) // observe findings in your browser with structure and code snippets - xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins - txt.required.set(false) // similar to the console output, contains issue signature to manually edit - } -} - -spotbugs { showProgress.set(true) } - -// =========================== -// Test Configuration -// =========================== - -tasks.test { useJUnitPlatform() } - -// =========================== -// Dokka Configuration -// =========================== -val dokkaOutputDir = "${rootProject.buildDir}/docs/${base.archivesName.get()}" - -tasks.dokkaHtml.configure { - outputDirectory.set(file(dokkaOutputDir)) - moduleName.set(base.archivesName.get()) -} - -val cleanDokka by tasks.register("cleanDokka") { delete(dokkaOutputDir) } - -project.parent?.tasks?.named("docs") { - dependsOn(tasks.dokkaHtml) - mustRunAfter(cleanDokka) -} - -tasks.javadocJar.configure { - dependsOn(cleanDokka, tasks.dokkaHtml) - archiveClassifier.set("javadoc") - from(dokkaOutputDir) -} - -// =========================== -// Sources publishing configuration -// =========================== -tasks.sourcesJar { from(project.sourceSets.main.map { it.kotlin }) } - -afterEvaluate { tasks.jar { manifest { attributes["Automatic-Module-Name"] = "org.mongodb.bson.kotlin" } } } +configureJarManifest { attributes["Automatic-Module-Name"] = "org.mongodb.bson.kotlin" } diff --git a/bson-kotlinx/build.gradle.kts b/bson-kotlinx/build.gradle.kts index ac0b07f18eb..1671a876edf 100644 --- a/bson-kotlinx/build.gradle.kts +++ b/bson-kotlinx/build.gradle.kts @@ -13,150 +13,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import io.gitlab.arturbosch.detekt.Detekt -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication plugins { - id("org.jetbrains.kotlin.jvm") - kotlin("plugin.serialization") - `java-library` - - // Test based plugins - id("com.diffplug.spotless") - id("org.jetbrains.dokka") - id("io.gitlab.arturbosch.detekt") -} - -repositories { - mavenCentral() - google() + id("project.kotlin") + alias(libs.plugins.kotlin.serialization) } base.archivesName.set("bson-kotlinx") -description = "Bson Kotlinx Codecs" - -ext.set("pomName", "Bson Kotlinx") - -ext.set("kotlinxDatetimeVersion", "0.4.0") - -val kotlinxDatetimeVersion: String by ext - -java { - registerFeature("dateTimeSupport") { usingSourceSet(sourceSets["main"]) } - registerFeature("jsonSupport") { usingSourceSet(sourceSets["main"]) } -} - dependencies { - // Align versions of all Kotlin components - implementation(platform("org.jetbrains.kotlin:kotlin-bom")) - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") - - implementation(platform("org.jetbrains.kotlinx:kotlinx-serialization-bom:1.5.0")) - implementation("org.jetbrains.kotlinx:kotlinx-serialization-core") - "dateTimeSupportImplementation"("org.jetbrains.kotlinx:kotlinx-datetime:$kotlinxDatetimeVersion") - "jsonSupportImplementation"("org.jetbrains.kotlinx:kotlinx-serialization-json") - api(project(path = ":bson", configuration = "default")) - implementation("org.jetbrains.kotlin:kotlin-reflect") - - testImplementation("org.jetbrains.kotlin:kotlin-test-junit") - testImplementation(project(path = ":driver-core", configuration = "default")) - testImplementation("org.jetbrains.kotlinx:kotlinx-datetime:$kotlinxDatetimeVersion") - testImplementation("org.jetbrains.kotlinx:kotlinx-serialization-json") -} - -kotlin { explicitApi() } - -tasks.withType { kotlinOptions.jvmTarget = "1.8" } - -// =========================== -// Code Quality checks -// =========================== -spotless { - kotlinGradle { - ktfmt("0.39").dropboxStyle().configure { it.setMaxWidth(120) } - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - licenseHeaderFile(rootProject.file("config/mongodb.license"), "(group|plugins|import|buildscript|rootProject)") - } + implementation(platform(libs.kotlinx.serialization)) + implementation(libs.kotlinx.serialization.core) + implementation(libs.kotlin.reflect) - kotlin { - target("**/*.kt") - ktfmt().dropboxStyle().configure { it.setMaxWidth(120) } - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - licenseHeaderFile(rootProject.file("config/mongodb.license")) - } - - format("extraneous") { - target("*.xml", "*.yml", "*.md") - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - } -} - -tasks.named("check") { dependsOn("spotlessApply") } + optionalApi(libs.kotlinx.serialization.datetime) + optionalApi(libs.kotlinx.serialization.json) -detekt { - allRules = true // fail build on any finding - buildUponDefaultConfig = true // preconfigure defaults - config = rootProject.files("config/detekt/detekt.yml") // point to your custom config defining rules to run, - // overwriting default behavior - baseline = rootProject.file("config/detekt/baseline.xml") // a way of suppressing issues before introducing detekt - source = - files( - file("src/main/kotlin"), - file("src/test/kotlin"), - file("src/integrationTest/kotlin"), - ) + // Test case checks MongoClientSettings.getDefaultCodecRegistry() support + testImplementation(project(path = ":driver-core", configuration = "default")) } -tasks.withType().configureEach { - reports { - html.required.set(true) // observe findings in your browser with structure and code snippets - xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins - txt.required.set(false) // similar to the console output, contains issue signature to manually edit +configureMavenPublication { + pom { + name.set("BSON Kotlinx") + description.set("The BSON Codec for Kotlinx serialization") + url.set("https://bsonspec.org/") } } -spotbugs { showProgress.set(true) } - -// =========================== -// Test Configuration -// =========================== - -tasks.test { useJUnitPlatform() } - -// =========================== -// Dokka Configuration -// =========================== -val dokkaOutputDir = "${rootProject.buildDir}/docs/${base.archivesName.get()}" - -tasks.dokkaHtml.configure { - outputDirectory.set(file(dokkaOutputDir)) - moduleName.set(base.archivesName.get()) -} - -val cleanDokka by tasks.register("cleanDokka") { delete(dokkaOutputDir) } - -project.parent?.tasks?.named("docs") { - dependsOn(tasks.dokkaHtml) - mustRunAfter(cleanDokka) -} - -tasks.javadocJar.configure { - dependsOn(cleanDokka, tasks.dokkaHtml) - archiveClassifier.set("javadoc") - from(dokkaOutputDir) -} - -// =========================== -// Sources publishing configuration -// =========================== -tasks.sourcesJar { from(project.sourceSets.main.map { it.kotlin }) } - -afterEvaluate { tasks.jar { manifest { attributes["Automatic-Module-Name"] = "org.mongodb.bson.kotlinx" } } } +configureJarManifest { attributes["Automatic-Module-Name"] = "org.mongodb.bson.kotlinx" } diff --git a/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/BsonConfiguration.kt b/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/BsonConfiguration.kt index 027fe8925da..8a163f42f83 100644 --- a/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/BsonConfiguration.kt +++ b/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/BsonConfiguration.kt @@ -31,4 +31,19 @@ public data class BsonConfiguration( val encodeDefaults: Boolean = true, val explicitNulls: Boolean = false, val classDiscriminator: String = "_t", + val bsonNamingStrategy: BsonNamingStrategy? = null ) + +/** + * Optional BSON naming strategy for a field. + * + * @since 5.4 + */ +public enum class BsonNamingStrategy { + + /** + * A strategy that transforms serial names from camel case to snake case — lowercase characters with words separated + * by underscores. + */ + SNAKE_CASE, +} diff --git a/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/BsonDecoder.kt b/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/BsonDecoder.kt index 99e5d2acb17..c00d09345d0 100644 --- a/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/BsonDecoder.kt +++ b/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/BsonDecoder.kt @@ -37,11 +37,13 @@ import org.bson.BsonType import org.bson.BsonValue import org.bson.codecs.BsonValueCodec import org.bson.codecs.DecoderContext +import org.bson.codecs.kotlinx.utils.BsonCodecUtils.cacheElementNamesByDescriptor import org.bson.codecs.kotlinx.utils.BsonCodecUtils.createBsonArrayDecoder import org.bson.codecs.kotlinx.utils.BsonCodecUtils.createBsonDecoder import org.bson.codecs.kotlinx.utils.BsonCodecUtils.createBsonDocumentDecoder import org.bson.codecs.kotlinx.utils.BsonCodecUtils.createBsonMapDecoder import org.bson.codecs.kotlinx.utils.BsonCodecUtils.createBsonPolymorphicDecoder +import org.bson.codecs.kotlinx.utils.BsonCodecUtils.getCachedElementNamesByDescriptor import org.bson.internal.NumberCodecHelper import org.bson.internal.StringCodecHelper import org.bson.types.ObjectId @@ -102,6 +104,7 @@ internal sealed class AbstractBsonDecoder( elementDescriptor.serialName, elementDescriptor.isNullable && !descriptor.isElementOptional(it)) } this.elementsMetadata = elementsMetadata + cacheElementNamesByDescriptor(descriptor, configuration) } override fun decodeElementIndex(descriptor: SerialDescriptor): Int { @@ -129,7 +132,13 @@ internal sealed class AbstractBsonDecoder( } return name?.let { - val index = descriptor.getElementIndex(it) + val index = + if (configuration.bsonNamingStrategy == BsonNamingStrategy.SNAKE_CASE) { + getCachedElementNamesByDescriptor(descriptor)[it]?.let { name -> descriptor.getElementIndex(name) } + ?: UNKNOWN_NAME + } else { + descriptor.getElementIndex(it) + } return if (index == UNKNOWN_NAME) { reader.skipValue() decodeElementIndexImpl(descriptor) diff --git a/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/BsonEncoder.kt b/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/BsonEncoder.kt index 1470bbb76a5..8a34bccdb36 100644 --- a/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/BsonEncoder.kt +++ b/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/BsonEncoder.kt @@ -31,6 +31,7 @@ import org.bson.BsonValue import org.bson.BsonWriter import org.bson.codecs.BsonValueCodec import org.bson.codecs.EncoderContext +import org.bson.codecs.kotlinx.utils.BsonCodecUtils.convertCamelCase import org.bson.types.ObjectId /** @@ -203,7 +204,15 @@ internal open class BsonEncoderImpl( } internal fun encodeName(value: Any) { - writer.writeName(value.toString()) + val name = + value.toString().let { + if (configuration.bsonNamingStrategy == BsonNamingStrategy.SNAKE_CASE) { + convertCamelCase(it, '_') + } else { + it + } + } + writer.writeName(name) state = STATE.VALUE } diff --git a/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/JsonBsonDecoder.kt b/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/JsonBsonDecoder.kt index 4b0eee8213a..bd8b6739958 100644 --- a/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/JsonBsonDecoder.kt +++ b/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/JsonBsonDecoder.kt @@ -31,6 +31,7 @@ import org.bson.AbstractBsonReader import org.bson.BsonBinarySubType import org.bson.BsonType import org.bson.UuidRepresentation +import org.bson.codecs.kotlinx.utils.BsonCodecUtils.toJsonNamingStrategy import org.bson.internal.UuidHelper @OptIn(ExperimentalSerializationApi::class) @@ -42,6 +43,7 @@ internal interface JsonBsonDecoder : BsonDecoder, JsonDecoder { explicitNulls = configuration.explicitNulls encodeDefaults = configuration.encodeDefaults classDiscriminator = configuration.classDiscriminator + namingStrategy = configuration.bsonNamingStrategy.toJsonNamingStrategy() serializersModule = this@JsonBsonDecoder.serializersModule } diff --git a/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/JsonBsonEncoder.kt b/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/JsonBsonEncoder.kt index 6cff36a0909..4a754834e6d 100644 --- a/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/JsonBsonEncoder.kt +++ b/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/JsonBsonEncoder.kt @@ -30,6 +30,7 @@ import kotlinx.serialization.json.int import kotlinx.serialization.json.long import kotlinx.serialization.modules.SerializersModule import org.bson.BsonWriter +import org.bson.codecs.kotlinx.utils.BsonCodecUtils.toJsonNamingStrategy import org.bson.types.Decimal128 @OptIn(ExperimentalSerializationApi::class) @@ -52,6 +53,7 @@ internal class JsonBsonEncoder( explicitNulls = configuration.explicitNulls encodeDefaults = configuration.encodeDefaults classDiscriminator = configuration.classDiscriminator + namingStrategy = configuration.bsonNamingStrategy.toJsonNamingStrategy() serializersModule = this@JsonBsonEncoder.serializersModule } diff --git a/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/utils/BsonCodecUtils.kt b/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/utils/BsonCodecUtils.kt index eabfebc5833..daf6c7df6f9 100644 --- a/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/utils/BsonCodecUtils.kt +++ b/bson-kotlinx/src/main/kotlin/org/bson/codecs/kotlinx/utils/BsonCodecUtils.kt @@ -16,7 +16,10 @@ package org.bson.codecs.kotlinx.utils import kotlinx.serialization.ExperimentalSerializationApi +import kotlinx.serialization.SerializationException import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.descriptors.elementNames +import kotlinx.serialization.json.JsonNamingStrategy import kotlinx.serialization.modules.SerializersModule import org.bson.AbstractBsonReader import org.bson.BsonWriter @@ -28,6 +31,7 @@ import org.bson.codecs.kotlinx.BsonDocumentDecoder import org.bson.codecs.kotlinx.BsonEncoder import org.bson.codecs.kotlinx.BsonEncoderImpl import org.bson.codecs.kotlinx.BsonMapDecoder +import org.bson.codecs.kotlinx.BsonNamingStrategy import org.bson.codecs.kotlinx.BsonPolymorphicDecoder import org.bson.codecs.kotlinx.JsonBsonArrayDecoder import org.bson.codecs.kotlinx.JsonBsonDecoderImpl @@ -59,6 +63,8 @@ internal object BsonCodecUtils { } } + private val cachedElementNamesByDescriptor: MutableMap> = mutableMapOf() + internal fun createBsonEncoder( writer: BsonWriter, serializersModule: SerializersModule, @@ -116,4 +122,73 @@ internal object BsonCodecUtils { return if (hasJsonDecoder) JsonBsonMapDecoder(descriptor, reader, serializersModule, configuration) else BsonMapDecoder(descriptor, reader, serializersModule, configuration) } + + internal fun cacheElementNamesByDescriptor(descriptor: SerialDescriptor, configuration: BsonConfiguration) { + val convertedNameMap = + when (configuration.bsonNamingStrategy) { + BsonNamingStrategy.SNAKE_CASE -> { + val snakeCasedNames = descriptor.elementNames.associateWith { name -> convertCamelCase(name, '_') } + + snakeCasedNames.entries + .groupBy { entry -> entry.value } + .filter { group -> group.value.size > 1 } + .entries + .fold(StringBuilder("")) { acc, group -> + val keys = group.value.joinToString(", ") { entry -> entry.key } + acc.append("$keys in ${descriptor.serialName} generate same name: ${group.key}.\n") + } + .toString() + .takeIf { it.trim().isNotEmpty() } + ?.let { errorMessage: String -> throw SerializationException(errorMessage) } + + snakeCasedNames.entries.associate { it.value to it.key } + } + else -> emptyMap() + } + + cachedElementNamesByDescriptor[descriptor.serialName] = convertedNameMap + } + + internal fun getCachedElementNamesByDescriptor(descriptor: SerialDescriptor): Map { + return cachedElementNamesByDescriptor[descriptor.serialName] ?: emptyMap() + } + + // https://github.com/Kotlin/kotlinx.serialization/blob/f9f160a680da9f92c3bb121ae3644c96e57ba42e/formats/json/commonMain/src/kotlinx/serialization/json/JsonNamingStrategy.kt#L142-L174 + internal fun convertCamelCase(value: String, delimiter: Char) = + buildString(value.length * 2) { + var bufferedChar: Char? = null + var previousUpperCharsCount = 0 + + value.forEach { c -> + if (c.isUpperCase()) { + if (previousUpperCharsCount == 0 && isNotEmpty() && last() != delimiter) append(delimiter) + + bufferedChar?.let(::append) + + previousUpperCharsCount++ + bufferedChar = c.lowercaseChar() + } else { + if (bufferedChar != null) { + if (previousUpperCharsCount > 1 && c.isLetter()) { + append(delimiter) + } + append(bufferedChar) + previousUpperCharsCount = 0 + bufferedChar = null + } + append(c) + } + } + + if (bufferedChar != null) { + append(bufferedChar) + } + } + + internal fun BsonNamingStrategy?.toJsonNamingStrategy(): JsonNamingStrategy? { + return when (this) { + BsonNamingStrategy.SNAKE_CASE -> JsonNamingStrategy.SnakeCase + else -> null + } + } } diff --git a/bson-kotlinx/src/test/kotlin/org/bson/codecs/kotlinx/KotlinSerializerCodecTest.kt b/bson-kotlinx/src/test/kotlin/org/bson/codecs/kotlinx/KotlinSerializerCodecTest.kt index aa749368e04..f9b3eb753c5 100644 --- a/bson-kotlinx/src/test/kotlin/org/bson/codecs/kotlinx/KotlinSerializerCodecTest.kt +++ b/bson-kotlinx/src/test/kotlin/org/bson/codecs/kotlinx/KotlinSerializerCodecTest.kt @@ -81,6 +81,7 @@ import org.bson.codecs.kotlinx.samples.DataClassWithBsonId import org.bson.codecs.kotlinx.samples.DataClassWithBsonIgnore import org.bson.codecs.kotlinx.samples.DataClassWithBsonProperty import org.bson.codecs.kotlinx.samples.DataClassWithBsonRepresentation +import org.bson.codecs.kotlinx.samples.DataClassWithCamelCase import org.bson.codecs.kotlinx.samples.DataClassWithCollections import org.bson.codecs.kotlinx.samples.DataClassWithContextualDateValues import org.bson.codecs.kotlinx.samples.DataClassWithDataClassMapKey @@ -94,6 +95,7 @@ import org.bson.codecs.kotlinx.samples.DataClassWithFailingInit import org.bson.codecs.kotlinx.samples.DataClassWithJsonElement import org.bson.codecs.kotlinx.samples.DataClassWithJsonElements import org.bson.codecs.kotlinx.samples.DataClassWithJsonElementsNullable +import org.bson.codecs.kotlinx.samples.DataClassWithKotlinAllowedName import org.bson.codecs.kotlinx.samples.DataClassWithListThatLastItemDefaultsToNull import org.bson.codecs.kotlinx.samples.DataClassWithMutableList import org.bson.codecs.kotlinx.samples.DataClassWithMutableMap @@ -105,6 +107,7 @@ import org.bson.codecs.kotlinx.samples.DataClassWithNulls import org.bson.codecs.kotlinx.samples.DataClassWithPair import org.bson.codecs.kotlinx.samples.DataClassWithParameterizedDataClass import org.bson.codecs.kotlinx.samples.DataClassWithRequired +import org.bson.codecs.kotlinx.samples.DataClassWithSameSnakeCaseName import org.bson.codecs.kotlinx.samples.DataClassWithSequence import org.bson.codecs.kotlinx.samples.DataClassWithSimpleValues import org.bson.codecs.kotlinx.samples.DataClassWithTriple @@ -1126,6 +1129,40 @@ class KotlinSerializerCodecTest { } } + @Test + fun testSnakeCaseNamingStrategy() { + val expected = + """{"two_words": "", "my_property": "", "camel_case_underscores": "", "url_mapping": "", + | "my_http_auth": "", "my_http2_api_key": "", "my_http2fast_api_key": ""}""" + .trimMargin() + val dataClass = DataClassWithCamelCase() + assertRoundTrips(expected, dataClass, BsonConfiguration(bsonNamingStrategy = BsonNamingStrategy.SNAKE_CASE)) + } + + @Test + fun testSameSnakeCaseName() { + val expected = """{"my_http_auth": "", "my_http_auth1": ""}""" + val dataClass = DataClassWithSameSnakeCaseName() + val exception = + assertThrows { + assertRoundTrips( + expected, dataClass, BsonConfiguration(bsonNamingStrategy = BsonNamingStrategy.SNAKE_CASE)) + } + assertEquals( + "myHTTPAuth, myHttpAuth in org.bson.codecs.kotlinx.samples.DataClassWithSameSnakeCaseName" + + " generate same name: my_http_auth.\n" + + "myHTTPAuth1, myHttpAuth1 in org.bson.codecs.kotlinx.samples.DataClassWithSameSnakeCaseName" + + " generate same name: my_http_auth1.\n", + exception.message) + } + + @Test + fun testKotlinAllowedName() { + val expected = """{"имя_переменной": "", "variable _name": ""}""" + val dataClass = DataClassWithKotlinAllowedName() + assertRoundTrips(expected, dataClass, BsonConfiguration(bsonNamingStrategy = BsonNamingStrategy.SNAKE_CASE)) + } + private inline fun assertRoundTrips( expected: String, value: T, diff --git a/bson-kotlinx/src/test/kotlin/org/bson/codecs/kotlinx/samples/DataClasses.kt b/bson-kotlinx/src/test/kotlin/org/bson/codecs/kotlinx/samples/DataClasses.kt index e7a06600d20..773af52cd96 100644 --- a/bson-kotlinx/src/test/kotlin/org/bson/codecs/kotlinx/samples/DataClasses.kt +++ b/bson-kotlinx/src/test/kotlin/org/bson/codecs/kotlinx/samples/DataClasses.kt @@ -102,6 +102,31 @@ data class DataClassWithDefaults( val listSimple: List = listOf("a", "b", "c") ) +@Serializable +data class DataClassWithCamelCase( + val twoWords: String = "", + @Suppress("ConstructorParameterNaming") val MyProperty: String = "", + @Suppress("ConstructorParameterNaming") val camel_Case_Underscores: String = "", + @Suppress("ConstructorParameterNaming") val URLMapping: String = "", + val myHTTPAuth: String = "", + val myHTTP2ApiKey: String = "", + val myHTTP2fastApiKey: String = "", +) + +@Serializable +data class DataClassWithSameSnakeCaseName( + val myHTTPAuth: String = "", + val myHttpAuth: String = "", + val myHTTPAuth1: String = "", + val myHttpAuth1: String = "", +) + +@Serializable +data class DataClassWithKotlinAllowedName( + @Suppress("ConstructorParameterNaming") val имяПеременной: String = "", + @Suppress("ConstructorParameterNaming") val `variable Name`: String = "", +) + @Serializable data class DataClassWithNulls(val boolean: Boolean?, val string: String?, val listSimple: List?) @Serializable diff --git a/bson-record-codec/build.gradle b/bson-record-codec/build.gradle deleted file mode 100644 index 5a880461a77..00000000000 --- a/bson-record-codec/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -archivesBaseName = 'bson-record-codec' -description = 'The BSON Codec for Java records' - -ext { - pomName = 'BSON Record Codec' -} - -dependencies { - api project(path: ':bson', configuration: 'default') - testImplementation project(':bson').sourceSets.test.output - testImplementation project(':driver-core') -} - -afterEvaluate { - jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.bson.record.codec' - jar.manifest.attributes['Bundle-SymbolicName'] = 'org.mongodb.bson-record-codec' -} - -tasks.withType(Test) { - test.onlyIf { javaVersion.isCompatibleWith(javaVersion.VERSION_17) } -} - -tasks.withType(Javadoc) { - dependsOn(project(':bson').tasks.withType(Javadoc), project(':driver-core').tasks.withType(Javadoc)) -} diff --git a/bson-record-codec/build.gradle.kts b/bson-record-codec/build.gradle.kts new file mode 100644 index 00000000000..5165679c06b --- /dev/null +++ b/bson-record-codec/build.gradle.kts @@ -0,0 +1,53 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication + +plugins { + id("project.java") + id("conventions.test-artifacts") +} + +base.archivesName.set("bson-record-codec") + +dependencies { + api(project(path = ":bson", configuration = "default")) + + // Test case checks MongoClientSettings.getDefaultCodecRegistry() support + testImplementation(project(path = ":driver-core", configuration = "default")) +} + +configureMavenPublication { + pom { + name.set("BSON Record Codec") + description.set("The BSON Codec for Java records") + url.set("https://bsonspec.org/") + } +} + +configureJarManifest { + attributes["Automatic-Module-Name"] = "org.mongodb.bson.record.codec" + attributes["Bundle-SymbolicName"] = "org.mongodb.bson-record-codec" +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} + +tasks.withType { options.release.set(17) } + +tasks.withType().configureEach { onlyIf { javaVersion.isCompatibleWith(JavaVersion.VERSION_17) } } diff --git a/bson-scala/build.gradle b/bson-scala/build.gradle deleted file mode 100644 index 5d21ed521b5..00000000000 --- a/bson-scala/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -description = "A Scala wrapper / extension to the bson library" -archivesBaseName = 'mongo-scala-bson' - -dependencies { - api project(path: ':bson', configuration: 'default') -} - -sourceSets { - main { - scala { - if(scalaVersion.startsWith("2.13")) { - srcDirs = ["src/main/scala", "src/main/scala-2.13+"] - } else { - srcDirs = ["src/main/scala", "src/main/scala-2.13-"] - } - } - } -} - -tasks.withType(Test) { - doFirst { - println("Running Test task using scala version: $scalaVersion") - } -} - -// =================== -// Scala checks -// =================== -tasks.register("scalaCheck") { - description = "Runs all the Scala checks" - group = "verification" - - dependsOn("clean", "compileTestScala", "check") - tasks.findByName("check").mustRunAfter("clean") -} - -ext { - pomName = 'Mongo Scala Bson Library' -} - -test { - maxParallelForks = 1 -} - -afterEvaluate { - jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.bson.scala' - jar.manifest.attributes['Import-Package'] = [ - '!scala.*', - '*' - ].join(',') -} diff --git a/bson-scala/build.gradle.kts b/bson-scala/build.gradle.kts new file mode 100644 index 00000000000..e23087ae314 --- /dev/null +++ b/bson-scala/build.gradle.kts @@ -0,0 +1,37 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication + +plugins { id("project.scala") } + +base.archivesName.set("mongo-scala-bson") + +dependencies { api(project(path = ":bson", configuration = "default")) } + +configureMavenPublication { + pom { + name.set("Mongo Scala BSON Library") + description.set("A Scala wrapper / extension to the BSON library") + url.set("https://bsonspec.org/") + } +} + +configureJarManifest { + attributes["Automatic-Module-Name"] = "org.mongodb.bson.scala" + attributes["Bundle-SymbolicName"] = "org.mongodb.scala.mongo-scala-bson" + attributes["Import-Package"] = "!scala.*,*" +} diff --git a/bson-scala/src/test/scala/org/mongodb/scala/bson/BaseSpec.scala b/bson-scala/src/test/scala/org/mongodb/scala/bson/BaseSpec.scala index ad6cab0069a..4ac18c5b31c 100644 --- a/bson-scala/src/test/scala/org/mongodb/scala/bson/BaseSpec.scala +++ b/bson-scala/src/test/scala/org/mongodb/scala/bson/BaseSpec.scala @@ -15,10 +15,7 @@ */ package org.mongodb.scala.bson -import org.junit.runner.RunWith import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers -import org.scalatestplus.junit.JUnitRunner -@RunWith(classOf[JUnitRunner]) abstract class BaseSpec extends AnyFlatSpec with Matchers {} diff --git a/bson-scala/src/test/scala/org/mongodb/scala/bson/codecs/MacrosSpec.scala b/bson-scala/src/test/scala/org/mongodb/scala/bson/codecs/MacrosSpec.scala index c16215a16e8..e3c8ded2d89 100644 --- a/bson-scala/src/test/scala/org/mongodb/scala/bson/codecs/MacrosSpec.scala +++ b/bson-scala/src/test/scala/org/mongodb/scala/bson/codecs/MacrosSpec.scala @@ -531,6 +531,7 @@ class MacrosSpec extends BaseSpec { } it should "support tagged types in case classes" in { + assume(!scala.util.Properties.versionNumberString.startsWith("2.11")) val a = 1.asInstanceOf[Int with Tag] val b = "b".asInstanceOf[String with Tag] val c = Map("c" -> 0).asInstanceOf[Map[String with Tag, Int with Tag] with Tag] diff --git a/bson/build.gradle.kts b/bson/build.gradle.kts new file mode 100644 index 00000000000..fab3cdaacb5 --- /dev/null +++ b/bson/build.gradle.kts @@ -0,0 +1,39 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication + +plugins { + id("project.java") + id("conventions.testing-junit") + id("conventions.testing-spock") + id("conventions.test-artifacts") +} + +base.archivesName.set("bson") + +configureMavenPublication { + pom { + name.set("BSON") + description.set("The BSON library") + url.set("https://bsonspec.org/") + } +} + +configureJarManifest { + attributes["Automatic-Module-Name"] = "org.mongodb.bson" + attributes["Import-Package"] = "org.slf4j.*;resolution:=optional" +} diff --git a/bson/src/main/org/bson/AbstractBsonWriter.java b/bson/src/main/org/bson/AbstractBsonWriter.java index 8a8b238e8af..9d571862af0 100644 --- a/bson/src/main/org/bson/AbstractBsonWriter.java +++ b/bson/src/main/org/bson/AbstractBsonWriter.java @@ -20,10 +20,11 @@ import org.bson.types.ObjectId; import java.io.Closeable; +import java.util.ArrayDeque; import java.util.Arrays; +import java.util.Deque; import java.util.List; import java.util.Map; -import java.util.Stack; import static java.lang.String.format; import static org.bson.assertions.Assertions.notNull; @@ -35,7 +36,7 @@ */ public abstract class AbstractBsonWriter implements BsonWriter, Closeable { private final BsonWriterSettings settings; - private final Stack fieldNameValidatorStack = new Stack<>(); + private final Deque fieldNameValidatorStack = new ArrayDeque<>(); private State state; private Context context; private int serializationDepth; diff --git a/bson/src/main/org/bson/BsonBinaryWriter.java b/bson/src/main/org/bson/BsonBinaryWriter.java index e6255ea8478..20e73d97d44 100644 --- a/bson/src/main/org/bson/BsonBinaryWriter.java +++ b/bson/src/main/org/bson/BsonBinaryWriter.java @@ -21,9 +21,11 @@ import org.bson.types.Decimal128; import org.bson.types.ObjectId; +import java.util.ArrayDeque; +import java.util.Deque; import java.util.List; -import java.util.Stack; +import static java.lang.Math.max; import static java.lang.String.format; import static org.bson.assertions.Assertions.notNull; @@ -36,9 +38,38 @@ public class BsonBinaryWriter extends AbstractBsonWriter { private final BsonBinaryWriterSettings binaryWriterSettings; private final BsonOutput bsonOutput; - private final Stack maxDocumentSizeStack = new Stack<>(); + private final Deque maxDocumentSizeStack = new ArrayDeque<>(); + private static final int ARRAY_INDEXES_CACHE_SIZE = 1000; + private static final byte[] ARRAY_INDEXES_BUFFER; + private static final int[] ARRAY_INDEXES_OFFSETS; + private static final int[] ARRAY_INDEXES_LENGTHS; private Mark mark; + static { + ARRAY_INDEXES_LENGTHS = new int[ARRAY_INDEXES_CACHE_SIZE]; + ARRAY_INDEXES_OFFSETS = new int[ARRAY_INDEXES_CACHE_SIZE]; + int totalSize = 0; + for (int i = 0; i < ARRAY_INDEXES_CACHE_SIZE; i++) { + totalSize += (int) (Math.log10(max(i, 1)) + + 1 // number of digits + + 1); // +1 for null terminator + } + ARRAY_INDEXES_BUFFER = new byte[totalSize]; + + // Fill buffer + int offset = 0; + for (int i = 0; i < ARRAY_INDEXES_CACHE_SIZE; i++) { + String string = Integer.toString(i); + int length = string.length(); + for (int j = 0; j < length; j++) { + ARRAY_INDEXES_BUFFER[offset++] = (byte) string.charAt(j); + } + ARRAY_INDEXES_BUFFER[offset++] = 0; + ARRAY_INDEXES_OFFSETS[i] = offset - (length + 1); + ARRAY_INDEXES_LENGTHS[i] = length + 1; // +1 for null terminator + } + } + /** * Construct an instance. * @@ -259,7 +290,7 @@ public void doWriteNull() { public void doWriteObjectId(final ObjectId value) { bsonOutput.writeByte(BsonType.OBJECT_ID.getValue()); writeCurrentName(); - bsonOutput.writeBytes(value.toByteArray()); + bsonOutput.writeObjectId(value); } @Override @@ -397,7 +428,14 @@ public void reset() { private void writeCurrentName() { if (getContext().getContextType() == BsonContextType.ARRAY) { - bsonOutput.writeCString(Integer.toString(getContext().index++)); + int index = getContext().index++; + if (index >= ARRAY_INDEXES_CACHE_SIZE) { + bsonOutput.writeCString(Integer.toString(index)); + } else { + bsonOutput.writeBytes(ARRAY_INDEXES_BUFFER, + ARRAY_INDEXES_OFFSETS[index], + ARRAY_INDEXES_LENGTHS[index]); + } } else { bsonOutput.writeCString(getName()); } diff --git a/bson/src/main/org/bson/ByteBuf.java b/bson/src/main/org/bson/ByteBuf.java index e44a97dfc67..cd14d2f93df 100644 --- a/bson/src/main/org/bson/ByteBuf.java +++ b/bson/src/main/org/bson/ByteBuf.java @@ -42,12 +42,12 @@ public interface ByteBuf { *

Writes the given byte into this buffer at the given index.

* * @param index The index at which the byte will be written - * @param b The byte value to be written + * @param value The byte value to be written * @return This buffer * @throws IndexOutOfBoundsException If {@code index} is negative or not smaller than the buffer's limit * @throws java.nio.ReadOnlyBufferException If this buffer is read-only */ - ByteBuf put(int index, byte b); + ByteBuf put(int index, byte value); /** * Returns the number of elements between the current position and the limit. @@ -99,12 +99,61 @@ public interface ByteBuf { * *

Writes the given byte into this buffer at the current position, and then increments the position.

* - * @param b The byte to be written + * @param value The byte to be written * @return This buffer * @throws java.nio.BufferOverflowException If this buffer's current position is not smaller than its limit * @throws java.nio.ReadOnlyBufferException If this buffer is read-only */ - ByteBuf put(byte b); + ByteBuf put(byte value); + + /** + * Writes the given int value into this buffer at the current position, + * using the current byte order, and increments the position by 4. + * + * @param value the int value to be written + * @return this buffer + * @throws java.nio.BufferOverflowException if there are fewer than 4 bytes remaining in this buffer + * @throws java.nio.ReadOnlyBufferException if this buffer is read-only + * @since 5.4 + */ + ByteBuf putInt(int value); + + /** + * Writes the given int value into this buffer at the current position, + * using the current byte order, and increments the position by 4. + * + * @param value the int value to be written + * @param index the index at which the int will be written + * @return this buffer + * @throws java.nio.BufferOverflowException if there are fewer than 4 bytes remaining in this buffer + * @throws java.nio.ReadOnlyBufferException if this buffer is read-only + * @since 5.4 + */ + ByteBuf putInt(int index, int value); + + /** + * Writes the given double value into this buffer at the current position, + * using the current byte order, and increments the position by 8. + * + * @param value the double value to be written + * @return this buffer + * @throws java.nio.BufferOverflowException if there are fewer than 8 bytes remaining in this buffer + * @throws java.nio.ReadOnlyBufferException if this buffer is read-only + * @since 5.4 + */ + ByteBuf putDouble(double value); + + /** + * Writes the given long value into this buffer at the current position, + * using the current byte order, and increments the position by 8. + * + * @param value the long value to be written + * @return this buffer + * @throws java.nio.BufferOverflowException if there are fewer than 8 bytes remaining in this buffer + * @throws java.nio.ReadOnlyBufferException if this buffer is read-only + * @since 5.4 + */ + ByteBuf putLong(long value); /** *

Flips this buffer. The limit is set to the current position and then the position is set to zero. If the mark is defined then it @@ -136,6 +185,27 @@ public interface ByteBuf { */ byte[] array(); + /** + *

States whether this buffer is backed by an accessible byte array.

+ * + *

If this method returns {@code true} then the {@link #array()} and {@link #arrayOffset()} methods may safely be invoked.

+ * + * @return {@code true} if, and only if, this buffer is backed by an array and is not read-only + * @since 5.5 + */ + boolean isBackedByArray(); + + /** + * Returns the offset of the first byte within the backing byte array of + * this buffer. + * + * @return the offset within this buffer's array. + * @throws java.nio.ReadOnlyBufferException If this buffer is backed by an array but is read-only + * @throws UnsupportedOperationException if this buffer is not backed by an accessible array + * @since 5.5 + */ + int arrayOffset(); + /** * Returns this buffer's limit. * diff --git a/bson/src/main/org/bson/ByteBufNIO.java b/bson/src/main/org/bson/ByteBufNIO.java index 83bfa7d893a..dfcc6379070 100644 --- a/bson/src/main/org/bson/ByteBufNIO.java +++ b/bson/src/main/org/bson/ByteBufNIO.java @@ -97,6 +97,30 @@ public ByteBuf put(final byte b) { return this; } + @Override + public ByteBuf putInt(final int b) { + buf.putInt(b); + return this; + } + + @Override + public ByteBuf putInt(final int index, final int b) { + buf.putInt(index, b); + return this; + } + + @Override + public ByteBuf putDouble(final double b) { + buf.putDouble(b); + return this; + } + + @Override + public ByteBuf putLong(final long b) { + buf.putLong(b); + return this; + } + @Override public ByteBuf flip() { ((Buffer) buf).flip(); @@ -108,6 +132,16 @@ public byte[] array() { return buf.array(); } + @Override + public boolean isBackedByArray() { + return buf.hasArray(); + } + + @Override + public int arrayOffset() { + return buf.arrayOffset(); + } + @Override public int limit() { return buf.limit(); @@ -160,8 +194,13 @@ public ByteBuf get(final byte[] bytes, final int offset, final int length) { @Override public ByteBuf get(final int index, final byte[] bytes, final int offset, final int length) { - for (int i = 0; i < length; i++) { - bytes[offset + i] = buf.get(index + i); + if (buf.hasArray()) { + System.arraycopy(buf.array(), index, bytes, offset, length); + } else { + // Fallback to per-byte copying if no backing array is available. + for (int i = 0; i < length; i++) { + bytes[offset + i] = buf.get(index + i); + } } return this; } diff --git a/bson/src/main/org/bson/assertions/Assertions.java b/bson/src/main/org/bson/assertions/Assertions.java index 414c318122d..16e4a3f1737 100644 --- a/bson/src/main/org/bson/assertions/Assertions.java +++ b/bson/src/main/org/bson/assertions/Assertions.java @@ -103,6 +103,18 @@ public static AssertionError fail(final String msg) throws AssertionError { throw new AssertionError(assertNotNull(msg)); } + /** + * @param msg The failure message. + * @param cause The underlying cause + * @return Never completes normally. The return type is {@link AssertionError} to allow writing + * {@code throw fail("failure message", throwable)}. + * This may be helpful in non-{@code void} methods. + * @throws AssertionError Always + */ + public static AssertionError fail(final String msg, final Throwable cause) throws AssertionError { + throw new AssertionError(assertNotNull(msg), assertNotNull(cause)); + } + /** * @param value A value to check. * @param The type of {@code value}. diff --git a/bson/src/main/org/bson/codecs/BsonArrayCodec.java b/bson/src/main/org/bson/codecs/BsonArrayCodec.java index 9b4bef5e4c5..6d16bb7d1b0 100644 --- a/bson/src/main/org/bson/codecs/BsonArrayCodec.java +++ b/bson/src/main/org/bson/codecs/BsonArrayCodec.java @@ -24,6 +24,7 @@ import org.bson.codecs.configuration.CodecRegistry; import static org.bson.assertions.Assertions.notNull; +import static org.bson.codecs.BsonValueCodecProvider.getBsonTypeClassMap; import static org.bson.codecs.configuration.CodecRegistries.fromProviders; /** @@ -34,8 +35,8 @@ public class BsonArrayCodec implements Codec { private static final CodecRegistry DEFAULT_REGISTRY = fromProviders(new BsonValueCodecProvider()); - - private final CodecRegistry codecRegistry; + private static final BsonTypeCodecMap DEFAULT_BSON_TYPE_CODEC_MAP = new BsonTypeCodecMap(getBsonTypeClassMap(), DEFAULT_REGISTRY); + private final BsonTypeCodecMap bsonTypeCodecMap; /** * Creates a new instance with a default codec registry that uses the {@link BsonValueCodecProvider}. @@ -43,7 +44,7 @@ public class BsonArrayCodec implements Codec { * @since 3.4 */ public BsonArrayCodec() { - this(DEFAULT_REGISTRY); + this(DEFAULT_BSON_TYPE_CODEC_MAP); } /** @@ -52,7 +53,11 @@ public BsonArrayCodec() { * @param codecRegistry the codec registry */ public BsonArrayCodec(final CodecRegistry codecRegistry) { - this.codecRegistry = notNull("codecRegistry", codecRegistry); + this(new BsonTypeCodecMap(getBsonTypeClassMap(), codecRegistry)); + } + + private BsonArrayCodec(final BsonTypeCodecMap bsonTypeCodecMap) { + this.bsonTypeCodecMap = notNull("bsonTypeCodecMap", bsonTypeCodecMap); } @Override @@ -72,7 +77,7 @@ public void encode(final BsonWriter writer, final BsonArray array, final Encoder writer.writeStartArray(); for (BsonValue value : array) { - Codec codec = codecRegistry.get(value.getClass()); + Codec codec = bsonTypeCodecMap.get(value.getBsonType()); encoderContext.encodeWithChildContext(codec, writer, value); } @@ -93,7 +98,7 @@ public Class getEncoderClass() { * @return the non-null value read from the reader */ protected BsonValue readValue(final BsonReader reader, final DecoderContext decoderContext) { - return codecRegistry.get(BsonValueCodecProvider.getClassForBsonType(reader.getCurrentBsonType())).decode(reader, decoderContext); + BsonType currentBsonType = reader.getCurrentBsonType(); + return (BsonValue) bsonTypeCodecMap.get(currentBsonType).decode(reader, decoderContext); } - } diff --git a/bson/src/main/org/bson/codecs/BsonDocumentCodec.java b/bson/src/main/org/bson/codecs/BsonDocumentCodec.java index 405fd78e117..75bd3b7a2b0 100644 --- a/bson/src/main/org/bson/codecs/BsonDocumentCodec.java +++ b/bson/src/main/org/bson/codecs/BsonDocumentCodec.java @@ -17,7 +17,6 @@ package org.bson.codecs; import org.bson.BsonDocument; -import org.bson.BsonElement; import org.bson.BsonObjectId; import org.bson.BsonReader; import org.bson.BsonType; @@ -26,8 +25,6 @@ import org.bson.codecs.configuration.CodecRegistry; import org.bson.types.ObjectId; -import java.util.ArrayList; -import java.util.List; import java.util.Map; import static org.bson.assertions.Assertions.notNull; @@ -79,17 +76,15 @@ public CodecRegistry getCodecRegistry() { @Override public BsonDocument decode(final BsonReader reader, final DecoderContext decoderContext) { - List keyValuePairs = new ArrayList<>(); - + BsonDocument bsonDocument = new BsonDocument(); reader.readStartDocument(); while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) { String fieldName = reader.readName(); - keyValuePairs.add(new BsonElement(fieldName, readValue(reader, decoderContext))); + bsonDocument.append(fieldName, readValue(reader, decoderContext)); } reader.readEndDocument(); - - return new BsonDocument(keyValuePairs); + return bsonDocument; } /** @@ -135,7 +130,7 @@ private boolean skipField(final EncoderContext encoderContext, final String key) @SuppressWarnings({"unchecked", "rawtypes"}) private void writeValue(final BsonWriter writer, final EncoderContext encoderContext, final BsonValue value) { - Codec codec = codecRegistry.get(value.getClass()); + Codec codec = bsonTypeCodecMap.get(value.getBsonType()); encoderContext.encodeWithChildContext(codec, writer, value); } diff --git a/bson/src/main/org/bson/codecs/BsonTypeClassMap.java b/bson/src/main/org/bson/codecs/BsonTypeClassMap.java index 82144e9b4aa..32acaeb7f85 100644 --- a/bson/src/main/org/bson/codecs/BsonTypeClassMap.java +++ b/bson/src/main/org/bson/codecs/BsonTypeClassMap.java @@ -31,12 +31,11 @@ import org.bson.types.ObjectId; import org.bson.types.Symbol; +import java.util.Arrays; import java.util.Collections; import java.util.Date; -import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Set; /** *

A map from a BSON types to the Class to which it should be decoded. This class is useful if, for example, @@ -71,7 +70,7 @@ */ public class BsonTypeClassMap { static final BsonTypeClassMap DEFAULT_BSON_TYPE_CLASS_MAP = new BsonTypeClassMap(); - private final Map> map = new HashMap<>(); + private final Class[] bsonTypeOrdinalToClassMap = new Class[256]; /** * Construct an instance with the default mapping, but replacing the default mapping with any values contained in the given map. @@ -81,7 +80,7 @@ public class BsonTypeClassMap { */ public BsonTypeClassMap(final Map> replacementsForDefaults) { addDefaults(); - map.putAll(replacementsForDefaults); + replacementsForDefaults.forEach((key, value) -> bsonTypeOrdinalToClassMap[key.getValue()] = value); } /** @@ -91,10 +90,6 @@ public BsonTypeClassMap() { this(Collections.emptyMap()); } - Set keys() { - return map.keySet(); - } - /** * Gets the Class that is mapped to the given BSON type. * @@ -102,30 +97,30 @@ Set keys() { * @return the Class that is mapped to the BSON type */ public Class get(final BsonType bsonType) { - return map.get(bsonType); + return bsonTypeOrdinalToClassMap[bsonType.getValue()]; } private void addDefaults() { - map.put(BsonType.ARRAY, List.class); - map.put(BsonType.BINARY, Binary.class); - map.put(BsonType.BOOLEAN, Boolean.class); - map.put(BsonType.DATE_TIME, Date.class); - map.put(BsonType.DB_POINTER, BsonDbPointer.class); - map.put(BsonType.DOCUMENT, Document.class); - map.put(BsonType.DOUBLE, Double.class); - map.put(BsonType.INT32, Integer.class); - map.put(BsonType.INT64, Long.class); - map.put(BsonType.DECIMAL128, Decimal128.class); - map.put(BsonType.MAX_KEY, MaxKey.class); - map.put(BsonType.MIN_KEY, MinKey.class); - map.put(BsonType.JAVASCRIPT, Code.class); - map.put(BsonType.JAVASCRIPT_WITH_SCOPE, CodeWithScope.class); - map.put(BsonType.OBJECT_ID, ObjectId.class); - map.put(BsonType.REGULAR_EXPRESSION, BsonRegularExpression.class); - map.put(BsonType.STRING, String.class); - map.put(BsonType.SYMBOL, Symbol.class); - map.put(BsonType.TIMESTAMP, BsonTimestamp.class); - map.put(BsonType.UNDEFINED, BsonUndefined.class); + bsonTypeOrdinalToClassMap[BsonType.ARRAY.getValue()] = List.class; + bsonTypeOrdinalToClassMap[BsonType.BINARY.getValue()] = Binary.class; + bsonTypeOrdinalToClassMap[BsonType.BOOLEAN.getValue()] = Boolean.class; + bsonTypeOrdinalToClassMap[BsonType.DATE_TIME.getValue()] = Date.class; + bsonTypeOrdinalToClassMap[BsonType.DB_POINTER.getValue()] = BsonDbPointer.class; + bsonTypeOrdinalToClassMap[BsonType.DOCUMENT.getValue()] = Document.class; + bsonTypeOrdinalToClassMap[BsonType.DOUBLE.getValue()] = Double.class; + bsonTypeOrdinalToClassMap[BsonType.INT32.getValue()] = Integer.class; + bsonTypeOrdinalToClassMap[BsonType.INT64.getValue()] = Long.class; + bsonTypeOrdinalToClassMap[BsonType.DECIMAL128.getValue()] = Decimal128.class; + bsonTypeOrdinalToClassMap[BsonType.MAX_KEY.getValue()] = MaxKey.class; + bsonTypeOrdinalToClassMap[BsonType.MIN_KEY.getValue()] = MinKey.class; + bsonTypeOrdinalToClassMap[BsonType.JAVASCRIPT.getValue()] = Code.class; + bsonTypeOrdinalToClassMap[BsonType.JAVASCRIPT_WITH_SCOPE.getValue()] = CodeWithScope.class; + bsonTypeOrdinalToClassMap[BsonType.OBJECT_ID.getValue()] = ObjectId.class; + bsonTypeOrdinalToClassMap[BsonType.REGULAR_EXPRESSION.getValue()] = BsonRegularExpression.class; + bsonTypeOrdinalToClassMap[BsonType.STRING.getValue()] = String.class; + bsonTypeOrdinalToClassMap[BsonType.SYMBOL.getValue()] = Symbol.class; + bsonTypeOrdinalToClassMap[BsonType.TIMESTAMP.getValue()] = BsonTimestamp.class; + bsonTypeOrdinalToClassMap[BsonType.UNDEFINED.getValue()] = BsonUndefined.class; } @Override @@ -139,15 +134,11 @@ public boolean equals(final Object o) { BsonTypeClassMap that = (BsonTypeClassMap) o; - if (!map.equals(that.map)) { - return false; - } - - return true; + return Arrays.equals(bsonTypeOrdinalToClassMap, that.bsonTypeOrdinalToClassMap); } @Override public int hashCode() { - return map.hashCode(); + return Arrays.hashCode(bsonTypeOrdinalToClassMap); } } diff --git a/bson/src/main/org/bson/codecs/BsonTypeCodecMap.java b/bson/src/main/org/bson/codecs/BsonTypeCodecMap.java index 510a6041a0b..3a3def7ca7f 100644 --- a/bson/src/main/org/bson/codecs/BsonTypeCodecMap.java +++ b/bson/src/main/org/bson/codecs/BsonTypeCodecMap.java @@ -40,7 +40,7 @@ public class BsonTypeCodecMap { public BsonTypeCodecMap(final BsonTypeClassMap bsonTypeClassMap, final CodecRegistry codecRegistry) { this.bsonTypeClassMap = notNull("bsonTypeClassMap", bsonTypeClassMap); notNull("codecRegistry", codecRegistry); - for (BsonType cur : bsonTypeClassMap.keys()) { + for (BsonType cur : BsonType.values()) { Class clazz = bsonTypeClassMap.get(cur); if (clazz != null) { try { diff --git a/bson/src/main/org/bson/codecs/DocumentCodec.java b/bson/src/main/org/bson/codecs/DocumentCodec.java index 3559e93fcae..0c4161f53fd 100644 --- a/bson/src/main/org/bson/codecs/DocumentCodec.java +++ b/bson/src/main/org/bson/codecs/DocumentCodec.java @@ -156,7 +156,7 @@ public void encode(final BsonWriter writer, final Document document, final Encod beforeFields(writer, encoderContext, document); - for (final Map.Entry entry : ((Map) document).entrySet()) { + for (final Map.Entry entry : document.entrySet()) { if (skipField(encoderContext, entry.getKey())) { continue; } diff --git a/bson/src/main/org/bson/io/BasicOutputBuffer.java b/bson/src/main/org/bson/io/BasicOutputBuffer.java index 8227940182e..aaff34d6476 100644 --- a/bson/src/main/org/bson/io/BasicOutputBuffer.java +++ b/bson/src/main/org/bson/io/BasicOutputBuffer.java @@ -18,11 +18,14 @@ import org.bson.ByteBuf; import org.bson.ByteBufNIO; +import org.bson.types.ObjectId; import java.io.IOException; import java.io.OutputStream; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.util.Arrays; +import java.util.Collections; import java.util.List; import static java.lang.String.format; @@ -32,8 +35,12 @@ * A BSON output stream that stores the output in a single, un-pooled byte array. */ public class BasicOutputBuffer extends OutputBuffer { - private byte[] buffer; - private int position; + + /** + * This ByteBuffer allows us to write ObjectIDs without allocating a temporary array per object, and enables us + * to leverage JVM intrinsics for writing little-endian numeric values. + */ + private ByteBuffer buffer; /** * Construct an instance with a default initial byte array size. @@ -48,7 +55,8 @@ public BasicOutputBuffer() { * @param initialSize the initial size of the byte array */ public BasicOutputBuffer(final int initialSize) { - buffer = new byte[initialSize]; + // Allocate heap buffer to ensure we can access underlying array + buffer = ByteBuffer.allocate(initialSize).order(LITTLE_ENDIAN); } /** @@ -58,13 +66,46 @@ public BasicOutputBuffer(final int initialSize) { * @since 3.3 */ public byte[] getInternalBuffer() { - return buffer; + return buffer.array(); } @Override public void write(final byte[] b) { + writeBytes(b, 0, b.length); + } + + @Override + public byte[] toByteArray() { + ensureOpen(); + return Arrays.copyOf(buffer.array(), buffer.position()); + } + + @Override + public void writeInt32(final int value) { + ensureOpen(); + ensure(4); + buffer.putInt(value); + } + + @Override + public void writeInt32(final int position, final int value) { + ensureOpen(); + checkPosition(position, 4); + buffer.putInt(position, value); + } + + @Override + public void writeInt64(final long value) { + ensureOpen(); + ensure(8); + buffer.putLong(value); + } + + @Override + public void writeObjectId(final ObjectId value) { ensureOpen(); - write(b, 0, b.length); + ensure(12); + value.putToByteBuffer(buffer); } @Override @@ -72,8 +113,7 @@ public void writeBytes(final byte[] bytes, final int offset, final int length) { ensureOpen(); ensure(length); - System.arraycopy(bytes, offset, buffer, position, length); - position += length; + buffer.put(bytes, offset, length); } @Override @@ -81,27 +121,21 @@ public void writeByte(final int value) { ensureOpen(); ensure(1); - buffer[position++] = (byte) (0xFF & value); + buffer.put((byte) (0xFF & value)); } @Override protected void write(final int absolutePosition, final int value) { ensureOpen(); + checkPosition(absolutePosition, 1); - if (absolutePosition < 0) { - throw new IllegalArgumentException(format("position must be >= 0 but was %d", absolutePosition)); - } - if (absolutePosition > position - 1) { - throw new IllegalArgumentException(format("position must be <= %d but was %d", position - 1, absolutePosition)); - } - - buffer[absolutePosition] = (byte) (0xFF & value); + buffer.put(absolutePosition, (byte) (0xFF & value)); } @Override public int getPosition() { ensureOpen(); - return position; + return buffer.position(); } /** @@ -110,29 +144,32 @@ public int getPosition() { @Override public int getSize() { ensureOpen(); - return position; + return buffer.position(); } @Override public int pipe(final OutputStream out) throws IOException { ensureOpen(); - out.write(buffer, 0, position); - return position; + out.write(buffer.array(), 0, buffer.position()); + return buffer.position(); } @Override public void truncateToPosition(final int newPosition) { ensureOpen(); - if (newPosition > position || newPosition < 0) { + if (newPosition > buffer.position() || newPosition < 0) { throw new IllegalArgumentException(); } - position = newPosition; + // The cast is required for compatibility with JDK 9+ where ByteBuffer's position method is inherited from Buffer. + ((Buffer) buffer).position(newPosition); } @Override public List getByteBuffers() { ensureOpen(); - return Arrays.asList(new ByteBufNIO(ByteBuffer.wrap(buffer, 0, position).duplicate().order(LITTLE_ENDIAN))); + // Create a flipped copy of the buffer for reading. Note that ByteBufNIO overwrites the endian-ness. + ByteBuffer flipped = ByteBuffer.wrap(buffer.array(), 0, buffer.position()); + return Collections.singletonList(new ByteBufNIO(flipped)); } @Override @@ -147,19 +184,32 @@ private void ensureOpen() { } private void ensure(final int more) { - int need = position + more; - if (need <= buffer.length) { + int length = buffer.position(); + int need = length + more; + if (need <= buffer.capacity()) { return; } - int newSize = buffer.length * 2; + int newSize = length * 2; if (newSize < need) { newSize = need + 128; } - byte[] n = new byte[newSize]; - System.arraycopy(buffer, 0, n, 0, position); - buffer = n; + ByteBuffer tmp = ByteBuffer.allocate(newSize).order(LITTLE_ENDIAN); + tmp.put(buffer.array(), 0, length); // Avoids covariant call to flip on jdk8 + this.buffer = tmp; } + /** + * Ensures that `absolutePosition` is a valid index in `this.buffer` and there is room to write at + * least `bytesToWrite` bytes. + */ + private void checkPosition(final int absolutePosition, final int bytesToWrite) { + if (absolutePosition < 0) { + throw new IllegalArgumentException(format("position must be >= 0 but was %d", absolutePosition)); + } + if (absolutePosition > buffer.position() - bytesToWrite) { + throw new IllegalArgumentException(format("position must be <= %d but was %d", buffer.position() - bytesToWrite, absolutePosition)); + } + } } diff --git a/bson/src/main/org/bson/io/ByteBufferBsonInput.java b/bson/src/main/org/bson/io/ByteBufferBsonInput.java index a5a0e7a5421..2819bdcb091 100644 --- a/bson/src/main/org/bson/io/ByteBufferBsonInput.java +++ b/bson/src/main/org/bson/io/ByteBufferBsonInput.java @@ -33,6 +33,13 @@ public class ByteBufferBsonInput implements BsonInput { private static final String[] ONE_BYTE_ASCII_STRINGS = new String[Byte.MAX_VALUE + 1]; + /* A dynamically sized scratch buffer, that is reused across BSON String reads: + * 1. Reduces garbage collection by avoiding new byte array creation. + * 2. Improves cache utilization through temporal locality. + * 3. Avoids JVM allocation and zeroing cost for new memory allocations. + */ + private byte[] scratchBuffer; + static { for (int b = 0; b < ONE_BYTE_ASCII_STRINGS.length; b++) { @@ -127,15 +134,13 @@ public String readString() { @Override public String readCString() { - int mark = buffer.position(); - skipCString(); - int size = buffer.position() - mark; - buffer.position(mark); + ensureOpen(); + int size = computeCStringLength(buffer.position()); return readString(size); } - private String readString(final int size) { - if (size == 2) { + private String readString(final int bsonStringSize) { + if (bsonStringSize == 2) { byte asciiByte = buffer.get(); // if only one byte in the string, it must be ascii. byte nullByte = buffer.get(); // read null terminator if (nullByte != 0) { @@ -146,26 +151,104 @@ private String readString(final int size) { } return ONE_BYTE_ASCII_STRINGS[asciiByte]; // this will throw if asciiByte is negative } else { - byte[] bytes = new byte[size - 1]; - buffer.get(bytes); - byte nullByte = buffer.get(); - if (nullByte != 0) { - throw new BsonSerializationException("Found a BSON string that is not null-terminated"); + if (buffer.isBackedByArray()) { + int position = buffer.position(); + int arrayOffset = buffer.arrayOffset(); + int newPosition = position + bsonStringSize; + buffer.position(newPosition); + + byte[] array = buffer.array(); + if (array[arrayOffset + newPosition - 1] != 0) { + throw new BsonSerializationException("Found a BSON string that is not null-terminated"); + } + return new String(array, arrayOffset + position, bsonStringSize - 1, StandardCharsets.UTF_8); + } else if (scratchBuffer == null || bsonStringSize > scratchBuffer.length) { + int scratchBufferSize = bsonStringSize + (bsonStringSize >>> 1); //1.5 times the size + scratchBuffer = new byte[scratchBufferSize]; } - return new String(bytes, StandardCharsets.UTF_8); + + buffer.get(scratchBuffer, 0, bsonStringSize); + if (scratchBuffer[bsonStringSize - 1] != 0) { + throw new BsonSerializationException("BSON string not null-terminated"); + } + return new String(scratchBuffer, 0, bsonStringSize - 1, StandardCharsets.UTF_8); } } @Override public void skipCString() { ensureOpen(); - boolean checkNext = true; - while (checkNext) { - if (!buffer.hasRemaining()) { - throw new BsonSerializationException("Found a BSON string that is not null-terminated"); + int pos = buffer.position(); + int length = computeCStringLength(pos); + buffer.position(pos + length); + } + + /** + * Detects the position of the first NULL (0x00) byte in a 64-bit word using SWAR technique. + * + */ + private int computeCStringLength(final int prevPos) { + int pos = prevPos; + int limit = buffer.limit(); + + // `>>> 3` means dividing without remainder by `Long.BYTES` because `Long.BYTES` is 2^3 + int chunks = (limit - pos) >>> 3; + // `<< 3` means multiplying by `Long.BYTES` because `Long.BYTES` is 2^3 + int toPos = pos + (chunks << 3); + for (; pos < toPos; pos += Long.BYTES) { + long chunk = buffer.getLong(pos); + /* + Subtract 0x0101010101010101L to cause a borrow on 0x00 bytes. + if original byte is 00000000, then 00000000 - 00000001 = 11111111 (borrow causes the most significant bit set to 1). + */ + long mask = chunk - 0x0101010101010101L; + /* + mask will only have the most significant bit in each byte set iff it was a 0x00 byte (0x00 becomes 0xFF because of the borrow). + ~chunk will have bits that were originally 0 set to 1. + mask & ~chunk will have the most significant bit in each byte set iff original byte was 0x00. + */ + mask &= ~chunk; + /* + 0x8080808080808080: + 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 + + mask: + 00000000 00000000 11111111 00000000 00000001 00000001 00000000 00000111 + + ANDing mask with 0x8080808080808080 isolates the most significant bit in each byte where + the original byte was 0x00, thereby setting the most significant bit to 1 in each 0x00 original byte. + + result: + 00000000 00000000 10000000 00000000 00000000 00000000 00000000 00000000 + ^^^^^^^^ + The most significant bit is set in each 0x00 byte, and only there. + */ + mask &= 0x8080808080808080L; + if (mask != 0) { + /* + The UTF-8 data is endian-independent and stored in left-to-right order in the buffer, with the first byte at the lowest index. + After calling getLong() in little-endian mode, the first UTF-8 byte ends up in the least significant byte of the long (bits 0–7), + and the last one in the most significant byte (bits 56–63). + + numberOfTrailingZeros scans from the least significant bit, which aligns with the position of the first UTF-8 byte. + We then use >>> 3, which means dividing without remainder by Long.BYTES because Long.BYTES is 2^3, computing the byte offset + of the NULL terminator in the original UTF-8 data. + */ + int offset = Long.numberOfTrailingZeros(mask) >>> 3; + // Find the NULL terminator at pos + offset + return (pos - prevPos) + offset + 1; } - checkNext = buffer.get() != 0; } + + // Process remaining bytes one by one. + while (pos < limit) { + if (buffer.get(pos++) == 0) { + return (pos - prevPos); + } + } + + buffer.position(pos); + throw new BsonSerializationException("Found a BSON string that is not null-terminated"); } @Override diff --git a/bson/src/main/org/bson/io/OutputBuffer.java b/bson/src/main/org/bson/io/OutputBuffer.java index 00f88cea706..d4ae12d4245 100644 --- a/bson/src/main/org/bson/io/OutputBuffer.java +++ b/bson/src/main/org/bson/io/OutputBuffer.java @@ -70,6 +70,7 @@ public void writeInt32(final int value) { } @Override + @Deprecated public void writeInt32(final int position, final int value) { write(position, value >> 0); write(position + 1, value >> 8); @@ -196,7 +197,15 @@ public void writeLong(final long value) { writeInt64(value); } - private int writeCharacters(final String str, final boolean checkForNullCharacters) { + /** + * Writes the characters of a string to the buffer as UTF-8 bytes. + * + * @param str the string to write. + * @param checkForNullCharacters if true, check for and disallow null characters in the string. + * @return the total number of bytes written. + * @throws BsonSerializationException if checkForNullCharacters is true and the string contains a null character. + */ + protected int writeCharacters(final String str, final boolean checkForNullCharacters) { int len = str.length(); int total = 0; diff --git a/bson/src/main/org/bson/json/JsonMode.java b/bson/src/main/org/bson/json/JsonMode.java index cbe48b32fde..7b5a99d6551 100644 --- a/bson/src/main/org/bson/json/JsonMode.java +++ b/bson/src/main/org/bson/json/JsonMode.java @@ -43,7 +43,7 @@ public enum JsonMode { * Standard extended JSON representation. * * @since 3.5 - * @see Extended JSON Specification + * @see Extended JSON Specification */ EXTENDED, @@ -51,7 +51,7 @@ public enum JsonMode { * Standard relaxed extended JSON representation. * * @since 3.5 - * @see Extended JSON Specification + * @see Extended JSON Specification */ RELAXED } diff --git a/bson/src/main/org/bson/types/Decimal128.java b/bson/src/main/org/bson/types/Decimal128.java index 85e16b32529..1cd3d9745fa 100644 --- a/bson/src/main/org/bson/types/Decimal128.java +++ b/bson/src/main/org/bson/types/Decimal128.java @@ -18,19 +18,18 @@ import java.math.BigDecimal; import java.math.BigInteger; -import java.util.HashSet; -import java.util.Set; - import static java.math.MathContext.DECIMAL128; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; +import java.util.HashSet; +import java.util.Set; /** * A binary integer decimal representation of a 128-bit decimal value, supporting 34 decimal digits of significand and an exponent range * of -6143 to +6144. * * @since 3.4 - * @see BSON Decimal128 + * @see BSON Decimal128 * specification * @see binary integer decimal * @see decimal128 floating-point format @@ -110,7 +109,7 @@ public final class Decimal128 extends Number implements Comparable { * @return the Decimal128 value representing the given String * @throws NumberFormatException if the value is out of the Decimal128 range * @see - * + * * From-String Specification */ public static Decimal128 parse(final String value) { @@ -565,7 +564,7 @@ public int hashCode() { * Returns the String representation of the Decimal128 value. * * @return the String representation - * @see + * @see * To-String Sprecification */ @Override diff --git a/bson/src/test/unit/org/bson/BsonBinaryWriterTest.java b/bson/src/test/unit/org/bson/BsonBinaryWriterTest.java index 8e0f7c23c28..0b067fc816f 100644 --- a/bson/src/test/unit/org/bson/BsonBinaryWriterTest.java +++ b/bson/src/test/unit/org/bson/BsonBinaryWriterTest.java @@ -26,6 +26,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; import java.util.List; import static java.util.Arrays.asList; @@ -49,7 +50,7 @@ public class BsonBinaryWriterTest { @BeforeEach public void setup() { buffer = new BasicOutputBuffer(); - writer = new BsonBinaryWriter(new BsonWriterSettings(100), new BsonBinaryWriterSettings(1024), buffer); + writer = new BsonBinaryWriter(new BsonWriterSettings(100), new BsonBinaryWriterSettings(12904), buffer); } @AfterEach @@ -61,11 +62,11 @@ public void tearDown() { public void shouldThrowWhenMaxDocumentSizeIsExceeded() { try { writer.writeStartDocument(); - writer.writeBinaryData("b", new BsonBinary(new byte[1024])); + writer.writeBinaryData("b", new BsonBinary(new byte[12904])); writer.writeEndDocument(); fail(); } catch (BsonMaximumSizeExceededException e) { - assertEquals("Document size of 1037 is larger than maximum of 1024.", e.getMessage()); + assertEquals("Document size of 12917 is larger than maximum of 12904.", e.getMessage()); } } @@ -197,16 +198,39 @@ public void testWriteArray() { } @Test - public void testWriteArrayElements() { + public void testWriteArrayElements() throws IOException { + ByteArrayOutputStream expectedOutput = new ByteArrayOutputStream(); + expectedOutput.write(new byte[]{ + -52, 25, 0, 0, //document length + 4, // array type + 97, 49, 0, // "a1" name + null terminator + -61, 25, 0, 0}); // array length + writer.writeStartDocument(); writer.writeStartArray("a1"); - writer.writeBoolean(true); - writer.writeBoolean(false); + int arrayIndex = 0; + while (arrayIndex < 1100) { + writer.writeBoolean(true); + + expectedOutput.write(BsonType.BOOLEAN.getValue()); + expectedOutput.write(Integer.toString(arrayIndex++).getBytes(StandardCharsets.UTF_8)); + expectedOutput.write(0); // null terminator + expectedOutput.write(1); // boolean value + + writer.writeBoolean(false); + + expectedOutput.write(BsonType.BOOLEAN.getValue()); + expectedOutput.write(Integer.toString(arrayIndex++).getBytes(StandardCharsets.UTF_8)); + expectedOutput.write(0); // null terminator + expectedOutput.write(0); // boolean value + } writer.writeEndArray(); + expectedOutput.write(0); // end of array writer.writeEndDocument(); - byte[] expectedValues = {22, 0, 0, 0, 4, 97, 49, 0, 13, 0, 0, 0, 8, 48, 0, 1, 8, 49, 0, 0, 0, 0}; - assertArrayEquals(expectedValues, buffer.toByteArray()); + expectedOutput.write(0); // end of a document + + assertArrayEquals(expectedOutput.toByteArray(), buffer.toByteArray()); } @Test diff --git a/bson/src/test/unit/org/bson/GenericBsonTest.java b/bson/src/test/unit/org/bson/GenericBsonTest.java index 6ba2c6ae382..582ec5d83dc 100644 --- a/bson/src/test/unit/org/bson/GenericBsonTest.java +++ b/bson/src/test/unit/org/bson/GenericBsonTest.java @@ -25,11 +25,9 @@ import org.junit.jupiter.params.provider.MethodSource; import util.JsonPoweredTestHelper; -import java.io.File; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; -import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; @@ -283,10 +281,9 @@ private void throwIfValueIsStringContainingReplacementCharacter(final BsonDocume } - private static Stream data() throws URISyntaxException, IOException { + private static Stream data() { List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/bson")) { - BsonDocument testDocument = JsonPoweredTestHelper.getTestDocument(file); + for (BsonDocument testDocument : JsonPoweredTestHelper.getTestDocuments("/bson")) { for (BsonValue curValue : testDocument.getArray("valid", new BsonArray())) { BsonDocument testCaseDocument = curValue.asDocument(); data.add(Arguments.of( diff --git a/bson/src/test/unit/org/bson/codecs/IterableCodecProviderSpecification.groovy b/bson/src/test/unit/org/bson/codecs/IterableCodecProviderSpecification.groovy index b0eae796fc4..b5217676871 100644 --- a/bson/src/test/unit/org/bson/codecs/IterableCodecProviderSpecification.groovy +++ b/bson/src/test/unit/org/bson/codecs/IterableCodecProviderSpecification.groovy @@ -16,6 +16,7 @@ package org.bson.codecs +import org.bson.BsonType import spock.lang.Specification import static org.bson.codecs.configuration.CodecRegistries.fromProviders @@ -57,7 +58,7 @@ class IterableCodecProviderSpecification extends Specification { def 'unidentical instances should not be equal'() { given: def first = new IterableCodecProvider() - def second = new IterableCodecProvider(new BsonTypeClassMap([BOOLEAN: String])) + def second = new IterableCodecProvider(new BsonTypeClassMap([(BsonType.BOOLEAN): String])) def third = new IterableCodecProvider(new BsonTypeClassMap(), { Object from -> from }) diff --git a/bson/src/test/unit/org/bson/io/BasicOutputBufferSpecification.groovy b/bson/src/test/unit/org/bson/io/BasicOutputBufferSpecification.groovy index 38de06bf8cf..758d4fc1cfd 100644 --- a/bson/src/test/unit/org/bson/io/BasicOutputBufferSpecification.groovy +++ b/bson/src/test/unit/org/bson/io/BasicOutputBufferSpecification.groovy @@ -44,9 +44,22 @@ class BasicOutputBufferSpecification extends Specification { bsonOutput.size == 1 } + def 'writeBytes shorthand should extend buffer'() { + given: + def bsonOutput = new BasicOutputBuffer(3) + + when: + bsonOutput.write([1, 2, 3, 4] as byte[]) + + then: + getBytes(bsonOutput) == [1, 2, 3, 4] as byte[] + bsonOutput.position == 4 + bsonOutput.size == 4 + } + def 'should write bytes'() { given: - def bsonOutput = new BasicOutputBuffer() + def bsonOutput = new BasicOutputBuffer(3) when: bsonOutput.writeBytes([1, 2, 3, 4] as byte[]) @@ -59,7 +72,7 @@ class BasicOutputBufferSpecification extends Specification { def 'should write bytes from offset until length'() { given: - def bsonOutput = new BasicOutputBuffer() + def bsonOutput = new BasicOutputBuffer(5) when: bsonOutput.writeBytes([0, 1, 2, 3, 4, 5] as byte[], 1, 4) @@ -70,9 +83,40 @@ class BasicOutputBufferSpecification extends Specification { bsonOutput.size == 4 } + def 'toByteArray should be idempotent'() { + given: + def bsonOutput = new BasicOutputBuffer(10) + bsonOutput.writeBytes([1, 2, 3, 4] as byte[]) + + when: + def first = bsonOutput.toByteArray() + def second = bsonOutput.toByteArray() + + then: + getBytes(bsonOutput) == [1, 2, 3, 4] as byte[] + first == [1, 2, 3, 4] as byte[] + second == [1, 2, 3, 4] as byte[] + bsonOutput.position == 4 + bsonOutput.size == 4 + } + + def 'toByteArray creates a copy'() { + given: + def bsonOutput = new BasicOutputBuffer(10) + bsonOutput.writeBytes([1, 2, 3, 4] as byte[]) + + when: + def first = bsonOutput.toByteArray() + def second = bsonOutput.toByteArray() + + then: + first !== second + first == [1, 2, 3, 4] as byte[] + second == [1, 2, 3, 4] as byte[] + } def 'should write a little endian Int32'() { given: - def bsonOutput = new BasicOutputBuffer() + def bsonOutput = new BasicOutputBuffer(3) when: bsonOutput.writeInt32(0x1020304) @@ -85,7 +129,7 @@ class BasicOutputBufferSpecification extends Specification { def 'should write a little endian Int64'() { given: - def bsonOutput = new BasicOutputBuffer() + def bsonOutput = new BasicOutputBuffer(7) when: bsonOutput.writeInt64(0x102030405060708L) @@ -98,7 +142,7 @@ class BasicOutputBufferSpecification extends Specification { def 'should write a double'() { given: - def bsonOutput = new BasicOutputBuffer() + def bsonOutput = new BasicOutputBuffer(7) when: bsonOutput.writeDouble(Double.longBitsToDouble(0x102030405060708L)) @@ -112,7 +156,7 @@ class BasicOutputBufferSpecification extends Specification { def 'should write an ObjectId'() { given: def objectIdAsByteArray = [12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1] as byte[] - def bsonOutput = new BasicOutputBuffer() + def bsonOutput = new BasicOutputBuffer(11) when: bsonOutput.writeObjectId(new ObjectId(objectIdAsByteArray)) @@ -123,6 +167,19 @@ class BasicOutputBufferSpecification extends Specification { bsonOutput.size == 12 } + def 'write ObjectId should throw after close'() { + given: + def objectIdAsByteArray = [12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1] as byte[] + def bsonOutput = new BasicOutputBuffer() + bsonOutput.close() + + when: + bsonOutput.writeObjectId(new ObjectId(objectIdAsByteArray)) + + then: + thrown(IllegalStateException) + } + def 'should write an empty string'() { given: def bsonOutput = new BasicOutputBuffer() @@ -151,7 +208,7 @@ class BasicOutputBufferSpecification extends Specification { def 'should write a UTF-8 string'() { given: - def bsonOutput = new BasicOutputBuffer() + def bsonOutput = new BasicOutputBuffer(7) when: bsonOutput.writeString('\u0900') @@ -263,6 +320,46 @@ class BasicOutputBufferSpecification extends Specification { bsonOutput.size == 8 } + def 'absolute write should throw with invalid position'() { + given: + def bsonOutput = new BasicOutputBuffer() + bsonOutput.writeBytes([1, 2, 3, 4] as byte[]) + + when: + bsonOutput.write(-1, 0x1020304) + + then: + thrown(IllegalArgumentException) + + when: + bsonOutput.write(4, 0x1020304) + + then: + thrown(IllegalArgumentException) + } + + def 'absolute write should write lower byte at position'() { + given: + def bsonOutput = new BasicOutputBuffer() + bsonOutput.writeBytes([0, 0, 0, 0, 1, 2, 3, 4] as byte[]) + + when: + bsonOutput.write(0, 0x1020304) + + then: + getBytes(bsonOutput) == [4, 0, 0, 0, 1, 2, 3, 4] as byte[] + bsonOutput.position == 8 + bsonOutput.size == 8 + + when: + bsonOutput.write(7, 0x1020304) + + then: + getBytes(bsonOutput) == [4, 0, 0, 0, 1, 2, 3, 4] as byte[] + bsonOutput.position == 8 + bsonOutput.size == 8 + } + def 'truncate should throw with invalid position'() { given: def bsonOutput = new BasicOutputBuffer() @@ -320,6 +417,20 @@ class BasicOutputBufferSpecification extends Specification { bsonOutput.getByteBuffers()[0].getInt() == 1 } + def 'should get byte buffer with limit'() { + given: + def bsonOutput = new BasicOutputBuffer(8) + bsonOutput.writeBytes([1, 0, 0, 0] as byte[]) + + when: + def buffers = bsonOutput.getByteBuffers() + + then: + buffers.size() == 1 + buffers[0].position() == 0 + buffers[0].limit() == 4 + } + def 'should get internal buffer'() { given: def bsonOutput = new BasicOutputBuffer(4) diff --git a/bson/src/test/unit/org/bson/vector/BinaryVectorGenericBsonTest.java b/bson/src/test/unit/org/bson/vector/BinaryVectorGenericBsonTest.java index 858174d7cd9..35326281c66 100644 --- a/bson/src/test/unit/org/bson/vector/BinaryVectorGenericBsonTest.java +++ b/bson/src/test/unit/org/bson/vector/BinaryVectorGenericBsonTest.java @@ -16,6 +16,7 @@ package org.bson.vector; +import org.bson.BinaryVector; import org.bson.BsonArray; import org.bson.BsonBinary; import org.bson.BsonDocument; @@ -23,16 +24,12 @@ import org.bson.BsonValue; import org.bson.Float32BinaryVector; import org.bson.PackedBitBinaryVector; -import org.bson.BinaryVector; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -73,7 +70,7 @@ class BinaryVectorGenericBsonTest { @ParameterizedTest(name = "{0}") - @MethodSource("provideTestCases") + @MethodSource("data") void shouldPassAllOutcomes(@SuppressWarnings("unused") final String description, final BsonDocument testDefinition, final BsonDocument testCase) { assumeFalse(TEST_NAMES_TO_IGNORE.contains(testCase.get("description").asString().getValue())); @@ -254,10 +251,9 @@ private static float parseFloat(final BsonString bsonValue) { } } - private static Stream provideTestCases() throws URISyntaxException, IOException { + private static Stream data() { List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/bson-binary-vector")) { - BsonDocument testDocument = JsonPoweredTestHelper.getTestDocument(file); + for (BsonDocument testDocument : JsonPoweredTestHelper.getTestDocuments("/bson-binary-vector")) { for (BsonValue curValue : testDocument.getArray("tests", new BsonArray())) { BsonDocument testCaseDocument = curValue.asDocument(); data.add(Arguments.of(createTestCaseDescription(testDocument, testCaseDocument), testDocument, testCaseDocument)); diff --git a/bson/src/test/unit/util/JsonPoweredTestHelper.java b/bson/src/test/unit/util/JsonPoweredTestHelper.java index 4507e64301b..e261e132ab4 100644 --- a/bson/src/test/unit/util/JsonPoweredTestHelper.java +++ b/bson/src/test/unit/util/JsonPoweredTestHelper.java @@ -17,105 +17,119 @@ package util; import org.bson.BsonDocument; -import org.bson.codecs.BsonDocumentCodec; -import org.bson.codecs.DecoderContext; -import org.bson.json.JsonReader; +import org.bson.BsonString; +import org.bson.BsonValue; +import org.bson.assertions.Assertions; import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStream; import java.io.InputStreamReader; -import java.net.URISyntaxException; +import java.net.URI; import java.net.URL; import java.nio.charset.StandardCharsets; +import java.nio.file.FileSystem; import java.nio.file.FileSystems; +import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.PathMatcher; import java.nio.file.Paths; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; import java.util.List; -import java.util.Map; -import java.util.function.Function; - -import static java.nio.file.Files.isDirectory; -import static java.util.stream.Collectors.toMap; public final class JsonPoweredTestHelper { - public static BsonDocument getTestDocument(final File file) throws IOException { - return new BsonDocumentCodec().decode(new JsonReader(getFileAsString(file)), DecoderContext.builder().build()); - } + private static final String SPECIFICATIONS_PREFIX = "/specifications/source/"; - public static BsonDocument getTestDocument(final String resourcePath) throws IOException, URISyntaxException { - return getTestDocument(new File(JsonPoweredTestHelper.class.getResource(resourcePath).toURI())); + public static BsonDocument getTestDocument(final String resourcePath) { + BsonDocument testDocument = getTestDocumentWithMetaData(SPECIFICATIONS_PREFIX + resourcePath); + testDocument.remove("resourcePath"); + testDocument.remove("fileName"); + return testDocument; } - public static Path testDir(final String resourceName) { - URL res = JsonPoweredTestHelper.class.getResource(resourceName); - if (res == null) { - throw new AssertionError("Did not find " + resourceName); - } - try { - Path dir = Paths.get(res.toURI()); - if (!isDirectory(dir)) { - throw new AssertionError(dir + " is not a directory"); + public static Collection getTestData(final String resourcePath) { + List data = new ArrayList<>(); + for (BsonDocument document : getSpecTestDocuments(resourcePath)) { + for (BsonValue test : document.getArray("tests")) { + BsonDocument testDocument = test.asDocument(); + data.add(new Object[]{document.getString("fileName").getValue(), + testDocument.getString("description").getValue(), + testDocument.getString("uri", new BsonString("")).getValue(), + testDocument}); } - return dir; - } catch (URISyntaxException e) { - throw new RuntimeException(e); } + return data; } - public static Map testDocs(final Path dir) { - PathMatcher jsonMatcher = FileSystems.getDefault().getPathMatcher("glob:**.json"); + public static List getSpecTestDocuments(final String resourcePath) { + return getTestDocuments(SPECIFICATIONS_PREFIX + resourcePath); + } + + public static List getTestDocuments(final String resourcePath) { + List files = new ArrayList<>(); try { - return Files.list(dir) - .filter(jsonMatcher::matches) - .collect(toMap(Function.identity(), path -> { - try { - return getTestDocument(path.toFile()); - } catch (IOException e) { - throw new RuntimeException(e); + URL urlResource = JsonPoweredTestHelper.class.getResource(resourcePath); + if (urlResource == null) { + Assertions.fail("No such resource: " + resourcePath); + } + + URI resource = urlResource.toURI(); + try (FileSystem fileSystem = (resource.getScheme().equals("jar") ? FileSystems.newFileSystem(resource, Collections.emptyMap()) : null)) { + Path myPath = Paths.get(resource); + Files.walkFileTree(myPath, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(final Path filePath, final BasicFileAttributes attrs) throws IOException { + if (filePath.toString().endsWith(".json")) { + if (fileSystem == null) { + files.add(getTestDocumentWithMetaData(filePath.toString().substring(filePath.toString().lastIndexOf(resourcePath)))); + } else { + files.add(getTestDocumentWithMetaData(filePath.toString())); + } } - })); - } catch (IOException e) { - throw new RuntimeException(e); + return super.visitFile(filePath, attrs); + } + }); + } + } catch (Exception e) { + Assertions.fail("Unable to load resource: " + resourcePath, e); } - } - public static List getTestFiles(final String resourcePath) throws URISyntaxException { - List files = new ArrayList<>(); - addFilesFromDirectory(new File(JsonPoweredTestHelper.class.getResource(resourcePath).toURI()), files); + if (files.isEmpty()) { + Assertions.fail("No test documents found in: " + resourcePath); + } return files; } - private static String getFileAsString(final File file) throws IOException { + private static BsonDocument getTestDocumentWithMetaData(final String resourcePath) { + BsonDocument testDocument = BsonDocument.parse(resourcePathToString(resourcePath)); + testDocument.append("resourcePath", new BsonString(resourcePath)) + .append("fileName", new BsonString(resourcePath.substring(resourcePath.lastIndexOf('/') + 1))); + return testDocument; + } + + private static String resourcePathToString(final String resourcePath) { StringBuilder stringBuilder = new StringBuilder(); String line; - String ls = System.getProperty("line.separator"); - try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8))) { - while ((line = reader.readLine()) != null) { - stringBuilder.append(line); - stringBuilder.append(ls); + String ls = System.lineSeparator(); + try (InputStream inputStream = JsonPoweredTestHelper.class.getResourceAsStream(resourcePath)) { + if (inputStream == null) { + Assertions.fail("Unable to load resource: " + resourcePath); } - } - return stringBuilder.toString(); - } - - private static void addFilesFromDirectory(final File directory, final List files) { - String[] fileNames = directory.list(); - if (fileNames != null) { - for (String fileName : fileNames) { - File file = new File(directory, fileName); - if (file.isDirectory()) { - addFilesFromDirectory(file, files); - } else if (file.getName().endsWith(".json")) { - files.add(file); + try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) { + while ((line = reader.readLine()) != null) { + stringBuilder.append(line); + stringBuilder.append(ls); } } + } catch (Exception e) { + Assertions.fail("Unable to load resource", e); } + return stringBuilder.toString(); } private JsonPoweredTestHelper() { diff --git a/build.gradle b/build.gradle deleted file mode 100644 index a516020089e..00000000000 --- a/build.gradle +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -apply plugin: 'eclipse' -apply plugin: 'idea' - -buildscript { - repositories { - mavenLocal() - mavenCentral() - maven { url "https://plugins.gradle.org/m2/" } - } - dependencies { - classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:7.0.0' - classpath "com.github.spotbugs.snom:spotbugs-gradle-plugin:6.0.15" - classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:5.1.2' - - // Scala plugins - classpath "com.adtran:scala-multiversion-plugin:2.0.4" - classpath "com.diffplug.spotless:spotless-plugin-gradle:6.14.0" - - // kotlin plugins - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10" - classpath "org.jetbrains.kotlin:kotlin-serialization:1.8.10" - classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.8.10" - classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.21.0" - - // Test logging plugin - classpath 'com.adarshr:gradle-test-logger-plugin:2.1.0' - } -} - -////////////////////////////////////////// -// Common behavior // -////////////////////////////////////////// - -ext { - configDir = new File(rootDir, 'config') - jnrUnixsocketVersion = '0.38.17' - nettyVersion = '4.1.87.Final' - snappyVersion = '1.1.10.3' - zstdVersion = '1.5.5-3' - awsSdkV2Version = '2.18.9' - awsSdkV1Version = '1.12.337' - projectReactorVersion = '2022.0.0' - junitBomVersion = '5.10.2' - logbackVersion = '1.3.14' - graalSdkVersion = '24.0.0' - reflectionsVersion = '0.9.10' - gitVersion = getGitVersion() -} - -def configDir = ext.configDir -def utilProjects = project(":util").allprojects -def bomProjects = project(":bom") -def coreProjects = subprojects - utilProjects -def scalaProjects = subprojects.findAll { it.name.contains('scala') } - bomProjects -def javaProjects = subprojects - scalaProjects - bomProjects -def javaMainProjects = javaProjects - utilProjects -def javaCodeCheckedProjects = javaMainProjects.findAll { !['driver-benchmarks', 'driver-workload-executor', 'driver-lambda'].contains(it.name) } -def javaAndScalaTestedProjects = javaCodeCheckedProjects + scalaProjects - -configure(coreProjects) { - apply plugin: 'idea' - - group = 'org.mongodb' - version = '5.4.0-alpha0' - - repositories { - mavenLocal() - google() - mavenCentral() - - // Uncomment this to test with a snapshot build of mongodb-crypt - maven { - url 'https://oss.sonatype.org/content/repositories/snapshots' - content { - includeGroup "org.mongodb" - } - } - } -} - -configure(javaProjects) { - apply plugin: 'java-library' - - sourceSets { - main { - java.srcDirs = ['src/main'] - } - } - - tasks.withType(GenerateModuleMetadata) { - enabled = false - } - -} - -configure(scalaProjects) { - apply plugin: 'scala' - apply plugin: 'java-library' - apply plugin: 'idea' - apply plugin: "com.adtran.scala-multiversion-plugin" - apply plugin: "com.diffplug.spotless" - - group = 'org.mongodb.scala' - - dependencies { - api ('org.scala-lang:scala-library:%scala-version%') - api ('org.scala-lang:scala-reflect:%scala-version%') - - testImplementation(platform("org.junit:junit-bom:$junitBomVersion")) - testImplementation("org.junit.vintage:junit-vintage-engine") - - testImplementation('org.scalatest:scalatest-flatspec_%%:3.2.9') - testImplementation('org.scalatest:scalatest-shouldmatchers_%%:3.2.9') - testImplementation('org.scalatestplus:junit-4-13_%%:3.2.9.0') - testImplementation('org.scalatestplus:mockito-3-12_%%:3.2.10.0') - testImplementation("ch.qos.logback:logback-classic:$logbackVersion") - testImplementation("org.reflections:reflections:$reflectionsVersion") - } - - test{ - useJUnitPlatform { - includeEngines('junit-jupiter', 'junit-vintage') - } - } - - spotless { - scala { - scalafmt().configFile("$configDir/scala/scalafmt.conf") - } - } - compileScala.dependsOn('spotlessApply') - compileTestScala.dependsOn('spotlessApply') - - tasks.withType(ScalaCompile) { - scalaCompileOptions.deprecation = false - if(scalaVersion.startsWith("2.11")) { - scalaCompileOptions.additionalParameters = [ - // support static methods in interfaces - "-target:jvm-1.8" - ] - } - if(scalaVersion.startsWith("2.13")) { - scalaCompileOptions.additionalParameters = [ - "-feature", - "-unchecked", - "-language:reflectiveCalls", - "-Wconf:cat=deprecation:ws", - "-Wconf:msg=While parsing annotations in:silent", - "-Xlint:strict-unsealed-patmat" - ] - } - - } - - tasks.withType(GenerateModuleMetadata) { - enabled = false - } -} - -configure(javaMainProjects) { - apply plugin: 'nebula.optional-base' - apply plugin: 'java-library' - - dependencies { - compileOnly 'com.google.code.findbugs:jsr305:1.3.9' - api 'org.slf4j:slf4j-api:1.7.6', optional - testImplementation 'com.google.code.findbugs:jsr305:1.3.9' - - // https://issues.apache.org/jira/browse/GROOVY-10194 - testImplementation 'org.codehaus.groovy:groovy-all:3.0.9' - } - - /* Compiling */ - tasks.withType(AbstractCompile) { - options.encoding = 'ISO-8859-1' - options.fork = true - options.debug = true - options.compilerArgs = ['-Xlint:all'] - } -} - -configure(javaAndScalaTestedProjects) { - /* Testing */ - tasks.withType(Test) { - systemProperties(System.getProperties().findAll { it.key.toString().startsWith("org.mongodb.") }) - systemProperty('jna.library.path', System.getProperty('jna.library.path')) - - project.ext.buildingWith = { propertyName -> - project.hasProperty(propertyName) && project.property(propertyName).toBoolean() - } - - if (project.buildingWith('ssl.enabled')) { - if (project.hasProperty('ssl.keyStoreType')) { - systemProperties( - 'javax.net.ssl.keyStoreType': project.property('ssl.keyStoreType'), - 'javax.net.ssl.keyStore': project.property('ssl.keyStore'), - 'javax.net.ssl.keyStorePassword': project.property('ssl.keyStorePassword') - ) - } - if (project.hasProperty('ssl.trustStoreType')) { - systemProperties( - 'javax.net.ssl.trustStoreType': project.property('ssl.trustStoreType'), - 'javax.net.ssl.trustStore': project.property('ssl.trustStore'), - 'javax.net.ssl.trustStorePassword': project.property('ssl.trustStorePassword') - ) - } - if (project.hasProperty('ocsp.property')) { - systemProperties( - 'org.mongodb.test.ocsp.tls.should.succeed': project.property('ocsp.tls.should.succeed'), - 'java.security.properties': file(project.property('ocsp.property')), - 'com.sun.net.ssl.checkRevocation': project.property('ssl.checkRevocation'), - 'jdk.tls.client.enableStatusRequestExtension': project.property('client.enableStatusRequestExtension'), - 'jdk.tls.client.protocols': project.property('client.protocols') - ) - } - } - - if (project.buildingWith('gssapi.enabled')) { - systemProperties( - 'sun.security.krb5.debug': project.getProperty('sun.security.krb5.debug'), - 'javax.security.auth.useSubjectCredsOnly': "false", - 'java.security.krb5.kdc': project.getProperty('krb5.kdc'), - 'java.security.krb5.realm': project.getProperty('krb5.realm'), - 'java.security.auth.login.config': project.getProperty('auth.login.config'), - ) - } - } -} - -configure(javaCodeCheckedProjects) { - apply plugin: 'checkstyle' - apply plugin: "com.github.spotbugs" - apply plugin: 'jacoco' - apply plugin: 'groovy' - apply plugin: 'codenarc' - apply plugin: 'com.adarshr.test-logger' - - dependencies { - testImplementation(platform("org.junit:junit-bom:$junitBomVersion")) - testImplementation('org.junit.jupiter:junit-jupiter') - testImplementation('org.junit.jupiter:junit-jupiter-params') - testImplementation('org.junit.jupiter:junit-jupiter-engine') - testImplementation('org.junit.vintage:junit-vintage-engine') - - testImplementation platform('org.spockframework:spock-bom:2.1-groovy-3.0') - testImplementation 'org.spockframework:spock-core' - testImplementation 'org.spockframework:spock-junit4' - if ('8'.equals(findProperty("javaVersion"))) { - testImplementation("org.mockito:mockito-core:4.6.1") - testImplementation("org.mockito:mockito-inline:4.6.1") - } else { - testImplementation("org.mockito:mockito-core:5.11.0") - } - testImplementation 'cglib:cglib-nodep:2.2.2' - testImplementation 'org.objenesis:objenesis:1.3' - testImplementation 'org.hamcrest:hamcrest-all:1.3' - testImplementation "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation project(':util:spock') //Adding categories to classpath - } - - sourceSets { - test { - groovy.srcDirs = ['src/test/functional', 'src/test/unit'] - } - } - - /* Testing */ - tasks.withType(Test) { - maxHeapSize = "4g" - maxParallelForks = 1 - - useJUnitPlatform { - includeEngines('junit-jupiter', 'junit-vintage', 'spock') - excludeTags('Slow') - } - systemProperty('spock.configuration', "${configDir}/spock/ExcludeSlow.groovy") - - jacoco { enabled = false } - - testLogging { - exceptionFormat = 'full' - events("passed", "skipped", "failed") - } - - testlogger { - theme 'standard' - showExceptions false - showStackTraces false - showFullStackTraces false - } - } - - task testSlowOnly(type: Test) { - dependsOn('testSlowGroovy') - useJUnitPlatform { - includeEngines('junit-jupiter', 'junit-vintage') - includeTags('Slow') - } - } - - task testSlowGroovy(type: Test) { - useJUnitPlatform { - includeEngines( 'spock') - } - systemProperty('spock.configuration', "${configDir}/spock/OnlySlow.groovy") - } - - gradle.taskGraph.whenReady { taskGraph -> - if (taskGraph.hasTask(testCoverage)) { - tasks.withType(Test) { jacoco { enabled = true } } - } - } - - task testCoverage(dependsOn: test) - - /* Code quality */ - tasks.withType(Checkstyle) { - reports { - xml.required = true - html.required = true - } - } - - checkstyle { - toolVersion = "9.1" - } - - spotbugs { - if (!project.buildingWith('ssdlcReport.enabled')) { - excludeFilter = new File(configDir, 'spotbugs/exclude.xml') - } - } - - codenarc { - toolVersion = '1.6.1' - reportFormat = project.buildingWith('xmlReports.enabled') ? 'xml' : 'html' - } - - spotbugsMain { - reports { - xml.enabled = project.buildingWith('xmlReports.enabled') - html.enabled = !project.buildingWith('xmlReports.enabled') - sarif.enabled = project.buildingWith('ssdlcReport.enabled') - } - } - - spotbugsTest { - enabled = false - } -} - -def getGitVersion() { - def describeStdOut = new ByteArrayOutputStream() - exec { - commandLine 'git', 'describe', '--tags', '--always', '--dirty' - standardOutput = describeStdOut - } - describeStdOut.toString().substring(1).trim() -} - -apply from: 'gradle/javaToolchain.gradle' -apply from: 'gradle/publish.gradle' -apply from: 'gradle/deploy.gradle' -apply from: 'gradle/javadoc.gradle' diff --git a/util/spock/build.gradle b/build.gradle.kts similarity index 93% rename from util/spock/build.gradle rename to build.gradle.kts index 4498034e07a..287017f0ed4 100644 --- a/util/spock/build.gradle +++ b/build.gradle.kts @@ -14,3 +14,7 @@ * limitations under the License. */ +plugins { + id("eclipse") + id("idea") +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 00000000000..23095a6700b --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,83 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import dev.panuszewski.gradle.pluginMarker + +plugins { + id("java-library") + `kotlin-dsl` + alias(libs.plugins.spotless) + alias(libs.plugins.detekt) apply false +} + +repositories { + gradlePluginPortal() + mavenCentral() + google() +} + +// Dependencies needed for the configuration of the plugins +// Uses `pluginMarker` from the `typesafe-conventions` plugin, see `settings.gradle.kts` +dependencies { + implementation(pluginMarker(libs.plugins.bnd)) + implementation(pluginMarker(libs.plugins.detekt)) + implementation(pluginMarker(libs.plugins.dokka)) + implementation(pluginMarker(libs.plugins.kotlin.gradle)) + implementation(pluginMarker(libs.plugins.spotbugs)) + implementation(pluginMarker(libs.plugins.spotless)) + implementation(pluginMarker(libs.plugins.test.logger)) +} + +// Spotless configuration for `buildSrc` code. +spotless { + kotlinGradle { + target("**/*.gradle.kts") + ktfmt("0.39").dropboxStyle().configure { + it.setMaxWidth(120) + it.setRemoveUnusedImport(true) + } + trimTrailingWhitespace() + indentWithSpaces() + endWithNewline() + licenseHeaderFile( + "../config/mongodb.license", "(package|group|plugins|import|buildscript|rootProject|@Suppress)") + } + + kotlin { + target("**/*.kt") + ktfmt().dropboxStyle().configure { + it.setMaxWidth(120) + it.setRemoveUnusedImport(true) + } + trimTrailingWhitespace() + indentWithSpaces() + endWithNewline() + licenseHeaderFile(rootProject.file("../config/mongodb.license")) + } + + java { + palantirJavaFormat() + target("src/*/java/**/*.java") + removeUnusedImports() + trimTrailingWhitespace() + indentWithSpaces() + endWithNewline() + licenseHeaderFile(rootProject.file("../config/mongodb.license")) + } +} + +java { toolchain { languageVersion.set(JavaLanguageVersion.of("17")) } } + +tasks.findByName("check")?.dependsOn("spotlessCheck") diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts new file mode 100644 index 00000000000..ae51c27d8ae --- /dev/null +++ b/buildSrc/settings.gradle.kts @@ -0,0 +1,21 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + // Add support for `libs.versions.toml` within `buildSrc` + // https://github.com/radoslaw-panuszewski/typesafe-conventions-gradle-plugin + // https://github.com/gradle/gradle/issues/15383 + id("dev.panuszewski.typesafe-conventions") version "0.4.1" +} diff --git a/util/taglets/src/main/AtlasManualTaglet.java b/buildSrc/src/main/java/com/mongodb/doclet/AtlasManualTaglet.java similarity index 97% rename from util/taglets/src/main/AtlasManualTaglet.java rename to buildSrc/src/main/java/com/mongodb/doclet/AtlasManualTaglet.java index 004ce1b64c1..673b55a6bf6 100644 --- a/util/taglets/src/main/AtlasManualTaglet.java +++ b/buildSrc/src/main/java/com/mongodb/doclet/AtlasManualTaglet.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package com.mongodb.doclet; public final class AtlasManualTaglet extends DocTaglet { @Override diff --git a/util/taglets/src/main/DocTaglet.java b/buildSrc/src/main/java/com/mongodb/doclet/DocTaglet.java similarity index 93% rename from util/taglets/src/main/DocTaglet.java rename to buildSrc/src/main/java/com/mongodb/doclet/DocTaglet.java index c63265e40a4..0f51f45f197 100644 --- a/util/taglets/src/main/DocTaglet.java +++ b/buildSrc/src/main/java/com/mongodb/doclet/DocTaglet.java @@ -13,15 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -import com.sun.source.doctree.DocTree; -import com.sun.source.doctree.UnknownBlockTagTree; -import jdk.javadoc.doclet.Taglet; - -import javax.lang.model.element.Element; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +package com.mongodb.doclet; import static java.util.Arrays.asList; import static jdk.javadoc.doclet.Taglet.Location.CONSTRUCTOR; @@ -31,6 +23,14 @@ import static jdk.javadoc.doclet.Taglet.Location.PACKAGE; import static jdk.javadoc.doclet.Taglet.Location.TYPE; +import com.sun.source.doctree.DocTree; +import com.sun.source.doctree.UnknownBlockTagTree; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import javax.lang.model.element.Element; +import jdk.javadoc.doclet.Taglet; + public abstract class DocTaglet implements Taglet { @Override @@ -49,7 +49,8 @@ public String toString(List tags, Element element) { return null; } - StringBuilder buf = new StringBuilder(String.format("

%s
", getHeader())); + StringBuilder buf = + new StringBuilder(String.format("
%s
", getHeader())); for (DocTree tag : tags) { String text = ((UnknownBlockTagTree) tag).getContent().get(0).toString(); buf.append("
").append(genLink(text)).append("
"); diff --git a/util/taglets/src/main/DochubTaglet.java b/buildSrc/src/main/java/com/mongodb/doclet/DochubTaglet.java similarity index 97% rename from util/taglets/src/main/DochubTaglet.java rename to buildSrc/src/main/java/com/mongodb/doclet/DochubTaglet.java index 2092e8ffa5c..a6b960eaa27 100644 --- a/util/taglets/src/main/DochubTaglet.java +++ b/buildSrc/src/main/java/com/mongodb/doclet/DochubTaglet.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package com.mongodb.doclet; public class DochubTaglet extends DocTaglet { @@ -30,5 +31,4 @@ protected String getHeader() { protected String getBaseDocURI() { return "https://dochub.mongodb.org/"; } - } diff --git a/util/taglets/src/main/ManualTaglet.java b/buildSrc/src/main/java/com/mongodb/doclet/ManualTaglet.java similarity index 97% rename from util/taglets/src/main/ManualTaglet.java rename to buildSrc/src/main/java/com/mongodb/doclet/ManualTaglet.java index 8ccbc2b9f62..ff49c9ab37c 100644 --- a/util/taglets/src/main/ManualTaglet.java +++ b/buildSrc/src/main/java/com/mongodb/doclet/ManualTaglet.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package com.mongodb.doclet; public class ManualTaglet extends DocTaglet { @@ -30,5 +31,4 @@ protected String getHeader() { protected String getBaseDocURI() { return "https://www.mongodb.com/docs/manual/"; } - } diff --git a/util/taglets/src/main/ServerReleaseTaglet.java b/buildSrc/src/main/java/com/mongodb/doclet/ServerReleaseTaglet.java similarity index 97% rename from util/taglets/src/main/ServerReleaseTaglet.java rename to buildSrc/src/main/java/com/mongodb/doclet/ServerReleaseTaglet.java index 6508ceab712..9b4f88fbf92 100644 --- a/util/taglets/src/main/ServerReleaseTaglet.java +++ b/buildSrc/src/main/java/com/mongodb/doclet/ServerReleaseTaglet.java @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package com.mongodb.doclet; public class ServerReleaseTaglet extends DocTaglet { @@ -30,5 +31,4 @@ protected String getHeader() { protected String getBaseDocURI() { return "https://www.mongodb.com/docs/manual/release-notes/"; } - } diff --git a/buildSrc/src/main/kotlin/ProjectExtensions.kt b/buildSrc/src/main/kotlin/ProjectExtensions.kt new file mode 100644 index 00000000000..a369aefc9d2 --- /dev/null +++ b/buildSrc/src/main/kotlin/ProjectExtensions.kt @@ -0,0 +1,56 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import org.gradle.api.Project +import org.gradle.api.java.archives.Manifest +import org.gradle.api.publish.maven.MavenPublication +import org.gradle.api.tasks.bundling.Jar +import org.gradle.kotlin.dsl.named +import org.gradle.kotlin.dsl.withType + +object ProjectExtensions { + + /** + * Extension function to get and validate the current scala version + * + * See: gradle.properties for `supportedScalaVersions` and `defaultScalaVersion` + */ + fun Project.scalaVersion(): String { + val supportedScalaVersions = (project.property("supportedScalaVersions") as String).split(",") + val scalaVersion: String = + (project.findProperty("scalaVersion") ?: project.property("defaultScalaVersion")) as String + + if (!supportedScalaVersions.contains(scalaVersion)) { + throw UnsupportedOperationException( + """Scala version: $scalaVersion is not a supported scala version. + |Supported versions: $supportedScalaVersions + """ + .trimMargin()) + } + + return scalaVersion + } + + /** Extension function to configure the maven publication */ + fun Project.configureMavenPublication(configure: MavenPublication.() -> Unit = {}) { + val publishing = extensions.getByName("publishing") as org.gradle.api.publish.PublishingExtension + publishing.publications.named("maven") { configure() } + } + + /** Extension function to configure the jars manifest */ + fun Project.configureJarManifest(configure: Manifest.() -> Unit = {}) { + tasks.withType { manifest { afterEvaluate { configure() } } } + } +} diff --git a/buildSrc/src/main/kotlin/conventions/Companion.kt b/buildSrc/src/main/kotlin/conventions/Companion.kt new file mode 100644 index 00000000000..c28eef2a080 --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/Companion.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +import org.gradle.accessors.dm.LibrariesForLibs +import org.gradle.api.Project +import org.gradle.kotlin.dsl.getByType + +// Adds the `libs` value for use in conventions +internal val Project.libs: LibrariesForLibs + get() = extensions.getByType() + +/** Extension function to determine if a project property has been set. */ +fun Project.buildingWith(name: String): Boolean { + return this.findProperty(name)?.toString()?.toBoolean() ?: false +} diff --git a/util/build.gradle b/buildSrc/src/main/kotlin/conventions/bnd.gradle.kts similarity index 77% rename from util/build.gradle rename to buildSrc/src/main/kotlin/conventions/bnd.gradle.kts index 6a2444433a7..39a4513b41d 100644 --- a/util/build.gradle +++ b/buildSrc/src/main/kotlin/conventions/bnd.gradle.kts @@ -13,3 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package conventions + +// Gradle Plugin for developing OSGi bundles with Bnd. +// https://plugins.gradle.org/plugin/biz.aQute.bnd.builder + +plugins { id("biz.aQute.bnd.builder") } diff --git a/buildSrc/src/main/kotlin/conventions/codenarc.gradle.kts b/buildSrc/src/main/kotlin/conventions/codenarc.gradle.kts new file mode 100644 index 00000000000..25cd5c00cc8 --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/codenarc.gradle.kts @@ -0,0 +1,25 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +// The CodeNarc plugin performs quality checks on your project’s Groovy source files +// https://docs.gradle.org/current/userguide/codenarc_plugin.html +plugins { id("codenarc") } + +codenarc { + toolVersion = "1.6.1" + reportFormat = if (project.buildingWith("xmlReports.enabled")) "xml" else "html" +} diff --git a/buildSrc/src/main/kotlin/conventions/detekt.gradle.kts b/buildSrc/src/main/kotlin/conventions/detekt.gradle.kts new file mode 100644 index 00000000000..3ca88eac418 --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/detekt.gradle.kts @@ -0,0 +1,44 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +import io.gitlab.arturbosch.detekt.Detekt + +// Static code analysis for Kotlin +// https://plugins.gradle.org/plugin/io.gitlab.arturbosch.detekt +plugins { id("io.gitlab.arturbosch.detekt") } + +detekt { + allRules = true // fail build on any finding + buildUponDefaultConfig = true // preconfigure defaults + config = rootProject.files("config/detekt/detekt.yml") // point to your custom config defining rules to run, + // overwriting default behavior + baseline = rootProject.file("config/detekt/baseline.xml") // a way of suppressing issues before introducing detekt + source = + files( + file("src/main/kotlin"), + file("src/test/kotlin"), + file("src/integrationTest/kotlin"), + ) +} + +tasks.withType().configureEach { + reports { + html.required.set(true) // observe findings in your browser with structure and code snippets + xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins + txt.required.set(false) // similar to the console output, contains issue signature to manually edit + } +} diff --git a/buildSrc/src/main/kotlin/conventions/dokka.gradle.kts b/buildSrc/src/main/kotlin/conventions/dokka.gradle.kts new file mode 100644 index 00000000000..8ad68409662 --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/dokka.gradle.kts @@ -0,0 +1,47 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +// Dokka, the documentation engine for Kotlin +// https://plugins.gradle.org/plugin/org.jetbrains.dokka +plugins { + id("org.jetbrains.dokka") + id("conventions.publishing") +} + +// Create a generic `docs` task +tasks.register("docs") { + group = "documentation" + dependsOn("dokkaHtml") +} + +val dokkaOutputDir: Provider = rootProject.layout.buildDirectory.dir("docs/${base.archivesName.get()}") + +tasks.dokkaHtml.configure { + outputDirectory.set(dokkaOutputDir.get().asFile) + moduleName.set(base.archivesName.get()) +} + +val cleanDokka by tasks.register("cleanDokka") { delete(dokkaOutputDir) } + +// Ensure dokka is used for the javadoc +afterEvaluate { + tasks.named("javadocJar").configure { + dependsOn("cleanDokka", "dokkaHtml") + archiveClassifier.set("javadoc") + from(dokkaOutputDir) + } +} diff --git a/buildSrc/src/main/kotlin/conventions/git-version.gradle.kts b/buildSrc/src/main/kotlin/conventions/git-version.gradle.kts new file mode 100644 index 00000000000..5370f59cea9 --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/git-version.gradle.kts @@ -0,0 +1,31 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +// Provides the current git version for the build + +val gitVersion: Provider = + providers + .exec { commandLine("git", "describe", "--tags", "--always", "--dirty") } + .standardOutput + .asText + .map { it.trim().removePrefix("r") } + +// Allows access to gitVersion extension to other conventions +extensions.add("gitVersion", gitVersion) + +// Debug task that outputs the gitVersion. +tasks.register("gitVersion") { doLast { println("Git version: ${gitVersion.get()}") } } diff --git a/buildSrc/src/main/kotlin/conventions/javadoc.gradle.kts b/buildSrc/src/main/kotlin/conventions/javadoc.gradle.kts new file mode 100644 index 00000000000..8ab2ef5bb5b --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/javadoc.gradle.kts @@ -0,0 +1,125 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +// Provides the Javadoc configuration for the build +plugins { + id("java-library") + id("maven-publish") +} + +// Create a generic `docs` task +tasks.register("docs") { + group = "documentation" + dependsOn("javadoc") +} + +tasks.withType { + exclude("**/com/mongodb/**/assertions/**") + exclude("**/com/mongodb/**/internal/**") + exclude("**/org/bson/**/internal/**") + + setDestinationDir(rootProject.file("build/docs/${project.base.archivesName.get()}")) + + val standardDocletOptions = options as StandardJavadocDocletOptions + standardDocletOptions.apply { + author(true) + version(true) + links = + listOf( + "https://docs.oracle.com/en/java/javase/11/docs/api/", + "https://www.reactive-streams.org/reactive-streams-1.0.3-javadoc/") + tagletPath(rootProject.projectDir.resolve("buildSrc/build/classes/java/main")) + taglets("com.mongodb.doclet.AtlasManualTaglet") + taglets("com.mongodb.doclet.ManualTaglet") + taglets("com.mongodb.doclet.DochubTaglet") + taglets("com.mongodb.doclet.ServerReleaseTaglet") + encoding = "UTF-8" + charSet("UTF-8") + docEncoding("UTF-8") + addBooleanOption("html5", true) + addBooleanOption("-allow-script-in-comments", true) + header( + """ + + """.trimIndent()) + } + + // Customizations for specific projects + afterEvaluate { + val docVersion = docVersion(project.version as String) + if (project.name != "bson") linksOfflineHelper(docVersion, "bson", standardDocletOptions) + if (!project.name.contains("bson") && project.name != "mongodb-driver-core") + linksOfflineHelper(docVersion, "mongodb-driver-core", standardDocletOptions) + if (!project.name.contains("bson") && project.name != "mongodb-driver-sync") + linksOfflineHelper(docVersion, "mongodb-driver-sync", standardDocletOptions) + } +} + +// Helper functions +internal fun docVersion(version: String): String { + val (major, minor, patch) = version.split("-").first().split(".").map { it.toInt() } + var docVersion = "${major}.${minor}" + if (version.contains("-SNAPSHOT") && patch == 0 && minor > 0) { + docVersion = "${major}.${minor - 1}" + } + return docVersion +} + +internal fun linksOfflineHelper(docVersion: String, packageName: String, options: StandardJavadocDocletOptions): Unit { + val docsPath = rootProject.file("build/docs/${packageName}") + if (docsPath.exists()) { + options.apply { + linksOffline( + "http://mongodb.github.io/mongo-java-driver/$%7BdocVersion%7D/apidocs/$%7BpackageName%7D/", docsPath.path) + } + } +} diff --git a/buildSrc/src/main/kotlin/conventions/optional.gradle.kts b/buildSrc/src/main/kotlin/conventions/optional.gradle.kts new file mode 100644 index 00000000000..1bf10321971 --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/optional.gradle.kts @@ -0,0 +1,33 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +// Provides the optional dependencies support eg: optionalApi, optionalImplementation +plugins { + id("java-library") + id("maven-publish") +} + +java { registerFeature("optional") { usingSourceSet(sourceSets["main"]) } } + +// Suppress POM warnings for the optional features (eg: optionalApi, optionalImplementation) +afterEvaluate { + configurations + .filter { it.name.startsWith("optional") } + .forEach { optional -> + publishing.publications.named("maven") { suppressPomMetadataWarningsFor(optional.name) } + } +} diff --git a/buildSrc/src/main/kotlin/conventions/publishing.gradle.kts b/buildSrc/src/main/kotlin/conventions/publishing.gradle.kts new file mode 100644 index 00000000000..8347959b237 --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/publishing.gradle.kts @@ -0,0 +1,177 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +// Provides the publishing configuration for the build +// +// Note: Further configuration can be achieved using the `project.configureMavenPublication` and +// `project.configureJarManifest` helpers. +// See: `ProjectExtensions.kt` for more information +plugins { + id("conventions.git-version") + id("maven-publish") + id("signing") +} + +val signingKey: Provider = providers.gradleProperty("signingKey") +val signingPassword: Provider = providers.gradleProperty("signingPassword") +val nexusUsername: Provider = providers.gradleProperty("nexusUsername") +val nexusPassword: Provider = providers.gradleProperty("nexusPassword") +@Suppress("UNCHECKED_CAST") val gitVersion: Provider = project.findProperty("gitVersion") as Provider + +tasks.withType().configureEach { + // Gradle warns about some signing tasks using publishing task outputs without explicit + // dependencies. Here's a quick fix. + dependsOn(tasks.withType()) + mustRunAfter(tasks.withType()) + + doLast { + logger.lifecycle("[task: ${name}] ${publication.groupId}:${publication.artifactId}:${publication.version}") + } +} + +val localBuildRepo: Provider = rootProject.layout.buildDirectory.dir("repo") + +val sonatypeRepositoryReleaseUrl: Provider = provider { + if (version.toString().endsWith("SNAPSHOT")) { + "https://oss.sonatype.org/content/repositories/snapshots/" + } else { + "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + } +} + +publishing { + repositories { + maven { + url = uri(sonatypeRepositoryReleaseUrl) + if (nexusUsername.isPresent && nexusPassword.isPresent) { + credentials { + username = nexusUsername.get() + password = nexusPassword.get() + } + } + } + + // publish to local dir, for artifact tracking and testing + // `./gradlew publishMavenPublicationToLocalBuildRepository` + maven { + url = uri(localBuildRepo.get()) + name = "LocalBuild" + } + } + + publications.create("maven") { + components.findByName("java")?.let { from(it) } + + pom { + url.set("https://www.mongodb.com/") + scm { + url.set("https://github.com/mongodb/mongo-java-driver") + connection.set("scm:https://github.com/mongodb/mongo-java-driver.git") + developerConnection.set("scm:https://github.com/mongodb/mongo-java-driver.git") + } + + developers { + developer { + name.set("Various") + organization.set("MongoDB") + } + } + + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + } + + // Ensure get the final set `base.archivesName` not the default one (project name). + afterEvaluate { artifactId = base.archivesName.get() } + } +} + +tasks.withType { + manifest { attributes["-exportcontents"] = "*;-noimport:=true" } + + afterEvaluate { + manifest { + if (attributes.containsKey("-nomanifest")) { + attributes.remove("-exportcontents") + } else { + attributes["Bundle-Version"] = project.version + attributes["Bundle-SymbolicName"] = + "${project.findProperty("group")}.${project.findProperty("archivesBaseName")}" + attributes["Build-Version"] = gitVersion.get() + attributes["Bundle-Name"] = base.archivesName.get() + } + } + } +} + +signing { + if (signingKey.isPresent && signingPassword.isPresent) { + logger.info("[${project.displayName}] Signing is enabled") + useInMemoryPgpKeys(signingKey.get(), signingPassword.get()) + sign(publishing.publications["maven"]) + } else { + logger.info("[${project.displayName}] No Signing keys found, skipping signing configuration") + } +} + +tasks.named("clean") { delete.add(localBuildRepo) } + +tasks.withType { enabled = false } + +tasks.register("publishSnapshots") { + group = "publishing" + description = "Publishes snapshots to Sonatype" + + if (version.toString().endsWith("-SNAPSHOT")) { + dependsOn(tasks.withType()) + } +} + +tasks.register("publishArchives") { + group = "publishing" + description = "Publishes a release and uploads to Sonatype / Maven Central" + + val currentGitVersion = gitVersion.get() + val gitVersionMatch = currentGitVersion == version + doFirst { + if (!gitVersionMatch) { + val cause = + """ + Version mismatch: + ================= + + $version != $currentGitVersion + + The project version does not match the git tag. + """.trimMargin() + throw GradleException(cause) + } else { + println("Publishing: ${project.name} : $currentGitVersion") + } + } + if (gitVersionMatch) { + dependsOn(tasks.withType()) + } +} + +// workaround for https://github.com/gradle/gradle/issues/16543 +inline fun TaskContainer.provider(taskName: String): Provider = + providers.provider { taskName }.flatMap { named(it) } diff --git a/buildSrc/src/main/kotlin/conventions/scaladoc.gradle.kts b/buildSrc/src/main/kotlin/conventions/scaladoc.gradle.kts new file mode 100644 index 00000000000..b14d9573e72 --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/scaladoc.gradle.kts @@ -0,0 +1,34 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +// Provides the scaladoc configuration for the build +plugins { + id("scala") + id("conventions.publishing") +} + +// Create a generic `docs` task +tasks.register("docs") { + group = "documentation" + dependsOn("scaladoc") +} + +tasks.withType { + group = "documentation" + + destinationDir = rootProject.file("build/docs/${project.base.archivesName.get()}") +} diff --git a/buildSrc/src/main/kotlin/conventions/spotbugs.gradle.kts b/buildSrc/src/main/kotlin/conventions/spotbugs.gradle.kts new file mode 100644 index 00000000000..d675fd27139 --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/spotbugs.gradle.kts @@ -0,0 +1,53 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +import com.github.spotbugs.snom.SpotBugsTask +import org.gradle.kotlin.dsl.dependencies +import project.libs + +// Performs quality checks on your project's Java source files using SpotBug +// https://plugins.gradle.org/plugin/com.github.spotbugs +plugins { + id("java-library") + id("com.github.spotbugs") +} + +dependencies { + compileOnly(libs.findbugs.jsr) + + testImplementation(libs.findbugs.jsr) +} + +spotbugs { + if (!project.buildingWith("ssdlcReport.enabled")) { + excludeFilter.set(rootProject.file("config/spotbugs/exclude.xml")) + } +} + +tasks.withType().configureEach { + if (name == "spotbugsMain") { + reports { + register("xml") { required.set(project.buildingWith("xmlReports.enabled")) } + register("html") { required.set(!project.buildingWith("xmlReports.enabled")) } + register("sarif") { required.set(project.buildingWith("ssdlcReport.enabled")) } + } + } else if (name == "spotbugsTest") { + enabled = false + } else if (name == "spotbugsIntegrationTest") { + enabled = false + } +} diff --git a/buildSrc/src/main/kotlin/conventions/spotless.gradle.kts b/buildSrc/src/main/kotlin/conventions/spotless.gradle.kts new file mode 100644 index 00000000000..f4175ec0c6a --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/spotless.gradle.kts @@ -0,0 +1,69 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +import com.diffplug.gradle.spotless.SpotlessApply +import com.diffplug.gradle.spotless.SpotlessCheck + +// Spotless - keep your code spotless +// https://plugins.gradle.org/plugin/com.diffplug.spotless +plugins { id("com.diffplug.spotless") } + +val doesNotHaveACustomLicenseHeader = "/^(?s)(?!.*@custom-license-header).*/" + +spotless { + kotlinGradle { + ktfmt("0.39").dropboxStyle().configure { it.setMaxWidth(120) } + trimTrailingWhitespace() + indentWithSpaces() + endWithNewline() + licenseHeaderFile(rootProject.file("config/mongodb.license"), "(group|plugins|import|buildscript|rootProject)") + } + + scala { + target("**/*.scala") + scalafmt().configFile(rootProject.file("config/scala/scalafmt.conf")) + } + + kotlin { + target("**/*.kt") + ktfmt().dropboxStyle().configure { it.setMaxWidth(120) } + trimTrailingWhitespace() + indentWithSpaces() + endWithNewline() + licenseHeaderFile(rootProject.file("config/mongodb.license")) + .named("standard") + .onlyIfContentMatches(doesNotHaveACustomLicenseHeader) + } + + format("extraneous") { + target("*.xml", "*.yml", "*.md") + trimTrailingWhitespace() + indentWithSpaces() + endWithNewline() + } +} + +tasks.named("check") { dependsOn("spotlessApply") } + +tasks { + withType().configureEach { + notCompatibleWithConfigurationCache("https://github.com/diffplug/spotless/issues/644") + } + withType().configureEach { + notCompatibleWithConfigurationCache("https://github.com/diffplug/spotless/issues/644") + } +} diff --git a/buildSrc/src/main/kotlin/conventions/test-artifacts-runtime-dependencies.gradle.kts b/buildSrc/src/main/kotlin/conventions/test-artifacts-runtime-dependencies.gradle.kts new file mode 100644 index 00000000000..73b2b891faa --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/test-artifacts-runtime-dependencies.gradle.kts @@ -0,0 +1,27 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +plugins { id("java-library") } + +// Also include test runtime dependencies +dependencies { + testRuntimeClasspath(platform(libs.netty.bom)) + testRuntimeClasspath(libs.netty.tcnative.boringssl.static) + listOf("linux-x86_64", "linux-aarch_64", "osx-x86_64", "osx-aarch_64", "windows-x86_64").forEach { arch -> + testRuntimeClasspath(variantOf(libs.netty.tcnative.boringssl.static) { classifier(arch) }) + } +} diff --git a/buildSrc/src/main/kotlin/conventions/test-artifacts.gradle.kts b/buildSrc/src/main/kotlin/conventions/test-artifacts.gradle.kts new file mode 100644 index 00000000000..f82a88c7df9 --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/test-artifacts.gradle.kts @@ -0,0 +1,43 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +import project.DEFAULT_JAVA_VERSION + +// Allows test artifacts (resources and code) to be shared between projects +plugins { id("java-library") } + +/** Create a test artifact configuration so that test resources can be consumed by other projects. */ +val testArtifacts by configurations.creating +val testJar by + tasks.registering(Jar::class) { + archiveBaseName.set("${project.name}-test") + from(sourceSets.test.get().output) + setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE) + } + +val testJavaVersion: Int = findProperty("javaVersion")?.toString()?.toInt() ?: DEFAULT_JAVA_VERSION + +tasks.withType() { + mustRunAfter(testJar) + + // Needed for OidcAuthenticationProseTests calls `field.setAccessible(true)` + if (testJavaVersion >= DEFAULT_JAVA_VERSION) { + jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") + } +} + +artifacts { add("testArtifacts", testJar) } diff --git a/driver-legacy/build.gradle b/buildSrc/src/main/kotlin/conventions/test-include-optionals.gradle.kts similarity index 50% rename from driver-legacy/build.gradle rename to buildSrc/src/main/kotlin/conventions/test-include-optionals.gradle.kts index 7266e724f7d..e7fde0b4c0f 100644 --- a/driver-legacy/build.gradle +++ b/buildSrc/src/main/kotlin/conventions/test-include-optionals.gradle.kts @@ -13,30 +13,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package conventions +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.project -archivesBaseName = 'mongodb-driver-legacy' -description = 'The MongoDB Legacy Driver' -ext { - pomName = 'The Legacy MongoDB Driver' -} - -sourceSets { - test.groovy.srcDirs += ['src/examples'] -} +// Adds common optional dependencies to the testImplementations +dependencies { -test { - exclude 'tour/**' -} + // Encryption testing + "testImplementation"(project(path = ":mongodb-crypt", configuration = "default")) -dependencies { - api project(':bson') - api project(':driver-core') - api project(':driver-sync') + // Netty stream type testing + "testImplementation"(platform(libs.netty.bom)) + "testImplementation"(libs.bundles.netty) - testImplementation project(':bson').sourceSets.test.output - testImplementation project(':driver-core').sourceSets.test.output - testImplementation project(':driver-sync').sourceSets.test.output + // Snappy / zstd testing + "testImplementation"(libs.snappy.java) + "testImplementation"(libs.zstd.jni) - testRuntimeOnly project(path: ':driver-core', configuration: 'consumableTestRuntimeOnly') + // Socket testing + "testImplementation"(libs.jnr.unixsocket) } diff --git a/buildSrc/src/main/kotlin/conventions/testing-base.gradle.kts b/buildSrc/src/main/kotlin/conventions/testing-base.gradle.kts new file mode 100644 index 00000000000..8aa6d25a5fd --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/testing-base.gradle.kts @@ -0,0 +1,107 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +import com.adarshr.gradle.testlogger.theme.ThemeType +import project.DEFAULT_JAVA_VERSION + +// Default test configuration for projects +// +// Utilizes the test-logger plugin: +// https://plugins.gradle.org/plugin/com.adarshr.test-logger +plugins { + id("java-library") + id("com.adarshr.test-logger") +} + +tasks.withType { + maxHeapSize = "4g" + maxParallelForks = 1 + + useJUnitPlatform() + + // Pass any `org.mongodb.*` system settings + systemProperties = + System.getProperties() + .map { (key, value) -> Pair(key.toString(), value) } + .filter { it.first.startsWith("org.mongodb.") } + .toMap() + + // Convert any ssl based properties + if (project.buildingWith("ssl.enabled")) { + if (project.hasProperty("ssl.keyStoreType")) { + systemProperties( + mapOf( + "javax.net.ssl.keyStoreType" to project.property("ssl.keyStoreType"), + "javax.net.ssl.keyStore" to project.property("ssl.keyStore"), + "javax.net.ssl.keyStorePassword" to project.property("ssl.keyStorePassword"))) + } + if (project.hasProperty("ssl.trustStoreType")) { + systemProperties( + mapOf( + "javax.net.ssl.trustStoreType" to project.property("ssl.trustStoreType"), + "javax.net.ssl.trustStore" to project.property("ssl.trustStore"), + "javax.net.ssl.trustStorePassword" to project.property("ssl.trustStorePassword"))) + } + if (project.hasProperty("ocsp.property")) { + systemProperties( + mapOf( + "org.mongodb.test.ocsp.tls.should.succeed" to project.property("ocsp.tls.should.succeed"), + "java.security.properties" to file(project.property("ocsp.property").toString()), + "com.sun.net.ssl.checkRevocation" to project.property("ssl.checkRevocation"), + "jdk.tls.client.enableStatusRequestExtension" to + project.property("client.enableStatusRequestExtension"), + "jdk.tls.client.protocols" to project.property("client.protocols"))) + } + } + + // Convert gssapi properties + if (project.buildingWith("gssapi.enabled")) { + systemProperties( + mapOf( + "sun.security.krb5.debug" to project.property("sun.security.krb5.debug"), + "javax.security.auth.useSubjectCredsOnly" to "false", + "java.security.krb5.kdc" to project.property("krb5.kdc"), + "java.security.krb5.realm" to project.property("krb5.realm"), + "java.security.auth.login.config" to project.property("auth.login.config"), + )) + } + + // Allow testing with an alternative JDK version + val testJavaVersion: Int = findProperty("javaVersion")?.toString()?.toInt() ?: DEFAULT_JAVA_VERSION + javaLauncher.set(javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(testJavaVersion) }) +} + +// Pretty test output +testlogger { + theme = ThemeType.STANDARD + showExceptions = true + showStackTraces = true + showFullStackTraces = false + showCauses = true + slowThreshold = 2000 + showSummary = true + showSimpleNames = false + showPassed = true + showSkipped = true + showFailed = true + showOnlySlow = false + showStandardStreams = false + showPassedStandardStreams = true + showSkippedStandardStreams = true + showFailedStandardStreams = true + logLevel = LogLevel.LIFECYCLE +} diff --git a/buildSrc/src/main/kotlin/conventions/testing-integration.gradle.kts b/buildSrc/src/main/kotlin/conventions/testing-integration.gradle.kts new file mode 100644 index 00000000000..bdd30028b18 --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/testing-integration.gradle.kts @@ -0,0 +1,50 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +// Adds separate `integrationTest` configuration to a project +// Allows unit and integrations tests to be separate tasks +// +// See: +// https://docs.gradle.org/current/samples/sample_jvm_multi_project_with_additional_test_types.html +plugins { id("java-library") } + +val integrationTest by sourceSets.creating + +configurations[integrationTest.implementationConfigurationName].extendsFrom(configurations.testImplementation.get()) + +configurations[integrationTest.runtimeOnlyConfigurationName].extendsFrom(configurations.testRuntimeOnly.get()) + +val integrationTestTask = + tasks.register("integrationTest") { + description = "Runs integration tests." + group = "verification" + useJUnitPlatform() + + testClassesDirs = integrationTest.output.classesDirs + classpath = configurations[integrationTest.runtimeClasspathConfigurationName] + integrationTest.output + shouldRunAfter(tasks.test) + } + +tasks.findByName("check")?.dependsOn(integrationTestTask) + +dependencies { + "integrationTestImplementation"(project) + "integrationTestImplementation"(platform(libs.junit.bom)) + "integrationTestImplementation"(libs.bundles.junit.vintage) +} + +sourceSets["integrationTest"].java.srcDirs("src/integrationTest", "src/integrationTest/java") diff --git a/buildSrc/src/main/kotlin/conventions/testing-junit-vintage.gradle.kts b/buildSrc/src/main/kotlin/conventions/testing-junit-vintage.gradle.kts new file mode 100644 index 00000000000..48f6eee92eb --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/testing-junit-vintage.gradle.kts @@ -0,0 +1,26 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +// Default junit vintage (aka junit4) test configuration for projects +plugins { id("conventions.testing-base") } + +dependencies { + testImplementation(platform(libs.junit.bom)) + testImplementation(libs.bundles.junit.vintage) +} + +sourceSets["test"].java { srcDirs("src/test", "src/test/unit", "src/test/functional") } diff --git a/buildSrc/src/main/kotlin/conventions/testing-junit.gradle.kts b/buildSrc/src/main/kotlin/conventions/testing-junit.gradle.kts new file mode 100644 index 00000000000..7e72c5101bf --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/testing-junit.gradle.kts @@ -0,0 +1,26 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +// Default junit test configuration for projects +plugins { id("conventions.testing-base") } + +dependencies { + testImplementation(platform(libs.junit.bom)) + testImplementation(libs.bundles.junit) +} + +sourceSets["test"].java { srcDirs("src/test", "src/test/unit", "src/test/functional") } diff --git a/bson/build.gradle b/buildSrc/src/main/kotlin/conventions/testing-mockito.gradle.kts similarity index 67% rename from bson/build.gradle rename to buildSrc/src/main/kotlin/conventions/testing-mockito.gradle.kts index d2b2ed3ba0e..08c33262e9e 100644 --- a/bson/build.gradle +++ b/buildSrc/src/main/kotlin/conventions/testing-mockito.gradle.kts @@ -13,16 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package conventions -archivesBaseName = 'bson' -description = 'The BSON library' +// Adds mockito support to a project +plugins { id("java-library") } -ext { - pomName = 'BSON' - pomURL = 'https://bsonspec.org/' -} - -afterEvaluate { - jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.bson' - jar.manifest.attributes['Import-Package'] = 'org.slf4j.*;resolution:=optional' +dependencies { + if (project.findProperty("javaVersion")?.toString().equals("8")) { + testImplementation(libs.bundles.mockito.java8) + } else { + testImplementation(libs.bundles.mockito) + } } diff --git a/buildSrc/src/main/kotlin/conventions/testing-spock-exclude-slow.gradle.kts b/buildSrc/src/main/kotlin/conventions/testing-spock-exclude-slow.gradle.kts new file mode 100644 index 00000000000..706bca27e8c --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/testing-spock-exclude-slow.gradle.kts @@ -0,0 +1,36 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +import org.gradle.api.tasks.testing.Test +import org.gradle.kotlin.dsl.withType + +// Adds groovy spock testing framework support +// See: https://spockframework.org/ +plugins { id("conventions.testing-spock") } + +tasks.withType().configureEach { + exclude("examples/**") + useJUnitPlatform { excludeTags("Slow") } + + systemProperty("spock.configuration", "${rootProject.file("config/spock/ExcludeSlow.groovy")}") +} + +tasks.register("testSlowOnly", Test::class.java) { + useJUnitPlatform { includeTags("Slow") } + + systemProperty("spock.configuration", "${rootProject.file("config/spock/OnlySlow.groovy")}") +} diff --git a/buildSrc/src/main/kotlin/conventions/testing-spock.gradle.kts b/buildSrc/src/main/kotlin/conventions/testing-spock.gradle.kts new file mode 100644 index 00000000000..e4d46007856 --- /dev/null +++ b/buildSrc/src/main/kotlin/conventions/testing-spock.gradle.kts @@ -0,0 +1,42 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package conventions + +import org.gradle.kotlin.dsl.dependencies +import project.libs + +// Adds groovy spock testing framework support +// See: https://spockframework.org/ +plugins { + id("groovy") + id("conventions.codenarc") + id("conventions.testing-base") + id("conventions.testing-junit-vintage") +} + +dependencies { + testImplementation(platform(libs.spock.bom)) + testImplementation(libs.bundles.spock) +} + +sourceSets { + test { + groovy { srcDirs("src/test", "src/test/unit", "src/test/functional", "src/examples") } + + // Disable java src directories - groovy will compile the mixed java and groovy test code + java { setSrcDirs(emptyList()) } + } +} diff --git a/buildSrc/src/main/kotlin/project/Companion.kt b/buildSrc/src/main/kotlin/project/Companion.kt new file mode 100644 index 00000000000..b4b9650031a --- /dev/null +++ b/buildSrc/src/main/kotlin/project/Companion.kt @@ -0,0 +1,26 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package project + +import org.gradle.accessors.dm.LibrariesForLibs +import org.gradle.api.Project +import org.gradle.kotlin.dsl.getByType + +// Adds the `libs` value for use in project +internal val Project.libs: LibrariesForLibs + get() = extensions.getByType() + +internal const val DEFAULT_JAVA_VERSION = 17 diff --git a/util/taglets/build.gradle b/buildSrc/src/main/kotlin/project/base.gradle.kts similarity index 80% rename from util/taglets/build.gradle rename to buildSrc/src/main/kotlin/project/base.gradle.kts index 4498034e07a..ed13c40cb76 100644 --- a/util/taglets/build.gradle +++ b/buildSrc/src/main/kotlin/project/base.gradle.kts @@ -13,4 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +package project +plugins { id("conventions.git-version") } + +group = "org.mongodb" + +repositories { + mavenLocal() + google() + mavenCentral() +} diff --git a/buildSrc/src/main/kotlin/project/java.gradle.kts b/buildSrc/src/main/kotlin/project/java.gradle.kts new file mode 100644 index 00000000000..60861167f17 --- /dev/null +++ b/buildSrc/src/main/kotlin/project/java.gradle.kts @@ -0,0 +1,50 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package project + +plugins { + id("java-library") + id("checkstyle") + id("project.base") + id("conventions.bnd") + id("conventions.javadoc") + id("conventions.optional") + id("conventions.publishing") + id("conventions.spotbugs") + id("conventions.spotless") + id("conventions.testing-junit") +} + +dependencies { "optionalApi"(libs.slf4j) } + +logger.info("Compiling ${project.name} using JDK${DEFAULT_JAVA_VERSION}") + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + toolchain { languageVersion = JavaLanguageVersion.of(DEFAULT_JAVA_VERSION) } + + withSourcesJar() + withJavadocJar() +} + +tasks.withType { + options.encoding = "UTF-8" + options.release.set(8) +} + +sourceSets["main"].java { srcDir("src/main") } diff --git a/buildSrc/src/main/kotlin/project/kotlin.gradle.kts b/buildSrc/src/main/kotlin/project/kotlin.gradle.kts new file mode 100644 index 00000000000..f6bad54d696 --- /dev/null +++ b/buildSrc/src/main/kotlin/project/kotlin.gradle.kts @@ -0,0 +1,67 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package project + +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile + +plugins { + kotlin("jvm") + id("project.base") + id("conventions.bnd") + id("conventions.detekt") + id("conventions.dokka") + id("conventions.optional") + id("conventions.publishing") + id("conventions.spotbugs") + id("conventions.spotless") + id("conventions.testing-integration") + id("conventions.testing-junit") +} + +/* Compiling */ +logger.info("Compiling ${project.name} using JDK${DEFAULT_JAVA_VERSION}") + +kotlin { + explicitApi() + jvmToolchain(DEFAULT_JAVA_VERSION) +} + +tasks.withType { compilerOptions { jvmTarget = JvmTarget.JVM_1_8 } } + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + withSourcesJar() + withJavadocJar() +} + +dependencies { + "optionalApi"(libs.slf4j) + + // Align versions of all Kotlin components + implementation(platform(libs.kotlin.bom)) + implementation(libs.kotlin.stdlib.jdk8) + + testImplementation(libs.kotlin.reflect) + testImplementation(libs.junit.kotlin) + testImplementation(libs.bundles.mockito.kotlin) + testImplementation(libs.assertj) + testImplementation(libs.classgraph) + + "integrationTestImplementation"(libs.junit.kotlin) +} diff --git a/buildSrc/src/main/kotlin/project/scala.gradle.kts b/buildSrc/src/main/kotlin/project/scala.gradle.kts new file mode 100644 index 00000000000..0657adb9d12 --- /dev/null +++ b/buildSrc/src/main/kotlin/project/scala.gradle.kts @@ -0,0 +1,114 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package project + +import ProjectExtensions.configureMavenPublication +import ProjectExtensions.scalaVersion +import gradle.kotlin.dsl.accessors._473b9544fb0ec2c6cc860d9af4296ace.java + +plugins { + id("scala") + id("project.base") + id("conventions.bnd") + id("conventions.optional") + id("conventions.publishing") + id("conventions.scaladoc") + id("conventions.spotless") + id("conventions.testing-junit") + id("conventions.testing-integration") +} + +group = "org.mongodb.scala" + +val scalaVersion: String by lazy { project.scalaVersion() } + +sourceSets["integrationTest"].scala.srcDir("src/integrationTest/scala") + +tasks.register("scalaCheck") { + description = "Runs all the Scala checks" + group = "verification" + + dependsOn("clean", "compileTestScala", "check") + tasks.findByName("check")?.mustRunAfter("clean") +} + +tasks.withType { + doFirst { println("Running Test task using scala version: $scalaVersion") } + useJUnitPlatform() +} + +tasks.named("clean") { delete.add(rootProject.file("build/docs/")) } + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + withSourcesJar() + withJavadocJar() +} + +afterEvaluate { + configureMavenPublication { artifactId = "${base.archivesName.get()}_${scalaVersion}" } + + // ============================================ + // Scala version specific configuration + // ============================================ + val compileOptions = mutableListOf("-target:jvm-1.8") + when (scalaVersion) { + "2.13" -> { + dependencies { + api(libs.bundles.scala.v2.v13) + + testImplementation(libs.bundles.scala.test.v2.v13) + } + sourceSets { main { scala { setSrcDirs(listOf("src/main/scala", "src/main/scala-2.13+")) } } } + + compileOptions.addAll( + listOf( + "-feature", + "-unchecked", + "-language:reflectiveCalls", + "-Wconf:cat=deprecation:ws", + "-Xlint:strict-unsealed-patmat")) + } + "2.12" -> { + dependencies { + api(libs.bundles.scala.v2.v12) + + testImplementation(libs.bundles.scala.test.v2.v12) + } + sourceSets { main { scala { setSrcDirs(listOf("src/main/scala", "src/main/scala-2.13-")) } } } + } + "2.11" -> { + dependencies { + api(libs.bundles.scala.v2.v11) + + testImplementation(libs.bundles.scala.test.v2.v11) + } + // Reuse the scala-2.12 source as its compatible. + sourceSets { main { scala { setSrcDirs(listOf("src/main/scala", "src/main/scala-2.13-")) } } } + + compileOptions.add("-Xexperimental") + } + } + + tasks.withType { + doFirst { println("Compiling using scala version: $scalaVersion") } + + scalaCompileOptions.isDeprecation = false + scalaCompileOptions.additionalParameters = compileOptions + } +} diff --git a/config/detekt/baseline.xml b/config/detekt/baseline.xml index 718bfeabbf1..d462c314e9c 100644 --- a/config/detekt/baseline.xml +++ b/config/detekt/baseline.xml @@ -2,22 +2,35 @@ + EmptyDefaultConstructor:UnifiedCrudTest.kt$UnifiedCrudTest$() + EmptyDefaultConstructor:UnifiedTest.kt$UnifiedTest$() + EmptyFunctionBlock:SyncMongoCursor.kt$SyncMongoCursor${} IteratorNotThrowingNoSuchElementException:MongoCursor.kt$MongoCursor<T : Any> : IteratorCloseable LargeClass:MongoCollectionTest.kt$MongoCollectionTest LongMethod:FindFlowTest.kt$FindFlowTest$@Test fun shouldCallTheUnderlyingMethods() LongMethod:FindIterableTest.kt$FindIterableTest$@Test fun shouldCallTheUnderlyingMethods() LongMethod:KotlinSerializerCodecTest.kt$KotlinSerializerCodecTest$@Test fun testDataClassOptionalBsonValues() - MaxLineLength:MapReduceFlow.kt$MapReduceFlow$* - MaxLineLength:MapReduceIterable.kt$MapReduceIterable$* + MaxLineLength:ListCollectionNamesFlow.kt$ListCollectionNamesFlow$* + MaxLineLength:ListCollectionNamesIterable.kt$ListCollectionNamesIterable$* MaxLineLength:ListCollectionsFlow.kt$ListCollectionsFlow$* MaxLineLength:ListCollectionsIterable.kt$ListCollectionsIterable$* - MaxLineLength:ListCollectionNamesIterable.kt$ListCollectionNamesIterable$* - MaxLineLength:ListCollectionNamesFlow.kt$ListCollectionNamesFlow$* + MaxLineLength:MapReduceFlow.kt$MapReduceFlow$* + MaxLineLength:MapReduceIterable.kt$MapReduceIterable$* SwallowedException:MockitoHelper.kt$MockitoHelper.DeepReflectionEqMatcher$e: Throwable TooManyFunctions:ClientSession.kt$ClientSession : jClientSession TooManyFunctions:FindFlow.kt$FindFlow<T : Any> : Flow TooManyFunctions:FindIterable.kt$FindIterable<T : Any> : MongoIterable TooManyFunctions:MongoCollection.kt$MongoCollection<T : Any> TooManyFunctions:MongoDatabase.kt$MongoDatabase + TooManyFunctions:SyncClientSession.kt$SyncClientSession : JClientSession + TooManyFunctions:SyncFindIterable.kt$SyncFindIterable<T : Any> : JFindIterableSyncMongoIterable + TooManyFunctions:SyncMongoCluster.kt$SyncMongoCluster : JMongoCluster + TooManyFunctions:SyncMongoCollection.kt$SyncMongoCollection<T : Any> : JMongoCollection + TooManyFunctions:SyncMongoDatabase.kt$SyncMongoDatabase : JMongoDatabase + UnnecessaryAbstractClass:UnifiedTest.kt$UnifiedTest$UnifiedTest + UnsafeCallOnNullableType:SmokeTests.kt$SmokeTests$collection!! + UnusedPrivateMember:SyncMongoIterable.kt$SyncMongoIterable$private var timeoutMode: TimeoutMode? = null + VarCouldBeVal:SyncMongoIterable.kt$SyncMongoIterable$private var timeoutMode: TimeoutMode? = null + WildcardImport:SyncMongoDatabase.kt$import com.mongodb.client.* diff --git a/config/spock/ExcludeSlow.groovy b/config/spock/ExcludeSlow.groovy index db9671d4261..033fbdb2a7d 100644 --- a/config/spock/ExcludeSlow.groovy +++ b/config/spock/ExcludeSlow.groovy @@ -2,5 +2,5 @@ package spock runner { println "Excluding Slow Spock tests" - exclude util.spock.annotations.Slow + exclude com.mongodb.spock.Slow } diff --git a/config/spock/OnlySlow.groovy b/config/spock/OnlySlow.groovy index f333feaa94b..d98c04bd826 100644 --- a/config/spock/OnlySlow.groovy +++ b/config/spock/OnlySlow.groovy @@ -2,5 +2,5 @@ package spock runner { println "Only including Slow Spock tests" - include util.spock.annotations.Slow + include com.mongodb.spock.Slow } diff --git a/driver-benchmarks/build.gradle b/driver-benchmarks/build.gradle deleted file mode 100644 index 91d979cff68..00000000000 --- a/driver-benchmarks/build.gradle +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2016-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -apply plugin: 'application' - -mainClassName = "com.mongodb.benchmark.benchmarks.BenchmarkSuite" - -sourceSets { - main { - java { - srcDir 'src/main' - } - resources { - srcDir 'src/resources' - } - } -} - -dependencies { - api project(':driver-sync') - api project(':mongodb-crypt') - implementation "ch.qos.logback:logback-classic:$logbackVersion" -} - -javadoc { - enabled = false -} - -applicationDefaultJvmArgs = ["-Dorg.mongodb.benchmarks.data=" + System.getProperty('org.mongodb.benchmarks.data'), - "-Dorg.mongodb.benchmarks.output=" + System.getProperty('org.mongodb.benchmarks.output')] - diff --git a/driver-benchmarks/build.gradle.kts b/driver-benchmarks/build.gradle.kts new file mode 100644 index 00000000000..6387de8d058 --- /dev/null +++ b/driver-benchmarks/build.gradle.kts @@ -0,0 +1,67 @@ +/* + * Copyright 2016-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id("application") + id("java-library") + id("project.base") +} + +application { + mainClass = "com.mongodb.benchmark.benchmarks.BenchmarkSuite" + applicationDefaultJvmArgs = listOf( + "-Dorg.mongodb.benchmarks.data=${System.getProperty("org.mongodb.benchmarks.data")}", + "-Dorg.mongodb.benchmarks.output=${System.getProperty("org.mongodb.benchmarks.output")}") +} + +sourceSets { + main { + java { setSrcDirs(listOf("src/main")) } + resources { setSrcDirs(listOf("src/resources")) } + } +} + +dependencies { + api(project(":driver-sync")) + api(project(":mongodb-crypt")) + + implementation(platform(libs.netty.bom)) + implementation(libs.bundles.netty) + + implementation(libs.logback.classic) + implementation(libs.jmh.core) + annotationProcessor(libs.jmh.generator.annprocess) + +} + +tasks.register("jmh") { + group = "benchmark" + description = "Run JMH benchmarks." + mainClass = "org.openjdk.jmh.Main" + classpath = sourceSets.main.get().runtimeClasspath +} + +tasks.register("runNetty") { + group = "application" + description = "Run the Netty main class." + mainClass.set("com.mongodb.benchmark.benchmarks.netty.BenchmarkNettyProviderSuite") + classpath = sourceSets["main"].runtimeClasspath + jvmArgs = application.applicationDefaultJvmArgs.toList() +} + +tasks.withType().configureEach { + enabled = false +} diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractBsonDocumentBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractBsonDocumentBenchmark.java index dfb7c135dac..89f932f03cd 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractBsonDocumentBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractBsonDocumentBenchmark.java @@ -34,8 +34,6 @@ public abstract class AbstractBsonDocumentBenchmark extends Benchmark { protected final PowerOfTwoBufferPool bufferPool = PowerOfTwoBufferPool.DEFAULT; protected final Codec codec; - - private final String name; private final String resourcePath; protected T document; @@ -43,7 +41,7 @@ public abstract class AbstractBsonDocumentBenchmark extends Benchmark { private int fileLength; public AbstractBsonDocumentBenchmark(final String name, final String resourcePath, final Codec codec) { - this.name = name; + super(name); this.resourcePath = resourcePath; this.codec = codec; } @@ -58,11 +56,6 @@ public void setUp() throws IOException { documentBytes = getDocumentAsBuffer(document); } - @Override - public String getName() { - return name; - } - @Override public int getBytesPerRun() { return fileLength * NUM_INTERNAL_ITERATIONS; diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractCollectionWriteBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractCollectionWriteBenchmark.java new file mode 100644 index 00000000000..a77d4f671f3 --- /dev/null +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractCollectionWriteBenchmark.java @@ -0,0 +1,51 @@ +/* + * Copyright 2016-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.mongodb.benchmark.benchmarks; + +import com.mongodb.client.MongoCollection; +import com.mongodb.client.MongoDatabase; + +public abstract class AbstractCollectionWriteBenchmark extends AbstractWriteBenchmark { + + protected MongoCollection collection; + protected MongoDatabase database; + private final Class clazz; + + protected AbstractCollectionWriteBenchmark(final String name, + final String resourcePath, + int numIterations, + int numDocuments, + final Class clazz) { + super(name, resourcePath, numIterations, numDocuments, clazz); + this.clazz = clazz; + } + + @Override + public void setUp() throws Exception { + super.setUp(); + database = client.getDatabase(DATABASE_NAME); + collection = database.getCollection(COLLECTION_NAME, clazz); + database.drop(); + } + + @Override + public void before() throws Exception { + super.before(); + collection.drop(); + } +} diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractFindBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractFindBenchmark.java index 82e1025558d..df3eda6d14d 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractFindBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractFindBenchmark.java @@ -32,23 +32,17 @@ public abstract class AbstractFindBenchmark extends AbstractMongoBenchmark { protected MongoCollection collection; - private final String name; private final String resourcePath; private final Class clazz; private int fileLength; public AbstractFindBenchmark(final String name, final String resourcePath, final Class clazz) { - this.name = name; + super(name); this.resourcePath = resourcePath; this.clazz = clazz; } - @Override - public String getName() { - return name; - } - public void setUp() throws Exception { super.setUp(); collection = client.getDatabase(DATABASE_NAME).getCollection(COLLECTION_NAME, clazz); diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractGridFSBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractGridFSBenchmark.java index 28db0c7b9c1..aeaf908e0a3 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractGridFSBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractGridFSBenchmark.java @@ -27,7 +27,8 @@ public abstract class AbstractGridFSBenchmark extends AbstractMongoBenchmark { protected GridFSBucket bucket; protected byte[] fileBytes; - public AbstractGridFSBenchmark(final String resourcePath) { + public AbstractGridFSBenchmark(final String name, final String resourcePath) { + super(name); this.resourcePath = resourcePath; } diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractMongoBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractMongoBenchmark.java index 71426525ae5..f6a07691596 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractMongoBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractMongoBenchmark.java @@ -17,6 +17,8 @@ package com.mongodb.benchmark.benchmarks; +import com.mongodb.MongoClientSettings; +import com.mongodb.MongoNamespace; import com.mongodb.benchmark.framework.Benchmark; import com.mongodb.client.MongoClient; import com.mongodb.client.MongoClients; @@ -33,12 +35,22 @@ public abstract class AbstractMongoBenchmark extends Benchmark { protected static final String DATABASE_NAME = "perftest"; protected static final String COLLECTION_NAME = "corpus"; + protected static final MongoNamespace NAMESPACE = new MongoNamespace( + AbstractMongoBenchmark.DATABASE_NAME, AbstractMongoBenchmark.COLLECTION_NAME); + protected MongoClientSettings mongoClientSettings; + public AbstractMongoBenchmark(final String name) { + super(name); + } protected MongoClient client; public void setUp() throws Exception { - client = MongoClients.create(); + if (mongoClientSettings != null) { + client = MongoClients.create(mongoClientSettings); + } else { + client = MongoClients.create(); + } } @Override @@ -46,4 +58,8 @@ public void tearDown() throws Exception { client.close(); } + public AbstractMongoBenchmark applyMongoClientSettings(final MongoClientSettings mongoClientSettings) { + this.mongoClientSettings = mongoClientSettings; + return this; + } } diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractInsertBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractWriteBenchmark.java similarity index 61% rename from driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractInsertBenchmark.java rename to driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractWriteBenchmark.java index 561d5c502b5..d9c1a2968f9 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractInsertBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/AbstractWriteBenchmark.java @@ -4,7 +4,7 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software @@ -17,62 +17,52 @@ package com.mongodb.benchmark.benchmarks; -import com.mongodb.client.MongoCollection; -import com.mongodb.client.MongoDatabase; +import com.mongodb.client.model.Filters; import org.bson.codecs.Codec; import org.bson.codecs.DecoderContext; +import org.bson.conversions.Bson; import org.bson.json.JsonReader; import java.nio.charset.StandardCharsets; -public abstract class AbstractInsertBenchmark extends AbstractMongoBenchmark { - - protected MongoCollection collection; - - private final String name; +public abstract class AbstractWriteBenchmark extends AbstractMongoBenchmark { + protected static final Bson EMPTY_FILTER = Filters.empty(); private final String resourcePath; private final Class clazz; private byte[] bytes; protected int fileLength; protected T document; - - protected AbstractInsertBenchmark(final String name, final String resourcePath, final Class clazz) { - this.name = name; + protected int numInternalIterations; + protected int numDocuments; + + protected AbstractWriteBenchmark(final String name, + final String resourcePath, + int numInternalIterations, + int numDocuments, + final Class clazz) { + super(name); this.resourcePath = resourcePath; this.clazz = clazz; + this.numInternalIterations = numInternalIterations; + this.numDocuments = numDocuments; } @Override public void setUp() throws Exception { super.setUp(); - MongoDatabase database = client.getDatabase(DATABASE_NAME); - - collection = database.getCollection(COLLECTION_NAME, clazz); - - database.drop(); bytes = readAllBytesFromRelativePath(resourcePath); - fileLength = bytes.length; - - Codec codec = collection.getCodecRegistry().get(clazz); - + Codec codec = client.getCodecRegistry().get(clazz); document = codec.decode(new JsonReader(new String(bytes, StandardCharsets.UTF_8)), DecoderContext.builder().build()); } - @Override - public void before() throws Exception { - super.before(); - collection.drop(); + protected T createDocument() { + Codec codec = client.getCodecRegistry().get(clazz); + return codec.decode(new JsonReader(new String(bytes, StandardCharsets.UTF_8)), DecoderContext.builder().build()); } @Override - public String getName() { - return name; - } - - protected T createDocument() { - Codec codec = collection.getCodecRegistry().get(clazz); - - return codec.decode(new JsonReader(new String(bytes, StandardCharsets.UTF_8)), DecoderContext.builder().build()); + public int getBytesPerRun() { + return fileLength * numInternalIterations * numDocuments; } } diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/BenchmarkSuite.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/BenchmarkSuite.java index 2260e0ed80a..2595568f148 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/BenchmarkSuite.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/BenchmarkSuite.java @@ -17,6 +17,10 @@ package com.mongodb.benchmark.benchmarks; +import com.mongodb.benchmark.benchmarks.bulk.ClientBulkWriteBenchmark; +import com.mongodb.benchmark.benchmarks.bulk.CollectionBulkWriteBenchmark; +import com.mongodb.benchmark.benchmarks.bulk.MixedClientBulkWriteBenchmark; +import com.mongodb.benchmark.benchmarks.bulk.MixedCollectionBulkWriteBenchmark; import com.mongodb.benchmark.framework.Benchmark; import com.mongodb.benchmark.framework.BenchmarkResult; import com.mongodb.benchmark.framework.BenchmarkResultWriter; @@ -35,16 +39,16 @@ @SuppressWarnings({"rawtypes", "unchecked"}) public class BenchmarkSuite { - private static final int NUM_WARMUP_ITERATIONS = 1; - private static final int NUM_ITERATIONS = 100; - private static final int MIN_TIME_SECONDS = 60; - private static final int MAX_TIME_SECONDS = 300; + protected static final int NUM_WARMUP_ITERATIONS = 1; + protected static final int NUM_ITERATIONS = 100; + protected static final int MIN_TIME_SECONDS = 60; + protected static final int MAX_TIME_SECONDS = 300; - private static final Class DOCUMENT_CLASS = Document.class; - private static final IdRemover ID_REMOVER = document -> document.remove("_id"); - private static final Codec DOCUMENT_CODEC = getDefaultCodecRegistry().get(DOCUMENT_CLASS); + protected static final Class DOCUMENT_CLASS = Document.class; + protected static final IdRemover ID_REMOVER = document -> document.remove("_id"); + protected static final Codec DOCUMENT_CODEC = getDefaultCodecRegistry().get(DOCUMENT_CLASS); - private static final List WRITERS = Arrays.asList( + protected static final List WRITERS = Arrays.asList( new EvergreenBenchmarkResultWriter()); public static void main(String[] args) throws Exception { @@ -70,17 +74,32 @@ private static void runBenchmarks() runBenchmark(new RunCommandBenchmark<>(DOCUMENT_CODEC)); runBenchmark(new FindOneBenchmark("single_and_multi_document/tweet.json", BenchmarkSuite.DOCUMENT_CLASS)); - runBenchmark(new InsertOneBenchmark("Small", "./single_and_multi_document/small_doc.json", 10000, + runBenchmark(new InsertOneBenchmark("Small", "./single_and_multi_document/small_doc.json", 10_000, DOCUMENT_CLASS, ID_REMOVER)); runBenchmark(new InsertOneBenchmark("Large", "./single_and_multi_document/large_doc.json", 10, DOCUMENT_CLASS, ID_REMOVER)); runBenchmark(new FindManyBenchmark("single_and_multi_document/tweet.json", BenchmarkSuite.DOCUMENT_CLASS)); - runBenchmark(new InsertManyBenchmark("Small", "./single_and_multi_document/small_doc.json", 10000, + runBenchmark(new InsertManyBenchmark("Small", "./single_and_multi_document/small_doc.json", 10_000, DOCUMENT_CLASS)); runBenchmark(new InsertManyBenchmark("Large", "./single_and_multi_document/large_doc.json", 10, DOCUMENT_CLASS)); + runBenchmark(new CollectionBulkWriteBenchmark<>("Small", "./single_and_multi_document/small_doc.json", 10_000, + DOCUMENT_CLASS)); + runBenchmark(new CollectionBulkWriteBenchmark<>("Large", "./single_and_multi_document/large_doc.json", 10, + DOCUMENT_CLASS)); + + runBenchmark(new ClientBulkWriteBenchmark<>("Small", "./single_and_multi_document/small_doc.json", 10_000, + DOCUMENT_CLASS)); + runBenchmark(new ClientBulkWriteBenchmark<>("Large", "./single_and_multi_document/large_doc.json", 10, + DOCUMENT_CLASS)); + + runBenchmark(new MixedCollectionBulkWriteBenchmark<>("./single_and_multi_document/small_doc.json", 10_000, + DOCUMENT_CLASS)); + runBenchmark(new MixedClientBulkWriteBenchmark<>("./single_and_multi_document/small_doc.json", 10_000, + DOCUMENT_CLASS)); + runBenchmark(new GridFSUploadBenchmark("single_and_multi_document/gridfs_large.bin")); runBenchmark(new GridFSDownloadBenchmark("single_and_multi_document/gridfs_large.bin")); @@ -101,7 +120,7 @@ private static void runMongoCryptBenchMarks() throws InterruptedException { } } - private static void runBenchmark(final Benchmark benchmark) throws Exception { + protected static void runBenchmark(final Benchmark benchmark) throws Exception { long startTime = System.currentTimeMillis(); BenchmarkResult benchmarkResult = new BenchmarkRunner(benchmark, NUM_WARMUP_ITERATIONS, NUM_ITERATIONS, MIN_TIME_SECONDS, MAX_TIME_SECONDS).run(); diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSDownloadBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSDownloadBenchmark.java index 5a619c38cbe..71a71900771 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSDownloadBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSDownloadBenchmark.java @@ -27,12 +27,7 @@ public class GridFSDownloadBenchmark extends AbstractGridFSBenchmark { private ObjectId fileId; public GridFSDownloadBenchmark(final String resourcePath) { - super(resourcePath); - } - - @Override - public String getName() { - return "GridFS download"; + super("GridFS download", resourcePath); } @Override diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSMultiFileDownloadBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSMultiFileDownloadBenchmark.java index 3a3a3a256ee..e39c0fb46ba 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSMultiFileDownloadBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSMultiFileDownloadBenchmark.java @@ -34,6 +34,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; + public class GridFSMultiFileDownloadBenchmark extends AbstractMongoBenchmark { private GridFSBucket bucket; @@ -43,9 +44,8 @@ public class GridFSMultiFileDownloadBenchmark extends AbstractMongoBenchmark { private File tempDirectory; - @Override - public String getName() { - return "GridFS multi-file download"; + public GridFSMultiFileDownloadBenchmark() { + super("GridFS multi-file download"); } @Override diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSMultiFileUploadBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSMultiFileUploadBenchmark.java index 991c77a694f..cefdc7eaf1c 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSMultiFileUploadBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSMultiFileUploadBenchmark.java @@ -32,6 +32,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; + public class GridFSMultiFileUploadBenchmark extends AbstractMongoBenchmark { private MongoDatabase database; @@ -39,9 +40,8 @@ public class GridFSMultiFileUploadBenchmark extends AbstractMongoBenchmark { private ExecutorService fileService; - @Override - public String getName() { - return "GridFS multi-file upload"; + public GridFSMultiFileUploadBenchmark() { + super("GridFS multi-file upload"); } @Override diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSUploadBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSUploadBenchmark.java index c0aed18680a..2181f89be5a 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSUploadBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/GridFSUploadBenchmark.java @@ -22,12 +22,7 @@ public class GridFSUploadBenchmark extends AbstractGridFSBenchmark { public GridFSUploadBenchmark(final String resourcePath) { - super(resourcePath); - } - - @Override - public String getName() { - return "GridFS upload"; + super("GridFS upload", resourcePath); } @Override diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/InsertManyBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/InsertManyBenchmark.java index 094520afcd2..a67466740e8 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/InsertManyBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/InsertManyBenchmark.java @@ -20,13 +20,11 @@ import java.util.ArrayList; import java.util.List; -public class InsertManyBenchmark extends AbstractInsertBenchmark { - private final int numDocuments; +public class InsertManyBenchmark extends AbstractCollectionWriteBenchmark { private final List documentList; public InsertManyBenchmark(final String name, final String resourcePath, final int numDocuments, final Class clazz) { - super(name + " doc bulk insert", resourcePath, clazz); - this.numDocuments = numDocuments; + super(name + " doc bulk insert", resourcePath, 1, numDocuments, clazz); documentList = new ArrayList<>(numDocuments); } @@ -48,9 +46,4 @@ public void before() throws Exception { public void run() { collection.insertMany(documentList); } - - @Override - public int getBytesPerRun() { - return fileLength * numDocuments; - } } diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/InsertOneBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/InsertOneBenchmark.java index 575a5b4b235..af6f91b91df 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/InsertOneBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/InsertOneBenchmark.java @@ -17,13 +17,13 @@ package com.mongodb.benchmark.benchmarks; -public class InsertOneBenchmark extends AbstractInsertBenchmark { +public class InsertOneBenchmark extends AbstractCollectionWriteBenchmark { private final int numIterations; private final IdRemover idRemover; public InsertOneBenchmark(final String name, final String resourcePath, final int numIterations, final Class clazz, final IdRemover idRemover) { - super(name + " doc insertOne", resourcePath, clazz); + super(name + " doc insertOne", resourcePath, numIterations, 1, clazz); this.numIterations = numIterations; this.idRemover = idRemover; } @@ -35,10 +35,4 @@ public void run() { collection.insertOne(document); } } - - @Override - public int getBytesPerRun() { - return fileLength * numIterations; - } - } diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/MultiFileExportBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/MultiFileExportBenchmark.java index 74f498f0a4d..30c74084419 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/MultiFileExportBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/MultiFileExportBenchmark.java @@ -58,9 +58,8 @@ public class MultiFileExportBenchmark extends AbstractMongoBenchmark { private ExecutorService documentReadingService; private File tempDirectory; - @Override - public String getName() { - return "LDJSON multi-file export"; + public MultiFileExportBenchmark() { + super("LDJSON multi-file export"); } @Override diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/MultiFileImportBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/MultiFileImportBenchmark.java index 3bc76b69146..03d1a721bee 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/MultiFileImportBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/MultiFileImportBenchmark.java @@ -45,6 +45,10 @@ public class MultiFileImportBenchmark extends AbstractMongoBenchmark { private ExecutorService fileReadingService; private ExecutorService documentWritingService; + public MultiFileImportBenchmark() { + super("LDJSON multi-file import"); + } + @Override public void setUp() throws Exception { super.setUp(); @@ -77,12 +81,6 @@ public void tearDown() throws Exception { super.tearDown(); } - @Override - public String getName() { - return "LDJSON multi-file import"; - } - - @Override public void run() throws InterruptedException { CountDownLatch latch = new CountDownLatch(500); diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/RunCommandBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/RunCommandBenchmark.java index 6632b07b6af..ba90066a349 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/RunCommandBenchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/RunCommandBenchmark.java @@ -33,6 +33,7 @@ public class RunCommandBenchmark extends AbstractMongoBenchmark private final T command; public RunCommandBenchmark(final Codec codec) { + super("Run command"); this.codec = codec; this.command = createCommand(); } @@ -43,11 +44,6 @@ public void setUp() throws Exception { database = client.getDatabase("admin"); } - @Override - public String getName() { - return "Run command"; - } - @Override public void run() { for (int i = 0; i < NUM_INTERNAL_ITERATIONS; i++) { diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/bulk/ClientBulkWriteBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/bulk/ClientBulkWriteBenchmark.java new file mode 100644 index 00000000000..3926192ec4b --- /dev/null +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/bulk/ClientBulkWriteBenchmark.java @@ -0,0 +1,50 @@ +/* + * Copyright 2016-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.mongodb.benchmark.benchmarks.bulk; + +import com.mongodb.benchmark.benchmarks.AbstractCollectionWriteBenchmark; +import com.mongodb.client.model.bulk.ClientNamespacedInsertOneModel; +import com.mongodb.client.model.bulk.ClientNamespacedWriteModel; + +import java.util.ArrayList; +import java.util.List; + +public class ClientBulkWriteBenchmark extends AbstractCollectionWriteBenchmark { + private final List modelList; + + public ClientBulkWriteBenchmark(final String name, final String resourcePath, final int numDocuments, final Class clazz) { + super(name + " doc Client BulkWrite insert", resourcePath, 1, numDocuments, clazz); + modelList = new ArrayList<>(numDocuments); + } + + @Override + public void before() throws Exception { + super.before(); + database.createCollection(COLLECTION_NAME); + + modelList.clear(); + for (int i = 0; i < numDocuments; i++) { + modelList.add(ClientNamespacedWriteModel.insertOne(NAMESPACE, createDocument())); + } + } + + @Override + public void run() { + client.bulkWrite(modelList); + } +} diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/bulk/CollectionBulkWriteBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/bulk/CollectionBulkWriteBenchmark.java new file mode 100644 index 00000000000..6a0d74d4736 --- /dev/null +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/bulk/CollectionBulkWriteBenchmark.java @@ -0,0 +1,48 @@ +/* + * Copyright 2016-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.mongodb.benchmark.benchmarks.bulk; + +import com.mongodb.benchmark.benchmarks.AbstractCollectionWriteBenchmark; +import com.mongodb.client.model.InsertOneModel; + +import java.util.ArrayList; +import java.util.List; + +public class CollectionBulkWriteBenchmark extends AbstractCollectionWriteBenchmark { + private final List> modelList; + + public CollectionBulkWriteBenchmark(final String name, final String resourcePath, final int numDocuments, final Class clazz) { + super(name + " doc Collection BulkWrite insert", resourcePath, 1, numDocuments, clazz); + modelList = new ArrayList<>(numDocuments); + } + + @Override + public void before() throws Exception { + super.before(); + database.createCollection(COLLECTION_NAME); + modelList.clear(); + for (int i = 0; i < numDocuments; i++) { + modelList.add(new InsertOneModel<>((createDocument()))); + } + } + + @Override + public void run() { + collection.bulkWrite(modelList); + } +} diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/bulk/MixedClientBulkWriteBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/bulk/MixedClientBulkWriteBenchmark.java new file mode 100644 index 00000000000..7c23712cce7 --- /dev/null +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/bulk/MixedClientBulkWriteBenchmark.java @@ -0,0 +1,86 @@ +/* + * Copyright 2016-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.mongodb.benchmark.benchmarks.bulk; + +import com.mongodb.MongoNamespace; +import com.mongodb.benchmark.benchmarks.AbstractMongoBenchmark; +import com.mongodb.benchmark.benchmarks.AbstractWriteBenchmark; +import com.mongodb.client.MongoDatabase; +import com.mongodb.client.model.bulk.ClientNamespacedWriteModel; + +import java.util.ArrayList; +import java.util.List; + +import static com.mongodb.client.model.bulk.ClientNamespacedWriteModel.deleteOne; +import static com.mongodb.client.model.bulk.ClientNamespacedWriteModel.insertOne; +import static com.mongodb.client.model.bulk.ClientNamespacedWriteModel.replaceOne; + +public class MixedClientBulkWriteBenchmark extends AbstractWriteBenchmark { + private static final int NAMESPACES_COUNT = 10; + private MongoDatabase database; + private final List modelList; + private List namespaces; + + public MixedClientBulkWriteBenchmark(final String resourcePath, final int numDocuments, final Class clazz) { + // numDocuments * 2 aligns with bytes transferred (insertOne + replaceOne documents) + super("Small doc Client BulkWrite Mixed Operations", resourcePath, 1, numDocuments * 2, clazz); + this.modelList = new ArrayList<>(numDocuments * 3); + this.namespaces = new ArrayList<>(NAMESPACES_COUNT); + } + + @Override + public void setUp() throws Exception { + super.setUp(); + database = client.getDatabase(DATABASE_NAME); + database.drop(); + + namespaces = new ArrayList<>(); + for (int i = 1; i <= NAMESPACES_COUNT; i++) { + namespaces.add(new MongoNamespace(AbstractMongoBenchmark.DATABASE_NAME, AbstractMongoBenchmark.COLLECTION_NAME + "_" + i)); + } + } + + @Override + public void before() throws Exception { + super.before(); + database.drop(); + database = client.getDatabase(DATABASE_NAME); + + for (MongoNamespace namespace : namespaces) { + database.createCollection(namespace.getCollectionName()); + } + + modelList.clear(); + for (int i = 0; i < numDocuments / 2; i++) { + MongoNamespace namespace = namespaces.get(i % NAMESPACES_COUNT); + modelList.add(insertOne( + namespace, + createDocument())); + modelList.add(replaceOne( + namespace, EMPTY_FILTER, + createDocument())); + modelList.add(deleteOne( + namespace, EMPTY_FILTER)); + } + } + + @Override + public void run() { + client.bulkWrite(modelList); + } +} diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/bulk/MixedCollectionBulkWriteBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/bulk/MixedCollectionBulkWriteBenchmark.java new file mode 100644 index 00000000000..84bf29e0d2e --- /dev/null +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/bulk/MixedCollectionBulkWriteBenchmark.java @@ -0,0 +1,56 @@ +/* + * Copyright 2016-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.mongodb.benchmark.benchmarks.bulk; + +import com.mongodb.benchmark.benchmarks.AbstractCollectionWriteBenchmark; +import com.mongodb.client.model.DeleteOneModel; +import com.mongodb.client.model.InsertOneModel; +import com.mongodb.client.model.ReplaceOneModel; +import com.mongodb.client.model.WriteModel; + +import java.util.ArrayList; +import java.util.List; + +public class MixedCollectionBulkWriteBenchmark extends AbstractCollectionWriteBenchmark { + private final List> modelList; + + public MixedCollectionBulkWriteBenchmark(final String resourcePath, final int numDocuments, final Class clazz) { + // numDocuments * 2 aligns with bytes transferred (insertOne + replaceOne documents) + super("Small doc Collection BulkWrite Mixed Operations", resourcePath, 1, numDocuments * 2, clazz); + this.modelList = new ArrayList<>(numDocuments * 3); + } + + + @Override + public void before() throws Exception { + super.before(); + database.createCollection(COLLECTION_NAME); + + modelList.clear(); + for (int i = 0; i < numDocuments / 2; i++) { + modelList.add(new InsertOneModel<>((createDocument()))); + modelList.add(new ReplaceOneModel<>(EMPTY_FILTER, createDocument())); + modelList.add(new DeleteOneModel<>(EMPTY_FILTER)); + } + } + + @Override + public void run() { + collection.bulkWrite(modelList); + } +} diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/netty/BenchmarkNettyProviderSuite.java b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/netty/BenchmarkNettyProviderSuite.java new file mode 100644 index 00000000000..5e142376940 --- /dev/null +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/benchmarks/netty/BenchmarkNettyProviderSuite.java @@ -0,0 +1,107 @@ +/* + * Copyright 2016-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.mongodb.benchmark.benchmarks.netty; + +import com.mongodb.MongoClientSettings; +import com.mongodb.benchmark.benchmarks.BenchmarkSuite; +import com.mongodb.benchmark.benchmarks.FindManyBenchmark; +import com.mongodb.benchmark.benchmarks.FindOneBenchmark; +import com.mongodb.benchmark.benchmarks.GridFSDownloadBenchmark; +import com.mongodb.benchmark.benchmarks.GridFSMultiFileDownloadBenchmark; +import com.mongodb.benchmark.benchmarks.GridFSMultiFileUploadBenchmark; +import com.mongodb.benchmark.benchmarks.GridFSUploadBenchmark; +import com.mongodb.benchmark.benchmarks.InsertManyBenchmark; +import com.mongodb.benchmark.benchmarks.InsertOneBenchmark; +import com.mongodb.benchmark.benchmarks.MultiFileExportBenchmark; +import com.mongodb.benchmark.benchmarks.MultiFileImportBenchmark; +import com.mongodb.benchmark.benchmarks.RunCommandBenchmark; +import com.mongodb.benchmark.benchmarks.bulk.ClientBulkWriteBenchmark; +import com.mongodb.benchmark.benchmarks.bulk.CollectionBulkWriteBenchmark; +import com.mongodb.benchmark.benchmarks.bulk.MixedClientBulkWriteBenchmark; +import com.mongodb.benchmark.benchmarks.bulk.MixedCollectionBulkWriteBenchmark; +import com.mongodb.benchmark.framework.BenchmarkResultWriter; +import com.mongodb.connection.NettyTransportSettings; +import io.netty.buffer.PooledByteBufAllocator; +import org.bson.Document; + +@SuppressWarnings({"rawtypes", "unchecked"}) +public class BenchmarkNettyProviderSuite extends BenchmarkSuite { + + public static final MongoClientSettings MONGO_CLIENT_SETTINGS = MongoClientSettings.builder() + .transportSettings(NettyTransportSettings.nettyBuilder() + .allocator(PooledByteBufAllocator.DEFAULT) + .build()) + .build(); + + public static void main(String[] args) throws Exception { + runBenchmarks(); + + for (BenchmarkResultWriter writer : WRITERS) { + writer.close(); + } + } + + private static void runBenchmarks() + throws Exception { + runBenchmark(new RunCommandBenchmark<>(DOCUMENT_CODEC) + .applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + runBenchmark(new FindOneBenchmark("./single_and_multi_document/tweet.json", + DOCUMENT_CLASS).applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + + runBenchmark(new InsertOneBenchmark("Small", "./single_and_multi_document/small_doc.json", 10000, + DOCUMENT_CLASS, ID_REMOVER).applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + runBenchmark(new InsertOneBenchmark("Large", "./single_and_multi_document/large_doc.json", 10, + DOCUMENT_CLASS, ID_REMOVER).applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + + runBenchmark(new FindManyBenchmark("./single_and_multi_document/tweet.json", + DOCUMENT_CLASS).applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + runBenchmark(new InsertManyBenchmark("Small", "./single_and_multi_document/small_doc.json", 10000, + DOCUMENT_CLASS).applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + runBenchmark(new InsertManyBenchmark("Large", "./single_and_multi_document/large_doc.json", 10, + DOCUMENT_CLASS).applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + + runBenchmark(new GridFSUploadBenchmark("./single_and_multi_document/gridfs_large.bin") + .applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + runBenchmark(new GridFSDownloadBenchmark("./single_and_multi_document/gridfs_large.bin") + .applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + + runBenchmark(new CollectionBulkWriteBenchmark<>("Small", "./single_and_multi_document/small_doc.json", 10_000, + DOCUMENT_CLASS).applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + runBenchmark(new CollectionBulkWriteBenchmark<>("Large", "./single_and_multi_document/large_doc.json", 10, + DOCUMENT_CLASS)); + + runBenchmark(new ClientBulkWriteBenchmark<>("Small", "./single_and_multi_document/small_doc.json", 10_000, + DOCUMENT_CLASS).applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + runBenchmark(new ClientBulkWriteBenchmark<>("Large", "./single_and_multi_document/large_doc.json", 10, + DOCUMENT_CLASS).applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + + runBenchmark(new MixedCollectionBulkWriteBenchmark<>("./single_and_multi_document/small_doc.json", 10_000, + DOCUMENT_CLASS).applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + runBenchmark(new MixedClientBulkWriteBenchmark<>("./single_and_multi_document/small_doc.json", 10_000, + DOCUMENT_CLASS).applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + + runBenchmark(new MultiFileImportBenchmark() + .applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + runBenchmark(new MultiFileExportBenchmark() + .applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + runBenchmark(new GridFSMultiFileUploadBenchmark() + .applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + runBenchmark(new GridFSMultiFileDownloadBenchmark() + .applyMongoClientSettings(MONGO_CLIENT_SETTINGS)); + } +} diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/framework/Benchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/framework/Benchmark.java index 9d1bac9c60d..3715887d900 100644 --- a/driver-benchmarks/src/main/com/mongodb/benchmark/framework/Benchmark.java +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/framework/Benchmark.java @@ -29,6 +29,11 @@ public abstract class Benchmark { protected static final int NUM_INTERNAL_ITERATIONS = 10000; static final String TEST_DATA_SYSTEM_PROPERTY_NAME = "org.mongodb.benchmarks.data"; + private String name; + + protected Benchmark(final String name) { + this.name = name; + } public void setUp() throws Exception { } @@ -42,7 +47,9 @@ public void before() throws Exception { public void after() throws Exception { } - public abstract String getName(); + public String getName() { + return name; + } public abstract void run() throws Exception; diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/jmh/codec/BsonArrayCodecBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/jmh/codec/BsonArrayCodecBenchmark.java new file mode 100644 index 00000000000..75cc9dab337 --- /dev/null +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/jmh/codec/BsonArrayCodecBenchmark.java @@ -0,0 +1,99 @@ +/* + * Copyright 2016-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.mongodb.benchmark.jmh.codec; + +import com.mongodb.internal.connection.ByteBufferBsonOutput; +import com.mongodb.internal.connection.PowerOfTwoBufferPool; +import org.bson.BsonArray; +import org.bson.BsonBinaryReader; +import org.bson.BsonBinaryWriter; +import org.bson.BsonDocument; +import org.bson.BsonDouble; +import org.bson.codecs.BsonArrayCodec; +import org.bson.codecs.DecoderContext; +import org.bson.codecs.EncoderContext; +import com.mongodb.lang.NonNull; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.concurrent.TimeUnit; +import static com.mongodb.benchmark.jmh.codec.BsonUtils.getDocumentAsBuffer; + +@BenchmarkMode(Mode.Throughput) +@Warmup(iterations = 20, time = 2, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 20, time = 2, timeUnit = TimeUnit.SECONDS) +@OutputTimeUnit(TimeUnit.SECONDS) +@Fork(3) +public class BsonArrayCodecBenchmark { + + @State(Scope.Benchmark) + public static class Input { + protected final PowerOfTwoBufferPool bufferPool = PowerOfTwoBufferPool.DEFAULT; + protected final BsonArrayCodec bsonArrayCodec = new BsonArrayCodec(); + protected BsonDocument document; + protected byte[] documentBytes; + private BsonBinaryReader reader; + private BsonBinaryWriter writer; + private BsonArray bsonValues; + + @Setup + public void setup() throws IOException { + bsonValues = new BsonArray(); + document = new BsonDocument("array", bsonValues); + + for (int i = 0; i < 1000; i++) { + bsonValues.add(new BsonDouble(i)); + } + + documentBytes = getDocumentAsBuffer(document); + } + + @Setup(Level.Invocation) + public void beforeIteration() { + reader = new BsonBinaryReader(ByteBuffer.wrap(documentBytes)); + writer = new BsonBinaryWriter(new ByteBufferBsonOutput(bufferPool)); + + reader.readStartDocument(); + writer.writeStartDocument(); + writer.writeName("array"); + } + } + + @Benchmark + public void decode(@NonNull Input input, @NonNull Blackhole blackhole) { + blackhole.consume(input.bsonArrayCodec.decode(input.reader, DecoderContext.builder().build())); + } + + @Benchmark + public void encode(@NonNull Input input, @NonNull Blackhole blackhole) { + input.bsonArrayCodec.encode(input.writer, input.bsonValues, EncoderContext.builder().build()); + blackhole.consume(input); + } +} diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/jmh/codec/BsonDocumentBenchmark.java b/driver-benchmarks/src/main/com/mongodb/benchmark/jmh/codec/BsonDocumentBenchmark.java new file mode 100644 index 00000000000..b050f19007e --- /dev/null +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/jmh/codec/BsonDocumentBenchmark.java @@ -0,0 +1,86 @@ +/* + * Copyright 2016-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.mongodb.benchmark.jmh.codec; + +import com.mongodb.internal.connection.ByteBufferBsonOutput; +import com.mongodb.internal.connection.PowerOfTwoBufferPool; +import org.bson.BsonBinaryReader; +import org.bson.BsonBinaryWriter; +import org.bson.BsonDocument; +import org.bson.BsonInt32; +import org.bson.codecs.BsonDocumentCodec; +import org.bson.codecs.DecoderContext; +import org.bson.codecs.EncoderContext; +import com.mongodb.lang.NonNull; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.concurrent.TimeUnit; +import static com.mongodb.benchmark.jmh.codec.BsonUtils.getDocumentAsBuffer; + +/** + * Benchmark with minimal dependency on other codecs to evaluate BsonDocumentCodec's internal performance. + */ +@BenchmarkMode(Mode.Throughput) +@Warmup(iterations = 20, time = 2, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 20, time = 2, timeUnit = TimeUnit.SECONDS) +@OutputTimeUnit(TimeUnit.SECONDS) +@Fork(3) +public class BsonDocumentBenchmark { + + @State(Scope.Benchmark) + public static class Input { + protected final PowerOfTwoBufferPool bufferPool = PowerOfTwoBufferPool.DEFAULT; + protected final BsonDocumentCodec bsonDocumentCodec = new BsonDocumentCodec(); + protected BsonDocument document; + protected byte[] documentBytes; + + @Setup + public void setup() throws IOException { + document = new BsonDocument(); + + for (int i = 0; i < 500; i++) { + document.append(Integer.toString(i), new BsonInt32(i)); + } + + documentBytes = getDocumentAsBuffer(document); + } + } + + @Benchmark + public void decode(@NonNull Input input, @NonNull Blackhole blackhole) { + blackhole.consume(input.bsonDocumentCodec.decode(new BsonBinaryReader(ByteBuffer.wrap(input.documentBytes)), DecoderContext.builder().build())); + } + + @Benchmark + public void encode(@NonNull Input input, @NonNull Blackhole blackhole) { + input.bsonDocumentCodec.encode(new BsonBinaryWriter(new ByteBufferBsonOutput(input.bufferPool)), input.document, EncoderContext.builder().build()); + blackhole.consume(input); + } +} diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/jmh/codec/BsonUtils.java b/driver-benchmarks/src/main/com/mongodb/benchmark/jmh/codec/BsonUtils.java new file mode 100644 index 00000000000..58ad034788b --- /dev/null +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/jmh/codec/BsonUtils.java @@ -0,0 +1,46 @@ +/* + * Copyright 2016-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package com.mongodb.benchmark.jmh.codec; + +import org.bson.BsonBinaryWriter; +import org.bson.BsonDocument; +import org.bson.codecs.BsonDocumentCodec; +import org.bson.codecs.Codec; +import org.bson.codecs.EncoderContext; +import org.bson.io.BasicOutputBuffer; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +public class BsonUtils { + + private static final Codec BSON_DOCUMENT_CODEC = new BsonDocumentCodec(); + + private BsonUtils(){ + //NOP + } + + public static byte[] getDocumentAsBuffer(final BsonDocument document) throws IOException { + BasicOutputBuffer buffer = new BasicOutputBuffer(); + BSON_DOCUMENT_CODEC.encode(new BsonBinaryWriter(buffer), document, EncoderContext.builder().build()); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(buffer.getSize()); + buffer.pipe(baos); + return baos.toByteArray(); + } +} diff --git a/driver-benchmarks/src/main/com/mongodb/benchmark/jmh/codec/package-info.java b/driver-benchmarks/src/main/com/mongodb/benchmark/jmh/codec/package-info.java new file mode 100644 index 00000000000..4c2731a218f --- /dev/null +++ b/driver-benchmarks/src/main/com/mongodb/benchmark/jmh/codec/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright 2016-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + * Contains JMH benchmarks for targeted components and code paths. + * + *

When changes are made, the existing benchmarks can be quickly executed to assess + * any performance impact. These benchmarks are intended for targeted evaluation in a local environment or spawn host + * and are not currently executed on the Evergreen. If a benchmark for a particular code path or component does not yet + * exist, this package provides a convenient location to set up a new one + * for performance testing.

+ */ +package com.mongodb.benchmark.jmh.codec; diff --git a/driver-core/build.gradle b/driver-core/build.gradle deleted file mode 100644 index a44f65bbc1b..00000000000 --- a/driver-core/build.gradle +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -plugins { - id 'com.github.gmazzo.buildconfig' version '3.0.3' -} - -archivesBaseName = 'mongodb-driver-core' -description = 'Shared components for the Synchronous and Reactive Streams implementations of the MongoDB Java Driver.' - -ext { - pomName = 'MongoDB Java Driver Core' -} - -configurations { - consumableTestRuntimeOnly { - extendsFrom testRuntimeOnly - canBeConsumed = true - } -} - -def classifiers = ["linux-x86_64", "linux-aarch_64", "osx-x86_64", "osx-aarch_64", "windows-x86_64"] -dependencies { - api project(path: ':bson', configuration: 'default') - implementation project(path: ':bson-record-codec', configuration: 'default') - implementation project(path: ':bson-kotlin', configuration: 'default'), optional - implementation project(path: ':bson-kotlinx', configuration: 'default'), optional - implementation project(path: ':mongodb-crypt', configuration: 'default'), optional - - implementation "com.github.jnr:jnr-unixsocket:$jnrUnixsocketVersion", optional - api platform("io.netty:netty-bom:$nettyVersion") - api "io.netty:netty-buffer", optional - api "io.netty:netty-transport", optional - api "io.netty:netty-handler", optional - compileOnly "org.graalvm.sdk:graal-sdk:$graalSdkVersion" - - // Optionally depend on both AWS SDK v2 and v1. The driver will use v2 is present, v1 if present, or built-in functionality if - // neither are present - implementation "software.amazon.awssdk:auth:$awsSdkV2Version", optional - implementation "software.amazon.awssdk:sts:$awsSdkV2Version", optional - implementation "com.amazonaws:aws-java-sdk-core:$awsSdkV1Version", optional - implementation "com.amazonaws:aws-java-sdk-sts:$awsSdkV1Version", optional - - implementation "org.xerial.snappy:snappy-java:$snappyVersion", optional - implementation "com.github.luben:zstd-jni:$zstdVersion", optional - - testImplementation project(':bson').sourceSets.test.output - testImplementation('org.junit.jupiter:junit-jupiter-api') - testImplementation("org.reflections:reflections:$reflectionsVersion") - testRuntimeOnly "io.netty:netty-tcnative-boringssl-static" - - classifiers.forEach { - testRuntimeOnly "io.netty:netty-tcnative-boringssl-static::$it" - } -} - -buildConfig { - className('MongoDriverVersion') - packageName('com.mongodb.internal.build') - useJavaOutput() - buildConfigField('String', 'NAME', '"mongo-java-driver"') - buildConfigField('String', 'VERSION', "\"${gitVersion}\"") -} - -afterEvaluate { - jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.driver.core' - jar.manifest.attributes['Bundle-SymbolicName'] = 'org.mongodb.driver-core' - jar.manifest.attributes['Import-Package'] = [ - '!sun.misc.*', // Used by DirectBufferDeallocator only for java 8 - '!sun.nio.ch.*', // Used by DirectBufferDeallocator only for java 8 - '!javax.annotation.*', // Brought in by com.google.code.findbugs:annotations - '!com.oracle.svm.core.annotate.*', // this dependency is provided by the GraalVM runtime - 'io.netty.*;resolution:=optional', - 'com.amazonaws.*;resolution:=optional', - 'software.amazon.awssdk.*;resolution:=optional', - 'org.xerial.snappy.*;resolution:=optional', - 'com.github.luben.zstd.*;resolution:=optional', - 'org.slf4j.*;resolution:=optional', - 'jnr.unixsocket.*;resolution:=optional', - 'com.mongodb.internal.crypt.capi.*;resolution:=optional', - 'jdk.net.*;resolution:=optional', // Used by SocketStreamHelper & depends on JDK version - 'org.bson.codecs.record.*;resolution:=optional', // Depends on JDK version - 'org.bson.codecs.kotlin.*;resolution:=optional', - 'org.bson.codecs.kotlinx.*;resolution:=optional', - '*' // import all that is not excluded or modified before - ].join(',') -} diff --git a/driver-core/build.gradle.kts b/driver-core/build.gradle.kts new file mode 100644 index 00000000000..4f06805a6ea --- /dev/null +++ b/driver-core/build.gradle.kts @@ -0,0 +1,100 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication + +plugins { + id("project.java") + id("conventions.test-artifacts") + id("conventions.testing-mockito") + id("conventions.testing-junit") + id("conventions.testing-spock-exclude-slow") + alias(libs.plugins.build.config) +} + +base.archivesName.set("mongodb-driver-core") + +buildConfig { + className("MongoDriverVersion") + packageName("com.mongodb.internal.build") + useJavaOutput() + buildConfigField("String", "NAME", "\"mongo-java-driver\"") + buildConfigField("String", "VERSION", "\"${(project.findProperty("gitVersion") as Provider<*>?)?.get()}\"") +} + +dependencies { + api(project(path = ":bson", configuration = "default")) + implementation(project(path = ":bson-record-codec", configuration = "default")) + compileOnly(libs.graal.sdk) + + optionalImplementation(project(path = ":bson-kotlin", configuration = "default")) + optionalImplementation(project(path = ":bson-kotlinx", configuration = "default")) + optionalImplementation(project(path = ":mongodb-crypt", configuration = "default")) + optionalImplementation(libs.jnr.unixsocket) + optionalApi(platform(libs.netty.bom)) + optionalApi(libs.bundles.netty) + + // Optionally depend on both AWS SDK v2 and v1. + // The driver will choose: v2 or v1 or fallback to built-in functionality + optionalImplementation(libs.bundles.aws.java.sdk.v1) + optionalImplementation(libs.bundles.aws.java.sdk.v2) + + optionalImplementation(libs.snappy.java) + optionalImplementation(libs.zstd.jni) + + testImplementation(project(path = ":bson", configuration = "testArtifacts")) + testImplementation(libs.reflections) + testImplementation(libs.netty.tcnative.boringssl.static) + listOf("linux-x86_64", "linux-aarch_64", "osx-x86_64", "osx-aarch_64", "windows-x86_64").forEach { arch -> + testImplementation("${libs.netty.tcnative.boringssl.static.get()}::$arch") + } +} + +configureMavenPublication { + pom { + name.set("MongoDB Java Driver Core") + description.set( + "Shared components for the Synchronous and Reactive Streams implementations of the MongoDB Java Driver.") + } +} + +configureJarManifest { + attributes["Automatic-Module-Name"] = "org.mongodb.driver.core" + attributes["Bundle-SymbolicName"] = "org.mongodb.driver-core" + attributes["Import-Package"] = + listOf( + "!sun.misc.*", // Used by DirectBufferDeallocator only for java 8 + "!sun.nio.ch.*", // Used by DirectBufferDeallocator only for java 8 + "!javax.annotation.*", // Brought in by com.google.code.findbugs:annotations + "!com.oracle.svm.core.annotate.*", // this dependency is provided by the GraalVM + // runtime + "io.netty.*;resolution:=optional", + "com.amazonaws.*;resolution:=optional", + "software.amazon.awssdk.*;resolution:=optional", + "org.xerial.snappy.*;resolution:=optional", + "com.github.luben.zstd.*;resolution:=optional", + "org.slf4j.*;resolution:=optional", + "jnr.unixsocket.*;resolution:=optional", + "com.mongodb.internal.crypt.capi.*;resolution:=optional", + "jdk.net.*;resolution:=optional", // Used by SocketStreamHelper & depends on JDK + // version + "org.bson.codecs.record.*;resolution:=optional", // Depends on JDK version + "org.bson.codecs.kotlin.*;resolution:=optional", + "org.bson.codecs.kotlinx.*;resolution:=optional", + "*" // import all that is not excluded or modified before + ) + .joinToString(",") +} diff --git a/driver-core/src/main/com/mongodb/AutoEncryptionSettings.java b/driver-core/src/main/com/mongodb/AutoEncryptionSettings.java index 904f148e891..187d3421235 100644 --- a/driver-core/src/main/com/mongodb/AutoEncryptionSettings.java +++ b/driver-core/src/main/com/mongodb/AutoEncryptionSettings.java @@ -24,8 +24,10 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.TimeUnit; import java.util.function.Supplier; +import static com.mongodb.assertions.Assertions.assertTrue; import static com.mongodb.assertions.Assertions.notNull; import static java.util.Collections.unmodifiableMap; @@ -73,6 +75,8 @@ public final class AutoEncryptionSettings { private final boolean bypassAutoEncryption; private final Map encryptedFieldsMap; private final boolean bypassQueryAnalysis; + @Nullable + private final Long keyExpirationMS; /** * A builder for {@code AutoEncryptionSettings} so that {@code AutoEncryptionSettings} can be immutable, and to support easier @@ -90,6 +94,7 @@ public static final class Builder { private boolean bypassAutoEncryption; private Map encryptedFieldsMap = Collections.emptyMap(); private boolean bypassQueryAnalysis; + @Nullable private Long keyExpirationMS; /** * Sets the key vault settings. @@ -236,6 +241,22 @@ public Builder bypassQueryAnalysis(final boolean bypassQueryAnalysis) { return this; } + /** + * The cache expiration time for data encryption keys. + *

Defaults to {@code null} which defers to libmongocrypt's default which is currently 60000 ms. Set to 0 to disable key expiration.

+ * + * @param keyExpiration the cache expiration time in milliseconds or null to use libmongocrypt's default. + * @param timeUnit the time unit + * @return this + * @see #getKeyExpiration(TimeUnit) + * @since 5.5 + */ + public Builder keyExpiration(@Nullable final Long keyExpiration, final TimeUnit timeUnit) { + assertTrue(keyExpiration == null || keyExpiration >= 0, "keyExpiration must be >= 0 or null"); + this.keyExpirationMS = keyExpiration == null ? null : TimeUnit.MILLISECONDS.convert(keyExpiration, timeUnit); + return this; + } + /** * Build an instance of {@code AutoEncryptionSettings}. * @@ -488,6 +509,21 @@ public boolean isBypassQueryAnalysis() { return bypassQueryAnalysis; } + /** + * Returns the cache expiration time for data encryption keys. + * + *

Defaults to {@code null} which defers to libmongocrypt's default which is currently {@code 60000 ms}. + * Set to {@code 0} to disable key expiration.

+ * + * @param timeUnit the time unit, which must not be null + * @return the cache expiration time or null if not set. + * @since 5.5 + */ + @Nullable + public Long getKeyExpiration(final TimeUnit timeUnit) { + return keyExpirationMS == null ? null : timeUnit.convert(keyExpirationMS, TimeUnit.MILLISECONDS); + } + private AutoEncryptionSettings(final Builder builder) { this.keyVaultMongoClientSettings = builder.keyVaultMongoClientSettings; this.keyVaultNamespace = notNull("keyVaultNamespace", builder.keyVaultNamespace); @@ -499,6 +535,7 @@ private AutoEncryptionSettings(final Builder builder) { this.bypassAutoEncryption = builder.bypassAutoEncryption; this.encryptedFieldsMap = builder.encryptedFieldsMap; this.bypassQueryAnalysis = builder.bypassQueryAnalysis; + this.keyExpirationMS = builder.keyExpirationMS; } @Override diff --git a/driver-core/src/main/com/mongodb/ClientEncryptionSettings.java b/driver-core/src/main/com/mongodb/ClientEncryptionSettings.java index d2188b3d329..6f0411d749c 100644 --- a/driver-core/src/main/com/mongodb/ClientEncryptionSettings.java +++ b/driver-core/src/main/com/mongodb/ClientEncryptionSettings.java @@ -27,6 +27,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Supplier; +import static com.mongodb.assertions.Assertions.assertTrue; import static com.mongodb.assertions.Assertions.notNull; import static com.mongodb.internal.TimeoutSettings.convertAndValidateTimeout; import static java.util.Collections.unmodifiableMap; @@ -50,6 +51,9 @@ public final class ClientEncryptionSettings { private final Map kmsProviderSslContextMap; @Nullable private final Long timeoutMS; + @Nullable + private final Long keyExpirationMS; + /** * A builder for {@code ClientEncryptionSettings} so that {@code ClientEncryptionSettings} can be immutable, and to support easier * construction through chaining. @@ -63,6 +67,8 @@ public static final class Builder { private Map kmsProviderSslContextMap = new HashMap<>(); @Nullable private Long timeoutMS; + @Nullable + private Long keyExpirationMS; /** * Sets the {@link MongoClientSettings} that will be used to access the key vault. @@ -130,6 +136,22 @@ public Builder kmsProviderSslContextMap(final Map kmsProvide return this; } + /** + * The cache expiration time for data encryption keys. + *

Defaults to {@code null} which defers to libmongocrypt's default which is currently 60000 ms. Set to 0 to disable key expiration.

+ * + * @param keyExpiration the cache expiration time in milliseconds or null to use libmongocrypt's default. + * @param timeUnit the time unit + * @return this + * @see #getKeyExpiration(TimeUnit) + * @since 5.5 + */ + public Builder keyExpiration(@Nullable final Long keyExpiration, final TimeUnit timeUnit) { + assertTrue(keyExpiration == null || keyExpiration >= 0, "keyExpiration must be >= 0 or null"); + this.keyExpirationMS = keyExpiration == null ? null : TimeUnit.MILLISECONDS.convert(keyExpiration, timeUnit); + return this; + } + /** * Sets the time limit for the full execution of an operation. * @@ -308,6 +330,21 @@ public Map getKmsProviderSslContextMap() { return unmodifiableMap(kmsProviderSslContextMap); } + /** + * Returns the cache expiration time for data encryption keys. + * + *

Defaults to {@code null} which defers to libmongocrypt's default which is currently {@code 60000 ms}. + * Set to {@code 0} to disable key expiration.

+ * + * @param timeUnit the time unit, which may not be null + * @return the cache expiration time or null if not set. + * @since 5.5 + */ + @Nullable + public Long getKeyExpiration(final TimeUnit timeUnit) { + return keyExpirationMS == null ? null : timeUnit.convert(keyExpirationMS, TimeUnit.MILLISECONDS); + } + /** * The time limit for the full execution of an operation. * @@ -348,6 +385,7 @@ private ClientEncryptionSettings(final Builder builder) { this.kmsProviderPropertySuppliers = notNull("kmsProviderPropertySuppliers", builder.kmsProviderPropertySuppliers); this.kmsProviderSslContextMap = notNull("kmsProviderSslContextMap", builder.kmsProviderSslContextMap); this.timeoutMS = builder.timeoutMS; + this.keyExpirationMS = builder.keyExpirationMS; } } diff --git a/driver-core/src/main/com/mongodb/ReadPreference.java b/driver-core/src/main/com/mongodb/ReadPreference.java index 0d5267f3842..036a4de5df5 100644 --- a/driver-core/src/main/com/mongodb/ReadPreference.java +++ b/driver-core/src/main/com/mongodb/ReadPreference.java @@ -98,7 +98,9 @@ public abstract class ReadPreference { * @return a new ReadPreference instance with hedge options * @since 4.1 * @mongodb.server.release 4.4 + * @deprecated As of MongoDB 8.1, the server ignores the option and periodically logs a warning */ + @Deprecated public abstract ReadPreference withHedgeOptions(ReadPreferenceHedgeOptions hedgeOptions); /** @@ -682,6 +684,7 @@ public TaggableReadPreference withMaxStalenessMS(final Long maxStalenessMS, fina throw new UnsupportedOperationException("Primary read preference can not also specify max staleness"); } + @Deprecated @Override public TaggableReadPreference withHedgeOptions(final ReadPreferenceHedgeOptions hedgeOptions) { throw new UnsupportedOperationException("Primary read preference can not also specify hedge"); diff --git a/driver-core/src/main/com/mongodb/ReadPreferenceHedgeOptions.java b/driver-core/src/main/com/mongodb/ReadPreferenceHedgeOptions.java index 527455fdb98..655f747c808 100644 --- a/driver-core/src/main/com/mongodb/ReadPreferenceHedgeOptions.java +++ b/driver-core/src/main/com/mongodb/ReadPreferenceHedgeOptions.java @@ -25,7 +25,9 @@ * * @since 4.1 * @mongodb.server.release 4.4 + * @deprecated As of MongoDB 8.1, the server ignores the option and periodically logs a warning */ +@Deprecated @Immutable public final class ReadPreferenceHedgeOptions { private final boolean enabled; diff --git a/driver-core/src/main/com/mongodb/TaggableReadPreference.java b/driver-core/src/main/com/mongodb/TaggableReadPreference.java index d92afa128fb..426dc69e966 100644 --- a/driver-core/src/main/com/mongodb/TaggableReadPreference.java +++ b/driver-core/src/main/com/mongodb/TaggableReadPreference.java @@ -54,6 +54,7 @@ public abstract class TaggableReadPreference extends ReadPreference { private final List tagSetList = new ArrayList<>(); private final Long maxStalenessMS; + @SuppressWarnings("deprecation") private final ReadPreferenceHedgeOptions hedgeOptions; TaggableReadPreference() { @@ -61,6 +62,7 @@ public abstract class TaggableReadPreference extends ReadPreference { this.hedgeOptions = null; } + @SuppressWarnings("deprecation") TaggableReadPreference(final List tagSetList, @Nullable final Long maxStaleness, final TimeUnit timeUnit, @Nullable final ReadPreferenceHedgeOptions hedgeOptions) { notNull("tagSetList", tagSetList); @@ -80,6 +82,7 @@ public abstract class TaggableReadPreference extends ReadPreference { @Override public abstract TaggableReadPreference withMaxStalenessMS(Long maxStalenessMS, TimeUnit timeUnit); + @Deprecated @Override public abstract TaggableReadPreference withHedgeOptions(ReadPreferenceHedgeOptions hedgeOptions); @@ -146,7 +149,9 @@ public Long getMaxStaleness(final TimeUnit timeUnit) { * @return the hedge options * @mongodb.server.release 4.4 * @since 4.1 + * @deprecated As of MongoDB 8.1, the server ignores the option and periodically logs a warning */ + @Deprecated @Nullable public ReadPreferenceHedgeOptions getHedgeOptions() { return hedgeOptions; @@ -327,6 +332,7 @@ static class SecondaryReadPreference extends TaggableReadPreference { this(tagSetList, maxStaleness, timeUnit, null); } + @SuppressWarnings("deprecation") SecondaryReadPreference(final List tagSetList, @Nullable final Long maxStaleness, final TimeUnit timeUnit, @Nullable final ReadPreferenceHedgeOptions hedgeOptions) { super(tagSetList, maxStaleness, timeUnit, hedgeOptions); @@ -349,6 +355,7 @@ public TaggableReadPreference withMaxStalenessMS(@Nullable final Long maxStalene return new SecondaryReadPreference(getTagSetList(), maxStaleness, timeUnit, getHedgeOptions()); } + @Deprecated @Override public TaggableReadPreference withHedgeOptions(final ReadPreferenceHedgeOptions hedgeOptions) { return new SecondaryReadPreference(getTagSetList(), getMaxStaleness(MILLISECONDS), MILLISECONDS, hedgeOptions); @@ -388,6 +395,7 @@ static class SecondaryPreferredReadPreference extends SecondaryReadPreference { this(tagSetList, maxStaleness, timeUnit, null); } + @SuppressWarnings("deprecation") SecondaryPreferredReadPreference(final List tagSetList, @Nullable final Long maxStaleness, final TimeUnit timeUnit, @Nullable final ReadPreferenceHedgeOptions hedgeOptions) { super(tagSetList, maxStaleness, timeUnit, hedgeOptions); @@ -410,6 +418,7 @@ public TaggableReadPreference withMaxStalenessMS(@Nullable final Long maxStalene return new SecondaryPreferredReadPreference(getTagSetList(), maxStaleness, timeUnit, getHedgeOptions()); } + @Deprecated @Override public TaggableReadPreference withHedgeOptions(final ReadPreferenceHedgeOptions hedgeOptions) { return new SecondaryPreferredReadPreference(getTagSetList(), getMaxStaleness(MILLISECONDS), MILLISECONDS, hedgeOptions); @@ -441,6 +450,7 @@ static class NearestReadPreference extends TaggableReadPreference { this(tagSetList, maxStaleness, timeUnit, null); } + @SuppressWarnings("deprecation") NearestReadPreference(final List tagSetList, @Nullable final Long maxStaleness, final TimeUnit timeUnit, @Nullable final ReadPreferenceHedgeOptions hedgeOptions) { super(tagSetList, maxStaleness, timeUnit, hedgeOptions); @@ -463,6 +473,7 @@ public TaggableReadPreference withMaxStalenessMS(@Nullable final Long maxStalene return new NearestReadPreference(getTagSetList(), maxStaleness, timeUnit, getHedgeOptions()); } + @Deprecated @Override public TaggableReadPreference withHedgeOptions(final ReadPreferenceHedgeOptions hedgeOptions) { return new NearestReadPreference(getTagSetList(), getMaxStaleness(MILLISECONDS), MILLISECONDS, hedgeOptions); @@ -503,6 +514,7 @@ static class PrimaryPreferredReadPreference extends SecondaryReadPreference { this(tagSetList, maxStaleness, timeUnit, null); } + @SuppressWarnings("deprecation") PrimaryPreferredReadPreference(final List tagSetList, @Nullable final Long maxStaleness, final TimeUnit timeUnit, @Nullable final ReadPreferenceHedgeOptions hedgeOptions) { super(tagSetList, maxStaleness, timeUnit, hedgeOptions); @@ -525,6 +537,7 @@ public TaggableReadPreference withMaxStalenessMS(@Nullable final Long maxStalene return new PrimaryPreferredReadPreference(getTagSetList(), maxStaleness, timeUnit, getHedgeOptions()); } + @Deprecated @Override public TaggableReadPreference withHedgeOptions(final ReadPreferenceHedgeOptions hedgeOptions) { return new PrimaryPreferredReadPreference(getTagSetList(), getMaxStaleness(MILLISECONDS), MILLISECONDS, hedgeOptions); diff --git a/driver-core/src/main/com/mongodb/assertions/Assertions.java b/driver-core/src/main/com/mongodb/assertions/Assertions.java index a40b4e4b7b6..bf38638dc6d 100644 --- a/driver-core/src/main/com/mongodb/assertions/Assertions.java +++ b/driver-core/src/main/com/mongodb/assertions/Assertions.java @@ -179,6 +179,19 @@ public static boolean assertTrue(final boolean value) throws AssertionError { return true; } + /** + * @param value A value to check. + * @param message The message. + * @return {@code true}. + * @throws AssertionError If {@code value} is {@code false}. + */ + public static boolean assertTrue(final boolean value, final String message) throws AssertionError { + if (!value) { + throw new AssertionError(message); + } + return true; + } + /** * @param value A value to check. * @return {@code false}. diff --git a/driver-core/src/main/com/mongodb/connection/ConnectionDescription.java b/driver-core/src/main/com/mongodb/connection/ConnectionDescription.java index 8b68cd6f9c2..c8c213398b7 100644 --- a/driver-core/src/main/com/mongodb/connection/ConnectionDescription.java +++ b/driver-core/src/main/com/mongodb/connection/ConnectionDescription.java @@ -29,6 +29,7 @@ import static com.mongodb.assertions.Assertions.notNull; import static com.mongodb.connection.ServerDescription.getDefaultMaxDocumentSize; +import static com.mongodb.internal.operation.ServerVersionHelper.UNKNOWN_WIRE_VERSION; /** * A description of a connection to a MongoDB server. @@ -57,7 +58,7 @@ public class ConnectionDescription { * @param serverId the server address */ public ConnectionDescription(final ServerId serverId) { - this(new ConnectionId(serverId), 0, ServerType.UNKNOWN, DEFAULT_MAX_WRITE_BATCH_SIZE, + this(new ConnectionId(serverId), UNKNOWN_WIRE_VERSION, ServerType.UNKNOWN, DEFAULT_MAX_WRITE_BATCH_SIZE, getDefaultMaxDocumentSize(), DEFAULT_MAX_MESSAGE_SIZE, Collections.emptyList()); } diff --git a/driver-core/src/main/com/mongodb/connection/ServerDescription.java b/driver-core/src/main/com/mongodb/connection/ServerDescription.java index f3de13006d1..2d675bce217 100644 --- a/driver-core/src/main/com/mongodb/connection/ServerDescription.java +++ b/driver-core/src/main/com/mongodb/connection/ServerDescription.java @@ -55,12 +55,12 @@ public class ServerDescription { * The minimum supported driver server version * @since 3.8 */ - public static final String MIN_DRIVER_SERVER_VERSION = "3.6"; + public static final String MIN_DRIVER_SERVER_VERSION = "4.2"; /** * The minimum supported driver wire version * @since 3.8 */ - public static final int MIN_DRIVER_WIRE_VERSION = 7; + public static final int MIN_DRIVER_WIRE_VERSION = 8; /** * The maximum supported driver wire version * @since 3.8 diff --git a/driver-core/src/main/com/mongodb/internal/TimeoutContext.java b/driver-core/src/main/com/mongodb/internal/TimeoutContext.java index 35ffedbb16f..2a886704cd9 100644 --- a/driver-core/src/main/com/mongodb/internal/TimeoutContext.java +++ b/driver-core/src/main/com/mongodb/internal/TimeoutContext.java @@ -192,7 +192,10 @@ public long getMaxAwaitTimeMS() { public void runMaxTimeMS(final LongConsumer onRemaining) { if (maxTimeSupplier != null) { - runWithFixedTimeout(maxTimeSupplier.get(), onRemaining); + long maxTimeMS = maxTimeSupplier.get(); + if (maxTimeMS > 0) { + runMinTimeout(onRemaining, maxTimeMS); + } return; } if (timeout == null) { @@ -209,6 +212,22 @@ public void runMaxTimeMS(final LongConsumer onRemaining) { } + private void runMinTimeout(final LongConsumer onRemaining, final long fixedMs) { + Timeout timeout = timeoutIncludingRoundTrip(); + if (timeout != null) { + timeout.run(MILLISECONDS, () -> { + onRemaining.accept(fixedMs); + }, + (renamingMs) -> { + onRemaining.accept(Math.min(renamingMs, fixedMs)); + }, () -> { + throwMongoTimeoutException("The operation exceeded the timeout limit."); + }); + } else { + onRemaining.accept(fixedMs); + } + } + private static void runWithFixedTimeout(final long ms, final LongConsumer onRemaining) { if (ms != 0) { onRemaining.accept(ms); @@ -227,10 +246,14 @@ public void resetToDefaultMaxTime() { *

* NOTE: Suitable for static user-defined values only (i.e MaxAwaitTimeMS), * not for running timeouts that adjust dynamically (CSOT). + * + * If remaining CSOT timeout is less than this static timeout, then CSOT timeout will be used. + * */ public void setMaxTimeOverride(final long maxTimeMS) { this.maxTimeSupplier = () -> maxTimeMS; } + /** * Disable the maxTimeMS override. This way the maxTimeMS will not * be appended to the command in the {@link CommandMessage}. diff --git a/driver-core/src/main/com/mongodb/internal/TimeoutSettings.java b/driver-core/src/main/com/mongodb/internal/TimeoutSettings.java index 486a893d74c..e1f0bc0b795 100644 --- a/driver-core/src/main/com/mongodb/internal/TimeoutSettings.java +++ b/driver-core/src/main/com/mongodb/internal/TimeoutSettings.java @@ -165,6 +165,11 @@ public TimeoutSettings withReadTimeoutMS(final long readTimeoutMS) { maxTimeMS, maxCommitTimeMS, wTimeoutMS, maxWaitTimeMS); } + public TimeoutSettings withConnectTimeoutMS(final long connectTimeoutMS) { + return new TimeoutSettings(generationId, timeoutMS, serverSelectionTimeoutMS, connectTimeoutMS, readTimeoutMS, maxAwaitTimeMS, + maxTimeMS, maxCommitTimeMS, wTimeoutMS, maxWaitTimeMS); + } + public TimeoutSettings withServerSelectionTimeoutMS(final long serverSelectionTimeoutMS) { return new TimeoutSettings(timeoutMS, serverSelectionTimeoutMS, connectTimeoutMS, readTimeoutMS, maxAwaitTimeMS, maxTimeMS, maxCommitTimeMS, wTimeoutMS, maxWaitTimeMS); diff --git a/driver-core/src/main/com/mongodb/internal/capi/MongoCryptHelper.java b/driver-core/src/main/com/mongodb/internal/capi/MongoCryptHelper.java index 1ba51797bea..240f5051c92 100644 --- a/driver-core/src/main/com/mongodb/internal/capi/MongoCryptHelper.java +++ b/driver-core/src/main/com/mongodb/internal/capi/MongoCryptHelper.java @@ -53,7 +53,8 @@ public final class MongoCryptHelper { public static MongoCryptOptions createMongoCryptOptions(final ClientEncryptionSettings settings) { - return createMongoCryptOptions(settings.getKmsProviders(), false, emptyList(), emptyMap(), null, null); + return createMongoCryptOptions(settings.getKmsProviders(), false, emptyList(), emptyMap(), null, null, + settings.getKeyExpiration(TimeUnit.MILLISECONDS)); } public static MongoCryptOptions createMongoCryptOptions(final AutoEncryptionSettings settings) { @@ -63,7 +64,8 @@ public static MongoCryptOptions createMongoCryptOptions(final AutoEncryptionSett settings.isBypassAutoEncryption() ? emptyList() : singletonList("$SYSTEM"), settings.getExtraOptions(), settings.getSchemaMap(), - settings.getEncryptedFieldsMap()); + settings.getEncryptedFieldsMap(), + settings.getKeyExpiration(TimeUnit.MILLISECONDS)); } public static void validateRewrapManyDataKeyOptions(final RewrapManyDataKeyOptions options) { @@ -78,7 +80,8 @@ private static MongoCryptOptions createMongoCryptOptions( final List searchPaths, @Nullable final Map extraOptions, @Nullable final Map localSchemaMap, - @Nullable final Map encryptedFieldsMap) { + @Nullable final Map encryptedFieldsMap, + @Nullable final Long keyExpirationMS) { MongoCryptOptions.Builder mongoCryptOptionsBuilder = MongoCryptOptions.builder(); mongoCryptOptionsBuilder.kmsProviderOptions(getKmsProvidersAsBsonDocument(kmsProviders)); mongoCryptOptionsBuilder.bypassQueryAnalysis(bypassQueryAnalysis); @@ -87,6 +90,7 @@ private static MongoCryptOptions createMongoCryptOptions( mongoCryptOptionsBuilder.localSchemaMap(localSchemaMap); mongoCryptOptionsBuilder.encryptedFieldsMap(encryptedFieldsMap); mongoCryptOptionsBuilder.needsKmsCredentialsStateEnabled(true); + mongoCryptOptionsBuilder.keyExpirationMS(keyExpirationMS); return mongoCryptOptionsBuilder.build(); } public static BsonDocument fetchCredentials(final Map> kmsProviders, diff --git a/driver-core/src/main/com/mongodb/internal/connection/ByteBufferBsonOutput.java b/driver-core/src/main/com/mongodb/internal/connection/ByteBufferBsonOutput.java index 40df1b867fd..600145db48f 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/ByteBufferBsonOutput.java +++ b/driver-core/src/main/com/mongodb/internal/connection/ByteBufferBsonOutput.java @@ -16,6 +16,7 @@ package com.mongodb.internal.connection; +import org.bson.BsonSerializationException; import org.bson.ByteBuf; import org.bson.io.OutputBuffer; @@ -27,6 +28,7 @@ import static com.mongodb.assertions.Assertions.assertTrue; import static com.mongodb.assertions.Assertions.notNull; +import static java.lang.String.format; /** *

This class is not part of the public API and may be removed or changed at any time

@@ -43,6 +45,7 @@ public class ByteBufferBsonOutput extends OutputBuffer { private int curBufferIndex = 0; private int position = 0; private boolean closed; + private ByteBuf currentByteBuffer; /** * Construct an instance that uses the given buffer provider to allocate byte buffers as needs as it grows. @@ -82,6 +85,84 @@ public void writeBytes(final byte[] bytes, final int offset, final int length) { position += length; } + @Override + public void writeInt32(final int value) { + ensureOpen(); + ByteBuf buf = getCurrentByteBuffer(); + if (buf.remaining() >= 4) { + buf.putInt(value); + position += 4; + } else { + // fallback for edge cases + super.writeInt32(value); + } + } + + + @Override + public void writeInt32(final int absolutePosition, final int value) { + ensureOpen(); + + if (absolutePosition < 0) { + throw new IllegalArgumentException(String.format("position must be >= 0 but was %d", absolutePosition)); + } + + if (absolutePosition + 3 > position - 1) { + throw new IllegalArgumentException(String.format("Cannot write 4 bytes starting at position %d: current size is %d bytes", + position - 1, + absolutePosition + 3)); + } + + BufferPositionPair bufferPositionPair = getBufferPositionPair(absolutePosition); + ByteBuf byteBuffer = getByteBufferAtIndex(bufferPositionPair.bufferIndex); + int capacity = byteBuffer.position() - bufferPositionPair.position; + + if (capacity >= 4) { + byteBuffer.putInt(bufferPositionPair.position, value); + } else { + // fallback for edge cases + int valueToWrite = value; + int pos = bufferPositionPair.position; + int bufferIndex = bufferPositionPair.bufferIndex; + + for (int i = 0; i < 4; i++) { + byteBuffer.put(pos++, (byte) valueToWrite); + valueToWrite = valueToWrite >> 8; + if (--capacity == 0) { + byteBuffer = getByteBufferAtIndex(++bufferIndex); + pos = 0; + capacity = byteBuffer.position(); + } + } + } + } + + @Override + public void writeDouble(final double value) { + ensureOpen(); + ByteBuf buf = getCurrentByteBuffer(); + if (buf.remaining() >= 8) { + buf.putDouble(value); + position += 8; + } else { + // fallback for edge cases + writeInt64(Double.doubleToRawLongBits(value)); + } + } + + @Override + public void writeInt64(final long value) { + ensureOpen(); + ByteBuf buf = getCurrentByteBuffer(); + if (buf.remaining() >= 8) { + buf.putLong(value); + position += 8; + } else { + // fallback for edge cases + super.writeInt64(value); + } + } + @Override public void writeByte(final int value) { ensureOpen(); @@ -91,20 +172,25 @@ public void writeByte(final int value) { } private ByteBuf getCurrentByteBuffer() { - ByteBuf curByteBuffer = getByteBufferAtIndex(curBufferIndex); - if (curByteBuffer.hasRemaining()) { - return curByteBuffer; + if (currentByteBuffer == null) { + currentByteBuffer = getByteBufferAtIndex(curBufferIndex); + } + + if (currentByteBuffer.hasRemaining()) { + return currentByteBuffer; } curBufferIndex++; - return getByteBufferAtIndex(curBufferIndex); + currentByteBuffer = getByteBufferAtIndex(curBufferIndex); + return currentByteBuffer; } private ByteBuf getByteBufferAtIndex(final int index) { if (bufferList.size() < index + 1) { - bufferList.add(bufferProvider.getBuffer(index >= (MAX_SHIFT - INITIAL_SHIFT) - ? MAX_BUFFER_SIZE - : Math.min(INITIAL_BUFFER_SIZE << index, MAX_BUFFER_SIZE))); + ByteBuf buffer = bufferProvider.getBuffer(index >= (MAX_SHIFT - INITIAL_SHIFT) + ? MAX_BUFFER_SIZE + : Math.min(INITIAL_BUFFER_SIZE << index, MAX_BUFFER_SIZE)); + bufferList.add(buffer); } return bufferList.get(index); } @@ -147,6 +233,16 @@ public List getByteBuffers() { return buffers; } + public List getDuplicateByteBuffers() { + ensureOpen(); + + List buffers = new ArrayList<>(bufferList.size()); + for (final ByteBuf cur : bufferList) { + buffers.add(cur.duplicate().order(ByteOrder.LITTLE_ENDIAN)); + } + return buffers; + } + @Override public int pipe(final OutputStream out) throws IOException { @@ -155,14 +251,18 @@ public int pipe(final OutputStream out) throws IOException { byte[] tmp = new byte[INITIAL_BUFFER_SIZE]; int total = 0; - for (final ByteBuf cur : getByteBuffers()) { - ByteBuf dup = cur.duplicate(); - while (dup.hasRemaining()) { - int numBytesToCopy = Math.min(dup.remaining(), tmp.length); - dup.get(tmp, 0, numBytesToCopy); - out.write(tmp, 0, numBytesToCopy); + List byteBuffers = getByteBuffers(); + try { + for (final ByteBuf cur : byteBuffers) { + while (cur.hasRemaining()) { + int numBytesToCopy = Math.min(cur.remaining(), tmp.length); + cur.get(tmp, 0, numBytesToCopy); + out.write(tmp, 0, numBytesToCopy); + } + total += cur.limit(); } - total += dup.limit(); + } finally { + byteBuffers.forEach(ByteBuf::release); } return total; } @@ -181,6 +281,10 @@ public void truncateToPosition(final int newPosition) { bufferList.get(bufferPositionPair.bufferIndex).position(bufferPositionPair.position); + if (bufferPositionPair.bufferIndex + 1 < bufferList.size()) { + currentByteBuffer = null; + } + while (bufferList.size() > bufferPositionPair.bufferIndex + 1) { ByteBuf buffer = bufferList.remove(bufferList.size() - 1); buffer.release(); @@ -208,6 +312,7 @@ public void close() { for (final ByteBuf cur : bufferList) { cur.release(); } + currentByteBuffer = null; bufferList.clear(); closed = true; } @@ -247,6 +352,7 @@ private void merge(final ByteBufferBsonOutput branch) { bufferList.addAll(branch.bufferList); curBufferIndex += branch.curBufferIndex + 1; position += branch.position; + currentByteBuffer = null; } public static final class Branch extends ByteBufferBsonOutput { @@ -282,4 +388,165 @@ private static final class BufferPositionPair { this.position = position; } } + + protected int writeCharacters(final String str, final boolean checkNullTermination) { + int stringLength = str.length(); + int sp = 0; + int prevPos = position; + + ByteBuf curBuffer = getCurrentByteBuffer(); + int curBufferPos = curBuffer.position(); + int curBufferLimit = curBuffer.limit(); + int remaining = curBufferLimit - curBufferPos; + + if (curBuffer.isBackedByArray()) { + byte[] dst = curBuffer.array(); + int arrayOffset = curBuffer.arrayOffset(); + if (remaining >= str.length() + 1) { + // Write ASCII characters directly to the array until we hit a non-ASCII character. + sp = writeOnArrayAscii(str, dst, arrayOffset + curBufferPos, checkNullTermination); + curBufferPos += sp; + // If the whole string was written as ASCII, append the null terminator. + if (sp == stringLength) { + dst[arrayOffset + curBufferPos++] = 0; + position += sp + 1; + curBuffer.position(curBufferPos); + return sp + 1; + } + // Otherwise, update the position to reflect the partial write. + position += sp; + curBuffer.position(curBufferPos); + } + } + + // We get here, when the buffer is not backed by an array, or when the string contains at least one non-ASCII characters. + return writeOnBuffers(str, + checkNullTermination, + sp, + stringLength, + curBufferLimit, + curBufferPos, + curBuffer, + prevPos); + } + + private int writeOnBuffers(final String str, + final boolean checkNullTermination, + final int stringPointer, + final int stringLength, + final int bufferLimit, + final int bufferPos, + final ByteBuf buffer, + final int prevPos) { + int remaining; + int sp = stringPointer; + int curBufferPos = bufferPos; + int curBufferLimit = bufferLimit; + ByteBuf curBuffer = buffer; + while (sp < stringLength) { + remaining = curBufferLimit - curBufferPos; + int c = str.charAt(sp); + + if (checkNullTermination && c == 0x0) { + throw new BsonSerializationException( + format("BSON cstring '%s' is not valid because it contains a null character " + "at index %d", str, sp)); + } + + if (c < 0x80) { + if (remaining == 0) { + curBuffer = getCurrentByteBuffer(); + curBufferPos = 0; + curBufferLimit = curBuffer.limit(); + } + curBuffer.put((byte) c); + curBufferPos++; + position++; + } else if (c < 0x800) { + if (remaining < 2) { + // Not enough space: use write() to handle buffer boundary + write((byte) (0xc0 + (c >> 6))); + write((byte) (0x80 + (c & 0x3f))); + + curBuffer = getCurrentByteBuffer(); + curBufferPos = curBuffer.position(); + curBufferLimit = curBuffer.limit(); + } else { + curBuffer.put((byte) (0xc0 + (c >> 6))); + curBuffer.put((byte) (0x80 + (c & 0x3f))); + curBufferPos += 2; + position += 2; + } + } else { + // Handle multibyte characters (may involve surrogate pairs). + c = Character.codePointAt(str, sp); + /* + Malformed surrogate pairs are encoded as-is (3 byte code unit) without substituting any code point. + This known deviation from the spec and current functionality remains for backward compatibility. + Ticket: JAVA-5575 + */ + if (c < 0x10000) { + if (remaining < 3) { + write((byte) (0xe0 + (c >> 12))); + write((byte) (0x80 + ((c >> 6) & 0x3f))); + write((byte) (0x80 + (c & 0x3f))); + + curBuffer = getCurrentByteBuffer(); + curBufferPos = curBuffer.position(); + curBufferLimit = curBuffer.limit(); + } else { + curBuffer.put((byte) (0xe0 + (c >> 12))); + curBuffer.put((byte) (0x80 + ((c >> 6) & 0x3f))); + curBuffer.put((byte) (0x80 + (c & 0x3f))); + curBufferPos += 3; + position += 3; + } + } else { + if (remaining < 4) { + write((byte) (0xf0 + (c >> 18))); + write((byte) (0x80 + ((c >> 12) & 0x3f))); + write((byte) (0x80 + ((c >> 6) & 0x3f))); + write((byte) (0x80 + (c & 0x3f))); + + curBuffer = getCurrentByteBuffer(); + curBufferPos = curBuffer.position(); + curBufferLimit = curBuffer.limit(); + } else { + curBuffer.put((byte) (0xf0 + (c >> 18))); + curBuffer.put((byte) (0x80 + ((c >> 12) & 0x3f))); + curBuffer.put((byte) (0x80 + ((c >> 6) & 0x3f))); + curBuffer.put((byte) (0x80 + (c & 0x3f))); + curBufferPos += 4; + position += 4; + } + } + } + sp += Character.charCount(c); + } + + getCurrentByteBuffer().put((byte) 0); + position++; + return position - prevPos; + } + + private static int writeOnArrayAscii(final String str, + final byte[] dst, + final int arrayPosition, + final boolean checkNullTermination) { + int pos = arrayPosition; + int sp = 0; + // Fast common path: This tight loop is JIT-friendly (simple, no calls, few branches), + // It might be unrolled for performance. + for (; sp < str.length(); sp++, pos++) { + char c = str.charAt(sp); + if (checkNullTermination && c == 0) { + throw new BsonSerializationException( + format("BSON cstring '%s' is not valid because it contains a null character " + "at index %d", str, sp)); + } + if (c >= 0x80) { + break; + } + dst[pos] = (byte) c; + } + return sp; + } } diff --git a/driver-core/src/main/com/mongodb/internal/connection/Cluster.java b/driver-core/src/main/com/mongodb/internal/connection/Cluster.java index a6d4a026608..87fa73c8536 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/Cluster.java +++ b/driver-core/src/main/com/mongodb/internal/connection/Cluster.java @@ -83,7 +83,7 @@ void selectServerAsync(ServerSelector serverSelector, OperationContext operation /** * This method allows {@link Server}s to notify the {@link Cluster} about changes in their state as per the - * + * * Server Discovery And Monitoring specification. */ void onChange(ServerDescriptionChangedEvent event); diff --git a/driver-core/src/main/com/mongodb/internal/connection/CommandMessage.java b/driver-core/src/main/com/mongodb/internal/connection/CommandMessage.java index 46eabab21bb..12543e92ccb 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/CommandMessage.java +++ b/driver-core/src/main/com/mongodb/internal/connection/CommandMessage.java @@ -60,8 +60,7 @@ import static com.mongodb.internal.connection.ByteBufBsonDocument.createList; import static com.mongodb.internal.connection.ByteBufBsonDocument.createOne; import static com.mongodb.internal.connection.ReadConcernHelper.getReadConcernDocument; -import static com.mongodb.internal.operation.ServerVersionHelper.FOUR_DOT_TWO_WIRE_VERSION; -import static com.mongodb.internal.operation.ServerVersionHelper.FOUR_DOT_ZERO_WIRE_VERSION; +import static com.mongodb.internal.operation.ServerVersionHelper.UNKNOWN_WIRE_VERSION; /** * A command message that uses OP_MSG or OP_QUERY to send the command. @@ -346,7 +345,6 @@ private List getExtraElements(final OperationContext operationConte assertFalse(sessionContext.hasActiveTransaction() && sessionContext.isSnapshot()); if (sessionContext.hasActiveTransaction()) { - checkServerVersionForTransactionSupport(); extraElements.add(new BsonElement("txnNumber", new BsonInt64(sessionContext.getTransactionNumber()))); if (firstMessageInTransaction) { extraElements.add(new BsonElement("startTransaction", BsonBoolean.TRUE)); @@ -381,12 +379,6 @@ private void addServerApiElements(final List extraElements) { } } - private void checkServerVersionForTransactionSupport() { - if (getSettings().getMaxWireVersion() < FOUR_DOT_TWO_WIRE_VERSION && getSettings().getServerType() == SHARD_ROUTER) { - throw new MongoClientException("Transactions are not supported by the MongoDB cluster to which this client is connected."); - } - } - private void addReadConcernDocument(final List extraElements, final SessionContext sessionContext) { BsonDocument readConcernDocument = getReadConcernDocument(sessionContext, getSettings().getMaxWireVersion()); @@ -416,7 +408,7 @@ private static OpCode getOpCode(final MessageSettings settings, final ClusterCon } private static boolean isServerVersionKnown(final MessageSettings settings) { - return settings.getMaxWireVersion() >= FOUR_DOT_ZERO_WIRE_VERSION; + return settings.getMaxWireVersion() != UNKNOWN_WIRE_VERSION; } @FunctionalInterface diff --git a/driver-core/src/main/com/mongodb/internal/connection/CompositeByteBuf.java b/driver-core/src/main/com/mongodb/internal/connection/CompositeByteBuf.java index fa8cde2e517..a3ce668040c 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/CompositeByteBuf.java +++ b/driver-core/src/main/com/mongodb/internal/connection/CompositeByteBuf.java @@ -213,6 +213,16 @@ public byte[] array() { throw new UnsupportedOperationException("Not implemented yet!"); } + @Override + public boolean isBackedByArray() { + return false; + } + + @Override + public int arrayOffset() { + throw new UnsupportedOperationException("Not implemented yet!"); + } + @Override public ByteBuf limit(final int newLimit) { if (newLimit < 0 || newLimit > capacity()) { @@ -237,6 +247,26 @@ public ByteBuf put(final byte b) { throw new UnsupportedOperationException(); } + @Override + public ByteBuf putInt(final int b) { + throw new UnsupportedOperationException(); + } + + @Override + public ByteBuf putInt(final int index, final int b) { + throw new UnsupportedOperationException(); + } + + @Override + public ByteBuf putDouble(final double b) { + throw new UnsupportedOperationException(); + } + + @Override + public ByteBuf putLong(final long b) { + throw new UnsupportedOperationException(); + } + @Override public ByteBuf flip() { throw new UnsupportedOperationException(); diff --git a/driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java b/driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java index 248c213a9a4..ed6b706bece 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java +++ b/driver-core/src/main/com/mongodb/internal/connection/DefaultConnectionPool.java @@ -149,9 +149,9 @@ final class DefaultConnectionPool implements ConnectionPool { /** * @param sdamProvider For handling exceptions via the - * + * * SDAM machinery as specified - * + * * here. * Must provide an {@linkplain Optional#isPresent() empty} {@link Optional} if created in load-balanced mode, * otherwise must provide a non-empty {@link Optional}. @@ -511,7 +511,7 @@ private void connectionPoolCreated(final ConnectionPoolListener connectionPoolLi * @return A {@link StartTime} before executing {@link ConnectionPoolListener#connectionCreated(ConnectionCreatedEvent)} * and logging the event. This order is required by - * CMAP + * CMAP * and {@link ConnectionReadyEvent#getElapsedTime(TimeUnit)}. */ private StartTime connectionCreated(final ConnectionPoolListener connectionPoolListener, final ConnectionId connectionId) { @@ -570,7 +570,7 @@ private void connectionCheckedOut( * @return A {@link StartTime} before executing * {@link ConnectionPoolListener#connectionCheckOutStarted(ConnectionCheckOutStartedEvent)} and logging the event. * This order is required by - * CMAP + * CMAP * and {@link ConnectionCheckedOutEvent#getElapsedTime(TimeUnit)}, {@link ConnectionCheckOutFailedEvent#getElapsedTime(TimeUnit)}. */ private StartTime connectionCheckoutStarted(final OperationContext operationContext) { @@ -1425,7 +1425,7 @@ Timeout timeout() { * {@link #runOnceAndStop()} unless {@link BackgroundMaintenanceManager} is {@linkplain #close() closed}. *

* This class implements - * + * * CMAP background thread. */ @NotThreadSafe diff --git a/driver-core/src/main/com/mongodb/internal/connection/DefaultSdamServerDescriptionManager.java b/driver-core/src/main/com/mongodb/internal/connection/DefaultSdamServerDescriptionManager.java index 3e32d505641..6137afd3e6d 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/DefaultSdamServerDescriptionManager.java +++ b/driver-core/src/main/com/mongodb/internal/connection/DefaultSdamServerDescriptionManager.java @@ -119,7 +119,7 @@ private void handleException(final SdamIssue sdamIssue, final boolean beforeHand } if (sdamIssue.relatedToStateChange()) { updateDescription(sdamIssue.serverDescription()); - if (sdamIssue.serverIsLessThanVersionFourDotTwo() || sdamIssue.relatedToShutdown()) { + if (sdamIssue.relatedToShutdown()) { connectionPool.invalidate(sdamIssue.exception().orElse(null)); } serverMonitor.connect(); @@ -130,9 +130,6 @@ private void handleException(final SdamIssue sdamIssue, final boolean beforeHand serverMonitor.cancelCurrentCheck(); } else if (sdamIssue.relatedToWriteConcern() || !sdamIssue.specific()) { updateDescription(sdamIssue.serverDescription()); - if (sdamIssue.serverIsLessThanVersionFourDotTwo()) { - connectionPool.invalidate(sdamIssue.exception().orElse(null)); - } serverMonitor.connect(); } } diff --git a/driver-core/src/main/com/mongodb/internal/connection/MessageSettings.java b/driver-core/src/main/com/mongodb/internal/connection/MessageSettings.java index 91fd862ce4b..51587e8f91d 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/MessageSettings.java +++ b/driver-core/src/main/com/mongodb/internal/connection/MessageSettings.java @@ -20,6 +20,8 @@ import com.mongodb.annotations.NotThreadSafe; import com.mongodb.connection.ServerType; +import static com.mongodb.internal.operation.ServerVersionHelper.UNKNOWN_WIRE_VERSION; + /** * The message settings * @@ -75,7 +77,7 @@ public static final class Builder { private int maxDocumentSize = DEFAULT_MAX_DOCUMENT_SIZE; private int maxMessageSize = DEFAULT_MAX_MESSAGE_SIZE; private int maxBatchCount = DEFAULT_MAX_BATCH_COUNT; - private int maxWireVersion; + private int maxWireVersion = UNKNOWN_WIRE_VERSION; private ServerType serverType; private boolean sessionSupported; private boolean cryptd; diff --git a/driver-core/src/main/com/mongodb/internal/connection/ResponseBuffers.java b/driver-core/src/main/com/mongodb/internal/connection/ResponseBuffers.java index e984862fe0f..6774b4a50af 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/ResponseBuffers.java +++ b/driver-core/src/main/com/mongodb/internal/connection/ResponseBuffers.java @@ -53,13 +53,15 @@ T getResponseDocument(final int messageId, final Decode } /** - * Returns a read-only buffer containing the response body. Care should be taken to not use the returned buffer after this instance has + * Returns a buffer containing the response body. Care should be taken to not use the returned buffer after this instance has * been closed. * - * @return a read-only buffer containing the response body + * NOTE: do not modify this buffer, it is being made writable for performance reasons to avoid redundant copying. + * + * @return a buffer containing the response body */ public ByteBuf getBodyByteBuffer() { - return bodyByteBuffer.asReadOnly(); + return bodyByteBuffer; } public void reset() { diff --git a/driver-core/src/main/com/mongodb/internal/connection/SdamServerDescriptionManager.java b/driver-core/src/main/com/mongodb/internal/connection/SdamServerDescriptionManager.java index a7078b7cfb9..18f32ce619e 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/SdamServerDescriptionManager.java +++ b/driver-core/src/main/com/mongodb/internal/connection/SdamServerDescriptionManager.java @@ -35,11 +35,10 @@ import static com.mongodb.assertions.Assertions.assertTrue; import static com.mongodb.internal.connection.ClusterableServer.SHUTDOWN_CODES; import static com.mongodb.internal.connection.ServerDescriptionHelper.unknownConnectingServerDescription; -import static com.mongodb.internal.operation.ServerVersionHelper.FOUR_DOT_TWO_WIRE_VERSION; /** * See the - * + * * Server Discovery And Monitoring specification. */ @ThreadSafe @@ -117,10 +116,6 @@ ServerDescription serverDescription() { return unknownConnectingServerDescription(context.serverId(), exception); } - boolean serverIsLessThanVersionFourDotTwo() { - return context.serverIsLessThanVersionFourDotTwo(); - } - boolean stale(final ConnectionPool connectionPool, final ServerDescription currentServerDescription) { return context.stale(connectionPool) || stale(exception, currentServerDescription); } @@ -192,10 +187,6 @@ static final class Context { this.serverMaxWireVersion = serverMaxWireVersion; } - private boolean serverIsLessThanVersionFourDotTwo() { - return serverMaxWireVersion < FOUR_DOT_TWO_WIRE_VERSION; - } - private boolean stale(final ConnectionPool connectionPool) { return connectionPoolGeneration < connectionPool.getGeneration(); } diff --git a/driver-core/src/main/com/mongodb/internal/connection/Server.java b/driver-core/src/main/com/mongodb/internal/connection/Server.java index 13cc951c5ea..bc7d9eac7e3 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/Server.java +++ b/driver-core/src/main/com/mongodb/internal/connection/Server.java @@ -53,7 +53,7 @@ public interface Server { /** * An approximation of the - * + * * number of operations that this server is currently executing. * * @return A negative value iff the server does not track its operation count. diff --git a/driver-core/src/main/com/mongodb/internal/connection/StreamFactoryHelper.java b/driver-core/src/main/com/mongodb/internal/connection/StreamFactoryHelper.java index 1100a4e27f1..7aeb65720b0 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/StreamFactoryHelper.java +++ b/driver-core/src/main/com/mongodb/internal/connection/StreamFactoryHelper.java @@ -21,8 +21,10 @@ import com.mongodb.connection.AsyncTransportSettings; import com.mongodb.connection.NettyTransportSettings; import com.mongodb.connection.SocketSettings; +import com.mongodb.connection.SslSettings; import com.mongodb.connection.TransportSettings; import com.mongodb.internal.connection.netty.NettyStreamFactoryFactory; +import com.mongodb.lang.Nullable; import com.mongodb.spi.dns.InetAddressResolver; import java.io.IOException; @@ -34,16 +36,26 @@ */ public final class StreamFactoryHelper { - public static StreamFactory getSyncStreamFactory(final MongoClientSettings settings, - final InetAddressResolver inetAddressResolver, final SocketSettings socketSettings) { - TransportSettings transportSettings = settings.getTransportSettings(); + public static StreamFactoryFactory getSyncStreamFactoryFactory( + @Nullable final TransportSettings transportSettings, + final InetAddressResolver inetAddressResolver) { + if (transportSettings == null) { - return new SocketStreamFactory(inetAddressResolver, socketSettings, settings.getSslSettings()); + return new StreamFactoryFactory() { + @Override + public StreamFactory create(final SocketSettings socketSettings, final SslSettings sslSettings) { + return new SocketStreamFactory(inetAddressResolver, socketSettings, sslSettings); + } + + @Override + public void close() { + //NOP + } + }; } else if (transportSettings instanceof AsyncTransportSettings) { throw new MongoClientException("Unsupported transport settings in sync: " + transportSettings.getClass().getName()); } else if (transportSettings instanceof NettyTransportSettings) { - return getNettyStreamFactoryFactory(inetAddressResolver, (NettyTransportSettings) transportSettings) - .create(socketSettings, settings.getSslSettings()); + return getNettyStreamFactoryFactory(inetAddressResolver, (NettyTransportSettings) transportSettings); } else { throw new MongoClientException("Unsupported transport settings: " + transportSettings.getClass().getName()); } diff --git a/driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java b/driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java index daf0d8cecdd..df8b3c2fe42 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java +++ b/driver-core/src/main/com/mongodb/internal/connection/TlsChannelStreamFactoryFactory.java @@ -40,6 +40,7 @@ import java.net.StandardSocketOptions; import java.nio.ByteBuffer; import java.nio.channels.CompletionHandler; +import java.nio.channels.InterruptedByTimeoutException; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.SocketChannel; @@ -49,6 +50,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; import static com.mongodb.assertions.Assertions.assertTrue; import static com.mongodb.assertions.Assertions.isTrue; @@ -97,21 +99,40 @@ public void close() { group.shutdown(); } + /** + * Monitors `OP_CONNECT` events for socket connections. + */ private static class SelectorMonitor implements Closeable { - private static final class Pair { + static final class SocketRegistration { private final SocketChannel socketChannel; - private final Runnable attachment; + private final AtomicReference afterConnectAction; - private Pair(final SocketChannel socketChannel, final Runnable attachment) { + SocketRegistration(final SocketChannel socketChannel, final Runnable afterConnectAction) { this.socketChannel = socketChannel; - this.attachment = attachment; + this.afterConnectAction = new AtomicReference<>(afterConnectAction); + } + + boolean tryCancelPendingConnection() { + return tryTakeAction() != null; + } + + void runAfterConnectActionIfNotCanceled() { + Runnable afterConnectActionToExecute = tryTakeAction(); + if (afterConnectActionToExecute != null) { + afterConnectActionToExecute.run(); + } + } + + @Nullable + private Runnable tryTakeAction() { + return afterConnectAction.getAndSet(null); } } private final Selector selector; private volatile boolean isClosed; - private final ConcurrentLinkedDeque pendingRegistrations = new ConcurrentLinkedDeque<>(); + private final ConcurrentLinkedDeque pendingRegistrations = new ConcurrentLinkedDeque<>(); SelectorMonitor() { try { @@ -127,17 +148,14 @@ void start() { while (!isClosed) { try { selector.select(); - for (SelectionKey selectionKey : selector.selectedKeys()) { selectionKey.cancel(); - Runnable runnable = (Runnable) selectionKey.attachment(); - runnable.run(); + ((SocketRegistration) selectionKey.attachment()).runAfterConnectActionIfNotCanceled(); } - for (Iterator iter = pendingRegistrations.iterator(); iter.hasNext();) { - Pair pendingRegistration = iter.next(); - pendingRegistration.socketChannel.register(selector, SelectionKey.OP_CONNECT, - pendingRegistration.attachment); + for (Iterator iter = pendingRegistrations.iterator(); iter.hasNext();) { + SocketRegistration pendingRegistration = iter.next(); + pendingRegistration.socketChannel.register(selector, SelectionKey.OP_CONNECT, pendingRegistration); iter.remove(); } } catch (Exception e) { @@ -156,8 +174,8 @@ void start() { selectorThread.start(); } - void register(final SocketChannel channel, final Runnable attachment) { - pendingRegistrations.add(new Pair(channel, attachment)); + void register(final SocketRegistration registration) { + pendingRegistrations.add(registration); selector.wakeup(); } @@ -200,44 +218,79 @@ public void openAsync(final OperationContext operationContext, final AsyncComple if (getSettings().getSendBufferSize() > 0) { socketChannel.setOption(StandardSocketOptions.SO_SNDBUF, getSettings().getSendBufferSize()); } - + //getConnectTimeoutMs MUST be called before connection attempt, as it might throw MongoOperationTimeout exception. + int connectTimeoutMs = operationContext.getTimeoutContext().getConnectTimeoutMs(); socketChannel.connect(getSocketAddresses(getServerAddress(), inetAddressResolver).get(0)); + SelectorMonitor.SocketRegistration socketRegistration = new SelectorMonitor.SocketRegistration( + socketChannel, () -> initializeTslChannel(handler, socketChannel)); - selectorMonitor.register(socketChannel, () -> { - try { - if (!socketChannel.finishConnect()) { - throw new MongoSocketOpenException("Failed to finish connect", getServerAddress()); - } + if (connectTimeoutMs > 0) { + scheduleTimeoutInterruption(handler, socketRegistration, connectTimeoutMs); + } + selectorMonitor.register(socketRegistration); + } catch (IOException e) { + handler.failed(new MongoSocketOpenException("Exception opening socket", getServerAddress(), e)); + } catch (Throwable t) { + handler.failed(t); + } + } - SSLEngine sslEngine = getSslContext().createSSLEngine(getServerAddress().getHost(), - getServerAddress().getPort()); - sslEngine.setUseClientMode(true); + private void scheduleTimeoutInterruption(final AsyncCompletionHandler handler, + final SelectorMonitor.SocketRegistration socketRegistration, + final int connectTimeoutMs) { + group.getTimeoutExecutor().schedule(() -> { + if (socketRegistration.tryCancelPendingConnection()) { + closeAndTimeout(handler, socketRegistration.socketChannel); + } + }, connectTimeoutMs, TimeUnit.MILLISECONDS); + } - SSLParameters sslParameters = sslEngine.getSSLParameters(); - enableSni(getServerAddress().getHost(), sslParameters); + private void closeAndTimeout(final AsyncCompletionHandler handler, final SocketChannel socketChannel) { + // We check if this stream was closed before timeout exception. + boolean streamClosed = isClosed(); + InterruptedByTimeoutException timeoutException = new InterruptedByTimeoutException(); + try { + socketChannel.close(); + } catch (Exception e) { + timeoutException.addSuppressed(e); + } - if (!sslSettings.isInvalidHostNameAllowed()) { - enableHostNameVerification(sslParameters); - } - sslEngine.setSSLParameters(sslParameters); + if (streamClosed) { + handler.completed(null); + } else { + handler.failed(new MongoSocketOpenException("Exception opening socket", getAddress(), timeoutException)); + } + } - BufferAllocator bufferAllocator = new BufferProviderAllocator(); + private void initializeTslChannel(final AsyncCompletionHandler handler, final SocketChannel socketChannel) { + try { + if (!socketChannel.finishConnect()) { + throw new MongoSocketOpenException("Failed to finish connect", getServerAddress()); + } - TlsChannel tlsChannel = ClientTlsChannel.newBuilder(socketChannel, sslEngine) - .withEncryptedBufferAllocator(bufferAllocator) - .withPlainBufferAllocator(bufferAllocator) - .build(); + SSLEngine sslEngine = getSslContext().createSSLEngine(getServerAddress().getHost(), + getServerAddress().getPort()); + sslEngine.setUseClientMode(true); - // build asynchronous channel, based in the TLS channel and associated with the global group. - setChannel(new AsynchronousTlsChannelAdapter(new AsynchronousTlsChannel(group, tlsChannel, socketChannel))); + SSLParameters sslParameters = sslEngine.getSSLParameters(); + enableSni(getServerAddress().getHost(), sslParameters); - handler.completed(null); - } catch (IOException e) { - handler.failed(new MongoSocketOpenException("Exception opening socket", getServerAddress(), e)); - } catch (Throwable t) { - handler.failed(t); - } - }); + if (!sslSettings.isInvalidHostNameAllowed()) { + enableHostNameVerification(sslParameters); + } + sslEngine.setSSLParameters(sslParameters); + + BufferAllocator bufferAllocator = new BufferProviderAllocator(); + + TlsChannel tlsChannel = ClientTlsChannel.newBuilder(socketChannel, sslEngine) + .withEncryptedBufferAllocator(bufferAllocator) + .withPlainBufferAllocator(bufferAllocator) + .build(); + + // build asynchronous channel, based in the TLS channel and associated with the global group. + setChannel(new AsynchronousTlsChannelAdapter(new AsynchronousTlsChannel(group, tlsChannel, socketChannel))); + + handler.completed(null); } catch (IOException e) { handler.failed(new MongoSocketOpenException("Exception opening socket", getServerAddress(), e)); } catch (Throwable t) { diff --git a/driver-core/src/main/com/mongodb/internal/connection/netty/NettyByteBuf.java b/driver-core/src/main/com/mongodb/internal/connection/netty/NettyByteBuf.java index 074e77de04f..21124d81d31 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/netty/NettyByteBuf.java +++ b/driver-core/src/main/com/mongodb/internal/connection/netty/NettyByteBuf.java @@ -89,6 +89,30 @@ public ByteBuf put(final byte b) { return this; } + @Override + public ByteBuf putInt(final int b) { + proxied.writeInt(b); + return this; + } + + @Override + public ByteBuf putInt(final int index, final int b) { + proxied.setInt(index, b); + return this; + } + + @Override + public ByteBuf putDouble(final double b) { + proxied.writeDouble(b); + return this; + } + + @Override + public ByteBuf putLong(final long b) { + proxied.writeLong(b); + return this; + } + @Override public ByteBuf flip() { isWriting = !isWriting; @@ -100,6 +124,16 @@ public byte[] array() { return proxied.array(); } + @Override + public boolean isBackedByArray() { + return proxied.hasArray(); + } + + @Override + public int arrayOffset() { + return proxied.arrayOffset(); + } + @Override public int limit() { if (isWriting) { diff --git a/driver-core/src/main/com/mongodb/internal/connection/tlschannel/async/AsynchronousTlsChannelGroup.java b/driver-core/src/main/com/mongodb/internal/connection/tlschannel/async/AsynchronousTlsChannelGroup.java index 57db0df66e8..d9b1420a6e3 100644 --- a/driver-core/src/main/com/mongodb/internal/connection/tlschannel/async/AsynchronousTlsChannelGroup.java +++ b/driver-core/src/main/com/mongodb/internal/connection/tlschannel/async/AsynchronousTlsChannelGroup.java @@ -823,4 +823,13 @@ public long getCurrentWriteCount() { public long getCurrentRegistrationCount() { return registrations.mappingCount(); } + + /** + * Returns the timeout executor used by this channel group. + * + * @return the timeout executor + */ + public ScheduledThreadPoolExecutor getTimeoutExecutor() { + return timeoutExecutor; + } } diff --git a/driver-core/src/main/com/mongodb/internal/operation/AggregateOperation.java b/driver-core/src/main/com/mongodb/internal/operation/AggregateOperation.java index f50304480b5..1f25bc87bf9 100644 --- a/driver-core/src/main/com/mongodb/internal/operation/AggregateOperation.java +++ b/driver-core/src/main/com/mongodb/internal/operation/AggregateOperation.java @@ -34,7 +34,7 @@ import static com.mongodb.internal.connection.CommandHelper.applyMaxTimeMS; import static com.mongodb.internal.operation.ExplainHelper.asExplainCommand; -import static com.mongodb.internal.operation.ServerVersionHelper.MIN_WIRE_VERSION; +import static com.mongodb.internal.operation.ServerVersionHelper.UNKNOWN_WIRE_VERSION; /** * An operation that executes an aggregation query. @@ -157,7 +157,7 @@ public AsyncReadOperation asAsyncExplainableOperation(@Nullable final Exp CommandReadOperation createExplainableOperation(@Nullable final ExplainVerbosity verbosity, final Decoder resultDecoder) { return new CommandReadOperation<>(getNamespace().getDatabaseName(), (operationContext, serverDescription, connectionDescription) -> { - BsonDocument command = wrapped.getCommand(operationContext, MIN_WIRE_VERSION); + BsonDocument command = wrapped.getCommand(operationContext, UNKNOWN_WIRE_VERSION); applyMaxTimeMS(operationContext.getTimeoutContext(), command); return asExplainCommand(command, verbosity); }, resultDecoder); diff --git a/driver-core/src/main/com/mongodb/internal/operation/ChangeStreamBatchCursorHelper.java b/driver-core/src/main/com/mongodb/internal/operation/ChangeStreamBatchCursorHelper.java index 7cfdd474dda..1bed2ed2b0f 100644 --- a/driver-core/src/main/com/mongodb/internal/operation/ChangeStreamBatchCursorHelper.java +++ b/driver-core/src/main/com/mongodb/internal/operation/ChangeStreamBatchCursorHelper.java @@ -35,7 +35,7 @@ final class ChangeStreamBatchCursorHelper { @VisibleForTesting(otherwise = PRIVATE) static final List RETRYABLE_SERVER_ERROR_CODES = - asList(6, 7, 63, 89, 91, 133, 150, 189, 234, 262, 9001, 10107, 11600, 11602, 13388, 13435, 13436); + asList(6, 7, 63, 89, 91, 133, 134, 150, 189, 234, 262, 9001, 10107, 11600, 11602, 13388, 13435, 13436); @VisibleForTesting(otherwise = PRIVATE) static final String RESUMABLE_CHANGE_STREAM_ERROR_LABEL = "ResumableChangeStreamError"; diff --git a/driver-core/src/main/com/mongodb/internal/operation/CommandOperationHelper.java b/driver-core/src/main/com/mongodb/internal/operation/CommandOperationHelper.java index 2861bcf9ad5..db6870f52e8 100644 --- a/driver-core/src/main/com/mongodb/internal/operation/CommandOperationHelper.java +++ b/driver-core/src/main/com/mongodb/internal/operation/CommandOperationHelper.java @@ -127,7 +127,7 @@ static RetryState initialRetryState(final boolean retry, final TimeoutContext ti return RetryState.withNonRetryableState(); } - private static final List RETRYABLE_ERROR_CODES = asList(6, 7, 89, 91, 189, 262, 9001, 13436, 13435, 11602, 11600, 10107); + private static final List RETRYABLE_ERROR_CODES = asList(6, 7, 89, 91, 134, 189, 262, 9001, 13436, 13435, 11602, 11600, 10107); static boolean isRetryableException(final Throwable t) { if (!(t instanceof MongoException)) { return false; diff --git a/driver-core/src/main/com/mongodb/internal/operation/FindOperation.java b/driver-core/src/main/com/mongodb/internal/operation/FindOperation.java index abdbc328a14..4f834bee349 100644 --- a/driver-core/src/main/com/mongodb/internal/operation/FindOperation.java +++ b/driver-core/src/main/com/mongodb/internal/operation/FindOperation.java @@ -56,7 +56,7 @@ import static com.mongodb.internal.operation.OperationHelper.canRetryRead; import static com.mongodb.internal.operation.OperationHelper.setNonTailableCursorMaxTimeSupplier; import static com.mongodb.internal.operation.OperationReadConcernHelper.appendReadConcernToCommand; -import static com.mongodb.internal.operation.ServerVersionHelper.MIN_WIRE_VERSION; +import static com.mongodb.internal.operation.ServerVersionHelper.UNKNOWN_WIRE_VERSION; import static com.mongodb.internal.operation.SyncOperationHelper.CommandReadTransformer; import static com.mongodb.internal.operation.SyncOperationHelper.createReadCommandAndExecute; import static com.mongodb.internal.operation.SyncOperationHelper.decorateReadWithRetries; @@ -366,7 +366,7 @@ public AsyncReadOperation asAsyncExplainableOperation(@Nullable final Exp CommandReadOperation createExplainableOperation(@Nullable final ExplainVerbosity verbosity, final Decoder resultDecoder) { return new CommandReadOperation<>(getNamespace().getDatabaseName(), (operationContext, serverDescription, connectionDescription) -> { - BsonDocument command = getCommand(operationContext, MIN_WIRE_VERSION); + BsonDocument command = getCommand(operationContext, UNKNOWN_WIRE_VERSION); applyMaxTimeMS(operationContext.getTimeoutContext(), command); return asExplainCommand(command, verbosity); }, resultDecoder); @@ -390,7 +390,12 @@ private BsonDocument getCommand(final OperationContext operationContext, final i if (batchSize < 0 && Math.abs(batchSize) < limit) { commandDocument.put("limit", new BsonInt32(Math.abs(batchSize))); } else if (batchSize != 0) { - commandDocument.put("batchSize", new BsonInt32(Math.abs(batchSize))); + int effectiveBatchSize = Math.abs(batchSize); + if (effectiveBatchSize == limit) { + // avoid an open cursor on server side when batchSize and limit are equal + effectiveBatchSize++; + } + commandDocument.put("batchSize", new BsonInt32(effectiveBatchSize)); } } if (limit < 0 || batchSize < 0) { diff --git a/driver-core/src/main/com/mongodb/internal/operation/OperationHelper.java b/driver-core/src/main/com/mongodb/internal/operation/OperationHelper.java index b7a4997e639..f980d309a8a 100644 --- a/driver-core/src/main/com/mongodb/internal/operation/OperationHelper.java +++ b/driver-core/src/main/com/mongodb/internal/operation/OperationHelper.java @@ -46,7 +46,6 @@ import static com.mongodb.assertions.Assertions.assertNotNull; import static com.mongodb.internal.operation.ServerVersionHelper.serverIsLessThanVersionFourDotFour; -import static com.mongodb.internal.operation.ServerVersionHelper.serverIsLessThanVersionFourDotTwo; import static java.lang.String.format; /** @@ -70,10 +69,6 @@ private static void validateArrayFilters(final WriteConcern writeConcern) { private static void validateWriteRequestHint(final ConnectionDescription connectionDescription, final WriteConcern writeConcern, final WriteRequest request) { if (!writeConcern.isAcknowledged()) { - if (request instanceof UpdateRequest && serverIsLessThanVersionFourDotTwo(connectionDescription)) { - throw new IllegalArgumentException(format("Hint not supported by wire version: %s", - connectionDescription.getMaxWireVersion())); - } if (request instanceof DeleteRequest && serverIsLessThanVersionFourDotFour(connectionDescription)) { throw new IllegalArgumentException(format("Hint not supported by wire version: %s", connectionDescription.getMaxWireVersion())); @@ -82,10 +77,6 @@ private static void validateWriteRequestHint(final ConnectionDescription connect } static void validateHintForFindAndModify(final ConnectionDescription connectionDescription, final WriteConcern writeConcern) { - if (serverIsLessThanVersionFourDotTwo(connectionDescription)) { - throw new IllegalArgumentException(format("Hint not supported by wire version: %s", - connectionDescription.getMaxWireVersion())); - } if (!writeConcern.isAcknowledged() && serverIsLessThanVersionFourDotFour(connectionDescription)) { throw new IllegalArgumentException(format("Hint not supported by wire version: %s", connectionDescription.getMaxWireVersion())); diff --git a/driver-core/src/main/com/mongodb/internal/operation/ServerVersionHelper.java b/driver-core/src/main/com/mongodb/internal/operation/ServerVersionHelper.java index 68a03410832..093d48e3781 100644 --- a/driver-core/src/main/com/mongodb/internal/operation/ServerVersionHelper.java +++ b/driver-core/src/main/com/mongodb/internal/operation/ServerVersionHelper.java @@ -24,23 +24,19 @@ */ public final class ServerVersionHelper { - public static final int MIN_WIRE_VERSION = 0; - public static final int FOUR_DOT_ZERO_WIRE_VERSION = 7; + public static final int UNKNOWN_WIRE_VERSION = 0; public static final int FOUR_DOT_TWO_WIRE_VERSION = 8; public static final int FOUR_DOT_FOUR_WIRE_VERSION = 9; - public static final int FIVE_DOT_ZERO_WIRE_VERSION = 12; + public static final int FIVE_DOT_ZERO_WIRE_VERSION = 13; public static final int SIX_DOT_ZERO_WIRE_VERSION = 17; public static final int SEVEN_DOT_ZERO_WIRE_VERSION = 21; - public static final int LATEST_WIRE_VERSION = SEVEN_DOT_ZERO_WIRE_VERSION; + public static final int EIGHT_DOT_ZERO_WIRE_VERSION = 25; + public static final int LATEST_WIRE_VERSION = EIGHT_DOT_ZERO_WIRE_VERSION; public static boolean serverIsAtLeastVersionFourDotFour(final ConnectionDescription description) { return description.getMaxWireVersion() >= FOUR_DOT_FOUR_WIRE_VERSION; } - public static boolean serverIsLessThanVersionFourDotTwo(final ConnectionDescription description) { - return description.getMaxWireVersion() < FOUR_DOT_TWO_WIRE_VERSION; - } - public static boolean serverIsLessThanVersionFourDotFour(final ConnectionDescription description) { return description.getMaxWireVersion() < FOUR_DOT_FOUR_WIRE_VERSION; } diff --git a/driver-core/src/main/com/mongodb/internal/time/Timeout.java b/driver-core/src/main/com/mongodb/internal/time/Timeout.java index 85b92d9fde1..3dba42e580f 100644 --- a/driver-core/src/main/com/mongodb/internal/time/Timeout.java +++ b/driver-core/src/main/com/mongodb/internal/time/Timeout.java @@ -22,7 +22,7 @@ import com.mongodb.internal.function.CheckedRunnable; import com.mongodb.internal.function.CheckedSupplier; import com.mongodb.lang.Nullable; -import org.jetbrains.annotations.NotNull; +import com.mongodb.lang.NonNull; import java.util.Arrays; import java.util.Collections; @@ -82,7 +82,7 @@ static Timeout nullAsInfinite(@Nullable final Timeout timeout) { * @param zeroSemantics what to interpret a 0 duration as (infinite or expired) * @return a timeout that expires in the specified duration after now. */ - @NotNull + @NonNull static Timeout expiresIn(final long duration, final TimeUnit unit, final ZeroSemantics zeroSemantics) { if (duration < 0) { throw new AssertionError("Timeouts must not be in the past"); diff --git a/driver-core/src/test/functional/com/mongodb/client/model/AggregatesFunctionalSpecification.groovy b/driver-core/src/test/functional/com/mongodb/client/model/AggregatesFunctionalSpecification.groovy index 82c63393e7e..388736a9a82 100644 --- a/driver-core/src/test/functional/com/mongodb/client/model/AggregatesFunctionalSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/client/model/AggregatesFunctionalSpecification.groovy @@ -1336,7 +1336,8 @@ class AggregatesFunctionalSpecification extends OperationFunctionalSpecification [1, 2, 3, 4, 1, 2, 3, 4, 4.1] 'num' | 'partitionId' | densify(field, partitionRangeWithStep(1), densifyOptions().partitionByFields([partitionByField])) | [1, 2, 3, 4.1] - 'date' | null | densify(field, rangeWithStep(Instant.EPOCH, Instant.ofEpochMilli(BigInteger.TWO.pow(32).longValueExact()) + 1, + 'date' | null | densify(field, rangeWithStep(Instant.EPOCH, Instant.ofEpochMilli(BigInteger.TWO.pow(32).longValueExact()) + .plusMillis(1), // there is a server bug that prevents using `step` larger than 2^31 - 1 in versions before 6.1 BigInteger.TWO.pow(31).longValueExact() - 1, MongoTimeUnit.MILLISECOND)) | [Instant.EPOCH, diff --git a/driver-core/src/test/functional/com/mongodb/connection/netty/NettyStreamSpecification.groovy b/driver-core/src/test/functional/com/mongodb/connection/netty/NettyStreamSpecification.groovy index 012ba23e339..e582e0fc398 100644 --- a/driver-core/src/test/functional/com/mongodb/connection/netty/NettyStreamSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/connection/netty/NettyStreamSpecification.groovy @@ -13,7 +13,7 @@ import io.netty.channel.nio.NioEventLoopGroup import io.netty.channel.socket.nio.NioSocketChannel import spock.lang.IgnoreIf import spock.lang.Specification -import util.spock.annotations.Slow +import com.mongodb.spock.Slow import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit diff --git a/driver-core/src/test/functional/com/mongodb/internal/capi/MongoCryptHelperTest.java b/driver-core/src/test/functional/com/mongodb/internal/capi/MongoCryptHelperTest.java index d76371775b9..832e0d5eeb3 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/capi/MongoCryptHelperTest.java +++ b/driver-core/src/test/functional/com/mongodb/internal/capi/MongoCryptHelperTest.java @@ -27,6 +27,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.concurrent.TimeUnit; import static com.mongodb.internal.capi.MongoCryptHelper.isMongocryptdSpawningDisabled; import static com.mongodb.internal.capi.MongoCryptHelper.validateRewrapManyDataKeyOptions; @@ -94,6 +95,11 @@ public void createsExpectedMongoCryptOptionsUsingAutoEncryptionSettings() { assertMongoCryptOptions(mongoCryptOptionsBuilder.build(), mongoCryptOptions); + // Ensure can set key expiration + autoEncryptionSettingsBuilder.keyExpiration(10L, TimeUnit.SECONDS); + mongoCryptOptions = MongoCryptHelper.createMongoCryptOptions(autoEncryptionSettingsBuilder.build()); + assertMongoCryptOptions(mongoCryptOptionsBuilder.keyExpirationMS(10_000L).build(), mongoCryptOptions); + // Ensure search Paths is empty when bypassAutoEncryption is true autoEncryptionSettingsBuilder.bypassAutoEncryption(true); mongoCryptOptions = MongoCryptHelper.createMongoCryptOptions(autoEncryptionSettingsBuilder.build()); @@ -143,5 +149,6 @@ void assertMongoCryptOptions(final MongoCryptOptions expected, final MongoCryptO assertEquals(expected.getSearchPaths(), actual.getSearchPaths(), "SearchPaths not equal"); assertEquals(expected.isBypassQueryAnalysis(), actual.isBypassQueryAnalysis(), "isBypassQueryAnalysis not equal"); assertEquals(expected.isNeedsKmsCredentialsStateEnabled(), actual.isNeedsKmsCredentialsStateEnabled(), "isNeedsKmsCredentialsStateEnabled not equal"); + assertEquals(expected.getKeyExpirationMS(), actual.getKeyExpirationMS(), "keyExpirationMS not equal"); } } diff --git a/driver-core/src/test/functional/com/mongodb/internal/connection/AsyncSocketChannelStreamSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/connection/AsyncSocketChannelStreamSpecification.groovy index 0ac6b8fd9df..85f23350984 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/connection/AsyncSocketChannelStreamSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/connection/AsyncSocketChannelStreamSpecification.groovy @@ -9,7 +9,7 @@ import com.mongodb.connection.SslSettings import com.mongodb.spi.dns.InetAddressResolver import spock.lang.IgnoreIf import spock.lang.Specification -import util.spock.annotations.Slow +import com.mongodb.spock.Slow import java.util.concurrent.CountDownLatch diff --git a/driver-core/src/test/functional/com/mongodb/internal/connection/AsyncStreamTimeoutsSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/connection/AsyncStreamTimeoutsSpecification.groovy index 6efe88806e8..3589362b8ac 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/connection/AsyncStreamTimeoutsSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/connection/AsyncStreamTimeoutsSpecification.groovy @@ -26,7 +26,7 @@ import com.mongodb.connection.ServerId import com.mongodb.connection.SocketSettings import com.mongodb.internal.connection.netty.NettyStreamFactory import spock.lang.IgnoreIf -import util.spock.annotations.Slow +import com.mongodb.spock.Slow import java.util.concurrent.TimeUnit diff --git a/driver-core/src/test/functional/com/mongodb/internal/connection/ClientMetadataHelperProseTest.java b/driver-core/src/test/functional/com/mongodb/internal/connection/ClientMetadataHelperProseTest.java index c4069ab0660..3adafc3a945 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/connection/ClientMetadataHelperProseTest.java +++ b/driver-core/src/test/functional/com/mongodb/internal/connection/ClientMetadataHelperProseTest.java @@ -47,7 +47,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows; /** - * See spec + * See spec * *

* NOTE: This class also contains tests that aren't categorized as Prose tests. @@ -175,16 +175,32 @@ public void test08NotLambda() { }); } + @Test + public void test09ValidContainerAndFaasProvider() { + withWrapper() + .withEnvironmentVariable("AWS_EXECUTION_ENV", "AWS_Lambda_java8") + .withEnvironmentVariable("AWS_REGION", "us-east-2") + .withEnvironmentVariable("AWS_LAMBDA_FUNCTION_MEMORY_SIZE", "1024") + .withEnvironmentVariable("KUBERNETES_SERVICE_HOST", "1") + .run(() -> { + BsonDocument expected = createExpectedClientMetadataDocument(APP_NAME); + expected.put("env", BsonDocument.parse("{'name': 'aws.lambda', 'memory_mb': 1024, 'region': 'us-east-2', 'container': {'orchestrator': 'kubernetes'}}")); + BsonDocument actual = createActualClientMetadataDocument(); + assertEquals(expected, actual); + + performHello(); + }); + } + // Additional tests, not specified as prose tests: @Test void testKubernetesMetadataIncluded() { withWrapper() - .withEnvironmentVariable("AWS_EXECUTION_ENV", "AWS_Lambda_java8") .withEnvironmentVariable("KUBERNETES_SERVICE_HOST", "kubernetes.default.svc.cluster.local") .run(() -> { BsonDocument expected = createExpectedClientMetadataDocument(APP_NAME); - expected.put("env", BsonDocument.parse("{'name': 'aws.lambda', 'container': {'orchestrator': 'kubernetes'}}")); + expected.put("env", BsonDocument.parse("{'container': {'orchestrator': 'kubernetes'}}")); BsonDocument actual = createActualClientMetadataDocument(); assertEquals(expected, actual); @@ -199,10 +215,9 @@ void testDockerMetadataIncluded() { pathsMockedStatic.when(() -> Files.exists(path)).thenReturn(true); withWrapper() - .withEnvironmentVariable("AWS_EXECUTION_ENV", "AWS_Lambda_java8") .run(() -> { BsonDocument expected = createExpectedClientMetadataDocument(APP_NAME); - expected.put("env", BsonDocument.parse("{'name': 'aws.lambda', 'container': {'runtime': 'docker'}}")); + expected.put("env", BsonDocument.parse("{'container': {'runtime': 'docker'}}")); BsonDocument actual = createActualClientMetadataDocument(); assertEquals(expected, actual); @@ -218,12 +233,10 @@ void testDockerAndKubernetesMetadataIncluded() { pathsMockedStatic.when(() -> Files.exists(path)).thenReturn(true); withWrapper() - .withEnvironmentVariable("AWS_EXECUTION_ENV", "AWS_Lambda_java8") .withEnvironmentVariable("KUBERNETES_SERVICE_HOST", "kubernetes.default.svc.cluster.local") .run(() -> { BsonDocument expected = createExpectedClientMetadataDocument(APP_NAME); - expected.put("env", BsonDocument.parse("{'name': 'aws.lambda', 'container': {'runtime': 'docker', " - + "'orchestrator': 'kubernetes'}}")); + expected.put("env", BsonDocument.parse("{'container': {'runtime': 'docker', 'orchestrator': 'kubernetes'}}")); BsonDocument actual = createActualClientMetadataDocument(); assertEquals(expected, actual); diff --git a/driver-core/src/test/functional/com/mongodb/internal/connection/StreamSocketAddressSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/connection/StreamSocketAddressSpecification.groovy index 42886648a2c..0283ce44f7b 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/connection/StreamSocketAddressSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/connection/StreamSocketAddressSpecification.groovy @@ -8,7 +8,7 @@ import com.mongodb.spi.dns.InetAddressResolver import spock.lang.Ignore import spock.lang.IgnoreIf import spock.lang.Specification -import util.spock.annotations.Slow +import com.mongodb.spock.Slow import javax.net.SocketFactory import java.util.concurrent.TimeUnit diff --git a/driver-core/src/test/functional/com/mongodb/internal/connection/TlsChannelStreamFunctionalTest.java b/driver-core/src/test/functional/com/mongodb/internal/connection/TlsChannelStreamFunctionalTest.java new file mode 100644 index 00000000000..3f80fcddfa3 --- /dev/null +++ b/driver-core/src/test/functional/com/mongodb/internal/connection/TlsChannelStreamFunctionalTest.java @@ -0,0 +1,150 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.mongodb.internal.connection; + +import com.mongodb.MongoSocketOpenException; +import com.mongodb.ServerAddress; +import com.mongodb.connection.SocketSettings; +import com.mongodb.connection.SslSettings; +import com.mongodb.internal.TimeoutContext; +import com.mongodb.internal.TimeoutSettings; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.mockito.MockedStatic; +import org.mockito.Mockito; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; + +import java.io.IOException; +import java.net.ServerSocket; +import java.nio.channels.InterruptedByTimeoutException; +import java.nio.channels.SocketChannel; +import java.util.concurrent.TimeUnit; + +import static com.mongodb.internal.connection.OperationContext.simpleOperationContext; +import static java.lang.String.format; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import static org.mockito.Mockito.atLeast; +import static org.mockito.Mockito.verify; + +class TlsChannelStreamFunctionalTest { + private static final SslSettings SSL_SETTINGS = SslSettings.builder().enabled(true).build(); + private static final String UNREACHABLE_PRIVATE_IP_ADDRESS = "10.255.255.1"; + private static final int UNREACHABLE_PORT = 65333; + + @ParameterizedTest + @ValueSource(ints = {500, 1000, 2000}) + void shouldInterruptConnectionEstablishmentWhenConnectionTimeoutExpires(final int connectTimeoutMs) throws IOException { + //given + try (StreamFactoryFactory streamFactoryFactory = new TlsChannelStreamFactoryFactory(new DefaultInetAddressResolver()); + MockedStatic socketChannelMockedStatic = Mockito.mockStatic(SocketChannel.class)) { + SingleResultSpyCaptor singleResultSpyCaptor = new SingleResultSpyCaptor<>(); + socketChannelMockedStatic.when(SocketChannel::open).thenAnswer(singleResultSpyCaptor); + + StreamFactory streamFactory = streamFactoryFactory.create(SocketSettings.builder() + .connectTimeout(connectTimeoutMs, TimeUnit.MILLISECONDS) + .build(), SSL_SETTINGS); + + Stream stream = streamFactory.create(new ServerAddress(UNREACHABLE_PRIVATE_IP_ADDRESS, UNREACHABLE_PORT)); + long connectOpenStart = System.nanoTime(); + + //when + OperationContext operationContext = createOperationContext(connectTimeoutMs); + MongoSocketOpenException mongoSocketOpenException = assertThrows(MongoSocketOpenException.class, () -> + stream.open(operationContext)); + + //then + long elapsedMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - connectOpenStart); + // Allow for some timing imprecision due to test overhead. + int maximumAcceptableTimeoutOvershoot = 300; + + assertInstanceOf(InterruptedByTimeoutException.class, mongoSocketOpenException.getCause()); + assertFalse(connectTimeoutMs > elapsedMs, + format("Connection timed-out sooner than expected. ConnectTimeoutMS: %d, elapsedMs: %d", connectTimeoutMs, elapsedMs)); + assertTrue(elapsedMs - connectTimeoutMs <= maximumAcceptableTimeoutOvershoot, + format("Connection timeout overshoot time %d ms should be within %d ms", elapsedMs - connectTimeoutMs, + maximumAcceptableTimeoutOvershoot)); + + SocketChannel actualSpySocketChannel = singleResultSpyCaptor.getResult(); + assertNotNull(actualSpySocketChannel, "SocketChannel was not opened"); + verify(actualSpySocketChannel, atLeast(1)).close(); + } + } + + @ParameterizedTest + @ValueSource(ints = {0, 500, 1000, 2000}) + void shouldEstablishConnection(final int connectTimeoutMs) throws IOException, InterruptedException { + //given + try (StreamFactoryFactory streamFactoryFactory = new TlsChannelStreamFactoryFactory(new DefaultInetAddressResolver()); + MockedStatic socketChannelMockedStatic = Mockito.mockStatic(SocketChannel.class); + ServerSocket serverSocket = new ServerSocket(0, 1)) { + SingleResultSpyCaptor singleResultSpyCaptor = new SingleResultSpyCaptor<>(); + socketChannelMockedStatic.when(SocketChannel::open).thenAnswer(singleResultSpyCaptor); + + StreamFactory streamFactory = streamFactoryFactory.create(SocketSettings.builder() + .connectTimeout(connectTimeoutMs, TimeUnit.MILLISECONDS) + .build(), SSL_SETTINGS); + + Stream stream = streamFactory.create(new ServerAddress(serverSocket.getInetAddress(), serverSocket.getLocalPort())); + try { + //when + stream.open(createOperationContext(connectTimeoutMs)); + + //then + SocketChannel actualSpySocketChannel = singleResultSpyCaptor.getResult(); + assertNotNull(actualSpySocketChannel, "SocketChannel was not opened"); + assertTrue(actualSpySocketChannel.isConnected()); + + // Wait to verify that socket was not closed by timeout. + MILLISECONDS.sleep(connectTimeoutMs * 2L); + assertTrue(actualSpySocketChannel.isConnected()); + assertFalse(stream.isClosed()); + } finally { + stream.close(); + } + } + } + + private static final class SingleResultSpyCaptor implements Answer { + private volatile T result = null; + + public T getResult() { + return result; + } + + @Override + public T answer(final InvocationOnMock invocationOnMock) throws Throwable { + if (result != null) { + fail(invocationOnMock.getMethod().getName() + " was called more then once"); + } + @SuppressWarnings("unchecked") + T returnedValue = (T) invocationOnMock.callRealMethod(); + result = Mockito.spy(returnedValue); + return result; + } + } + + private static OperationContext createOperationContext(final int connectTimeoutMs) { + return simpleOperationContext(new TimeoutContext(TimeoutSettings.DEFAULT.withConnectTimeoutMS(connectTimeoutMs))); + } +} diff --git a/driver-core/src/test/functional/com/mongodb/internal/operation/AggregateOperationSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/operation/AggregateOperationSpecification.groovy index a3e309a1f5f..1f6d0f99e55 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/operation/AggregateOperationSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/operation/AggregateOperationSpecification.groovy @@ -65,7 +65,7 @@ import static com.mongodb.ExplainVerbosity.QUERY_PLANNER import static com.mongodb.connection.ServerType.STANDALONE import static com.mongodb.internal.connection.ServerHelper.waitForLastRelease import static com.mongodb.internal.operation.OperationReadConcernHelper.appendReadConcernToCommand -import static com.mongodb.internal.operation.ServerVersionHelper.MIN_WIRE_VERSION +import static com.mongodb.internal.operation.ServerVersionHelper.UNKNOWN_WIRE_VERSION class AggregateOperationSpecification extends OperationFunctionalSpecification { @@ -197,6 +197,7 @@ class AggregateOperationSpecification extends OperationFunctionalSpecification { doc.remove('_id') doc.remove('clusterTime') doc.remove('wallTime') + doc.remove('collectionUUID') doc } nextDoc == expected @@ -386,7 +387,7 @@ class AggregateOperationSpecification extends OperationFunctionalSpecification { def commandDocument = new BsonDocument('aggregate', new BsonString(getCollectionName())) .append('pipeline', new BsonArray()) .append('cursor', new BsonDocument()) - appendReadConcernToCommand(operationContext.getSessionContext(), MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(operationContext.getSessionContext(), UNKNOWN_WIRE_VERSION, commandDocument) def operation = new AggregateOperation(getNamespace(), [], new DocumentCodec()) @@ -427,7 +428,7 @@ class AggregateOperationSpecification extends OperationFunctionalSpecification { def commandDocument = new BsonDocument('aggregate', new BsonString(getCollectionName())) .append('pipeline', new BsonArray()) .append('cursor', new BsonDocument()) - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) def operation = new AggregateOperation(getNamespace(), [], new DocumentCodec()) diff --git a/driver-core/src/test/functional/com/mongodb/internal/operation/ChangeStreamOperationProseTestSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/operation/ChangeStreamOperationProseTestSpecification.groovy index f403d4b053b..7e3a66f9a1f 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/operation/ChangeStreamOperationProseTestSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/operation/ChangeStreamOperationProseTestSpecification.groovy @@ -42,7 +42,7 @@ import static com.mongodb.ClusterFixture.serverVersionLessThan import static com.mongodb.internal.connection.ServerHelper.waitForLastRelease import static java.util.Arrays.asList -// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.rst#prose-tests +// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.md#prose-tests @IgnoreIf({ !(serverVersionAtLeast(3, 6) && !isStandalone()) }) class ChangeStreamOperationProseTestSpecification extends OperationFunctionalSpecification { diff --git a/driver-core/src/test/functional/com/mongodb/internal/operation/ChangeStreamOperationSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/operation/ChangeStreamOperationSpecification.groovy index 34187b34e62..48ce1ae6888 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/operation/ChangeStreamOperationSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/operation/ChangeStreamOperationSpecification.groovy @@ -209,6 +209,8 @@ class ChangeStreamOperationSpecification extends OperationFunctionalSpecificatio waitForLastRelease(getCluster()) } + // TODO undo skip and update for JAVA-5835 + @IgnoreIf({ !serverVersionLessThan(8, 2) }) def 'should decode update to ChangeStreamDocument '() { given: def helper = getHelper() @@ -787,6 +789,7 @@ class ChangeStreamOperationSpecification extends OperationFunctionalSpecificatio doc.remove('_id') doc.remove('clusterTime') doc.remove('wallTime') + doc.remove('collectionUUID') doc } } diff --git a/driver-core/src/test/functional/com/mongodb/internal/operation/CommandOperationSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/operation/CommandOperationSpecification.groovy index a9f74ca50b3..57aee534fd0 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/operation/CommandOperationSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/operation/CommandOperationSpecification.groovy @@ -23,7 +23,7 @@ import org.bson.BsonDocument import org.bson.BsonInt32 import org.bson.BsonString import org.bson.codecs.BsonDocumentCodec -import util.spock.annotations.Slow +import com.mongodb.spock.Slow class CommandOperationSpecification extends OperationFunctionalSpecification { diff --git a/driver-core/src/test/functional/com/mongodb/internal/operation/CountDocumentsOperationSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/operation/CountDocumentsOperationSpecification.groovy index 26d7d11bc6e..564b2f96e26 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/operation/CountDocumentsOperationSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/operation/CountDocumentsOperationSpecification.groovy @@ -50,7 +50,7 @@ import static com.mongodb.ClusterFixture.getBinding import static com.mongodb.ClusterFixture.serverVersionAtLeast import static com.mongodb.connection.ServerType.STANDALONE import static com.mongodb.internal.operation.OperationReadConcernHelper.appendReadConcernToCommand -import static com.mongodb.internal.operation.ServerVersionHelper.MIN_WIRE_VERSION +import static com.mongodb.internal.operation.ServerVersionHelper.UNKNOWN_WIRE_VERSION class CountDocumentsOperationSpecification extends OperationFunctionalSpecification { @@ -274,7 +274,7 @@ class CountDocumentsOperationSpecification extends OperationFunctionalSpecificat def commandDocument = new BsonDocument('aggregate', new BsonString(getCollectionName())) .append('pipeline', pipeline) .append('cursor', new BsonDocument()) - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) def operation = new CountDocumentsOperation(getNamespace()) @@ -314,7 +314,7 @@ class CountDocumentsOperationSpecification extends OperationFunctionalSpecificat def commandDocument = new BsonDocument('aggregate', new BsonString(getCollectionName())) .append('pipeline', pipeline) .append('cursor', new BsonDocument()) - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) def operation = new CountDocumentsOperation(getNamespace()) diff --git a/driver-core/src/test/functional/com/mongodb/internal/operation/DistinctOperationSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/operation/DistinctOperationSpecification.groovy index 587e05e1d0c..27f9507def4 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/operation/DistinctOperationSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/operation/DistinctOperationSpecification.groovy @@ -56,7 +56,7 @@ import static com.mongodb.ClusterFixture.executeAsync import static com.mongodb.ClusterFixture.serverVersionLessThan import static com.mongodb.connection.ServerType.STANDALONE import static com.mongodb.internal.operation.OperationReadConcernHelper.appendReadConcernToCommand -import static com.mongodb.internal.operation.ServerVersionHelper.MIN_WIRE_VERSION +import static com.mongodb.internal.operation.ServerVersionHelper.UNKNOWN_WIRE_VERSION import static org.bson.codecs.configuration.CodecRegistries.fromProviders class DistinctOperationSpecification extends OperationFunctionalSpecification { @@ -240,7 +240,7 @@ class DistinctOperationSpecification extends OperationFunctionalSpecification { source.operationContext >> operationContext def commandDocument = new BsonDocument('distinct', new BsonString(getCollectionName())) .append('key', new BsonString('str')) - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) def operation = new DistinctOperation(getNamespace(), 'str', new StringCodec()) @@ -279,7 +279,7 @@ class DistinctOperationSpecification extends OperationFunctionalSpecification { source.retain() >> source def commandDocument = new BsonDocument('distinct', new BsonString(getCollectionName())) .append('key', new BsonString('str')) - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) def operation = new DistinctOperation(getNamespace(), 'str', new StringCodec()) diff --git a/driver-core/src/test/functional/com/mongodb/internal/operation/FindOperationSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/operation/FindOperationSpecification.groovy index f70cac7b6ad..df1fae76bc4 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/operation/FindOperationSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/operation/FindOperationSpecification.groovy @@ -67,7 +67,7 @@ import static com.mongodb.CursorType.Tailable import static com.mongodb.CursorType.TailableAwait import static com.mongodb.connection.ServerType.STANDALONE import static com.mongodb.internal.operation.OperationReadConcernHelper.appendReadConcernToCommand -import static com.mongodb.internal.operation.ServerVersionHelper.MIN_WIRE_VERSION +import static com.mongodb.internal.operation.ServerVersionHelper.UNKNOWN_WIRE_VERSION import static org.junit.Assert.assertEquals class FindOperationSpecification extends OperationFunctionalSpecification { @@ -498,7 +498,7 @@ class FindOperationSpecification extends OperationFunctionalSpecification { source.retain() >> source source.operationContext >> operationContext def commandDocument = new BsonDocument('find', new BsonString(getCollectionName())) - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) def operation = new FindOperation(getNamespace(), new DocumentCodec()) @@ -538,7 +538,7 @@ class FindOperationSpecification extends OperationFunctionalSpecification { source.getConnection(_) >> { it[0].onResult(connection, null) } source.retain() >> source def commandDocument = new BsonDocument('find', new BsonString(getCollectionName())) - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) def operation = new FindOperation(getNamespace(), new DocumentCodec()) @@ -579,7 +579,7 @@ class FindOperationSpecification extends OperationFunctionalSpecification { source.retain() >> source source.operationContext >> operationContext def commandDocument = new BsonDocument('find', new BsonString(getCollectionName())).append('allowDiskUse', BsonBoolean.TRUE) - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) def operation = new FindOperation(getNamespace(), new DocumentCodec()).allowDiskUse(true) @@ -619,7 +619,7 @@ class FindOperationSpecification extends OperationFunctionalSpecification { source.getConnection(_) >> { it[0].onResult(connection, null) } source.retain() >> source def commandDocument = new BsonDocument('find', new BsonString(getCollectionName())).append('allowDiskUse', BsonBoolean.TRUE) - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) def operation = new FindOperation(getNamespace(), new DocumentCodec()).allowDiskUse(true) diff --git a/driver-core/src/test/functional/com/mongodb/internal/operation/MapReduceWithInlineResultsOperationSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/operation/MapReduceWithInlineResultsOperationSpecification.groovy index 3289f10f578..ece8045c578 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/operation/MapReduceWithInlineResultsOperationSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/operation/MapReduceWithInlineResultsOperationSpecification.groovy @@ -50,7 +50,7 @@ import static com.mongodb.ClusterFixture.executeAsync import static com.mongodb.ClusterFixture.serverVersionLessThan import static com.mongodb.connection.ServerType.STANDALONE import static com.mongodb.internal.operation.OperationReadConcernHelper.appendReadConcernToCommand -import static com.mongodb.internal.operation.ServerVersionHelper.MIN_WIRE_VERSION +import static com.mongodb.internal.operation.ServerVersionHelper.UNKNOWN_WIRE_VERSION class MapReduceWithInlineResultsOperationSpecification extends OperationFunctionalSpecification { private final bsonDocumentCodec = new BsonDocumentCodec() @@ -234,7 +234,7 @@ class MapReduceWithInlineResultsOperationSpecification extends OperationFunction "reduce" : { "$code" : "function(key, values){ }" }, "out" : { "inline" : 1 }, }''') - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) def operation = new MapReduceWithInlineResultsOperation(helper.namespace, new BsonJavaScript('function(){ }'), new BsonJavaScript('function(key, values){ }'), bsonDocumentCodec) @@ -283,7 +283,7 @@ class MapReduceWithInlineResultsOperationSpecification extends OperationFunction "reduce" : { "$code" : "function(key, values){ }" }, "out" : { "inline" : 1 }, }''') - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) def operation = new MapReduceWithInlineResultsOperation(helper.namespace, new BsonJavaScript('function(){ }'), new BsonJavaScript('function(key, values){ }'), bsonDocumentCodec) diff --git a/driver-core/src/test/functional/com/mongodb/internal/operation/MixedBulkWriteOperationSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/operation/MixedBulkWriteOperationSpecification.groovy index 9363f6a1812..6bdedf2ff60 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/operation/MixedBulkWriteOperationSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/operation/MixedBulkWriteOperationSpecification.groovy @@ -46,7 +46,7 @@ import org.bson.codecs.BsonDocumentCodec import org.bson.codecs.DocumentCodec import org.bson.types.ObjectId import spock.lang.IgnoreIf -import util.spock.annotations.Slow +import com.mongodb.spock.Slow import static com.mongodb.ClusterFixture.configureFailPoint import static com.mongodb.ClusterFixture.disableFailPoint diff --git a/driver-core/src/test/functional/com/mongodb/internal/operation/OperationReadConcernHelperSpecification.groovy b/driver-core/src/test/functional/com/mongodb/internal/operation/OperationReadConcernHelperSpecification.groovy index 75358db9e9c..331690a830b 100644 --- a/driver-core/src/test/functional/com/mongodb/internal/operation/OperationReadConcernHelperSpecification.groovy +++ b/driver-core/src/test/functional/com/mongodb/internal/operation/OperationReadConcernHelperSpecification.groovy @@ -24,14 +24,14 @@ import org.bson.BsonTimestamp import spock.lang.Specification import static com.mongodb.internal.operation.OperationReadConcernHelper.appendReadConcernToCommand -import static com.mongodb.internal.operation.ServerVersionHelper.MIN_WIRE_VERSION +import static com.mongodb.internal.operation.ServerVersionHelper.UNKNOWN_WIRE_VERSION class OperationReadConcernHelperSpecification extends Specification { def 'should throw IllegalArgumentException if command document is null'() { when: - appendReadConcernToCommand(Stub(SessionContext), MIN_WIRE_VERSION, null) + appendReadConcernToCommand(Stub(SessionContext), UNKNOWN_WIRE_VERSION, null) then: thrown(IllegalArgumentException) @@ -39,7 +39,7 @@ class OperationReadConcernHelperSpecification extends Specification { def 'should throw IllegalArgumentException if session context is null'() { when: - appendReadConcernToCommand(null, MIN_WIRE_VERSION, new BsonDocument()) + appendReadConcernToCommand(null, UNKNOWN_WIRE_VERSION, new BsonDocument()) then: thrown(IllegalArgumentException) @@ -56,7 +56,7 @@ class OperationReadConcernHelperSpecification extends Specification { def commandDocument = new BsonDocument() when: - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) then: commandDocument == new BsonDocument('readConcern', @@ -74,7 +74,7 @@ class OperationReadConcernHelperSpecification extends Specification { def commandDocument = new BsonDocument() when: - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) then: commandDocument == new BsonDocument('readConcern', @@ -91,7 +91,7 @@ class OperationReadConcernHelperSpecification extends Specification { def commandDocument = new BsonDocument() when: - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) then: commandDocument == new BsonDocument('readConcern', @@ -107,7 +107,7 @@ class OperationReadConcernHelperSpecification extends Specification { def commandDocument = new BsonDocument() when: - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) then: commandDocument == new BsonDocument() @@ -123,7 +123,7 @@ class OperationReadConcernHelperSpecification extends Specification { def commandDocument = new BsonDocument() when: - appendReadConcernToCommand(sessionContext, MIN_WIRE_VERSION, commandDocument) + appendReadConcernToCommand(sessionContext, UNKNOWN_WIRE_VERSION, commandDocument) then: commandDocument == new BsonDocument('readConcern', diff --git a/driver-core/src/test/resources/auth/legacy/connection-string.json b/driver-core/src/test/resources/auth/legacy/connection-string.json deleted file mode 100644 index dfed11656d4..00000000000 --- a/driver-core/src/test/resources/auth/legacy/connection-string.json +++ /dev/null @@ -1,656 +0,0 @@ -{ - "tests": [ - { - "description": "should use the default source and mechanism", - "uri": "mongodb://user:password@localhost", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "admin", - "mechanism": null, - "mechanism_properties": null - } - }, - { - "description": "should use the database when no authSource is specified", - "uri": "mongodb://user:password@localhost/foo", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "foo", - "mechanism": null, - "mechanism_properties": null - } - }, - { - "description": "should use the authSource when specified", - "uri": "mongodb://user:password@localhost/foo?authSource=bar", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "bar", - "mechanism": null, - "mechanism_properties": null - } - }, - { - "description": "should recognise the mechanism (GSSAPI)", - "uri": "mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI", - "valid": true, - "credential": { - "username": "user@DOMAIN.COM", - "password": null, - "source": "$external", - "mechanism": "GSSAPI", - "mechanism_properties": { - "SERVICE_NAME": "mongodb" - } - } - }, - { - "description": "should ignore the database (GSSAPI)", - "uri": "mongodb://user%40DOMAIN.COM@localhost/foo?authMechanism=GSSAPI", - "valid": true, - "credential": { - "username": "user@DOMAIN.COM", - "password": null, - "source": "$external", - "mechanism": "GSSAPI", - "mechanism_properties": { - "SERVICE_NAME": "mongodb" - } - } - }, - { - "description": "should accept valid authSource (GSSAPI)", - "uri": "mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authSource=$external", - "valid": true, - "credential": { - "username": "user@DOMAIN.COM", - "password": null, - "source": "$external", - "mechanism": "GSSAPI", - "mechanism_properties": { - "SERVICE_NAME": "mongodb" - } - } - }, - { - "description": "should accept generic mechanism property (GSSAPI)", - "uri": "mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true", - "valid": true, - "credential": { - "username": "user@DOMAIN.COM", - "password": null, - "source": "$external", - "mechanism": "GSSAPI", - "mechanism_properties": { - "SERVICE_NAME": "other", - "CANONICALIZE_HOST_NAME": true - } - } - }, - { - "description": "should accept the password (GSSAPI)", - "uri": "mongodb://user%40DOMAIN.COM:password@localhost/?authMechanism=GSSAPI&authSource=$external", - "valid": true, - "credential": { - "username": "user@DOMAIN.COM", - "password": "password", - "source": "$external", - "mechanism": "GSSAPI", - "mechanism_properties": { - "SERVICE_NAME": "mongodb" - } - } - }, - { - "description": "must raise an error when the authSource is empty", - "uri": "mongodb://user:password@localhost/foo?authSource=", - "valid": false - }, - { - "description": "must raise an error when the authSource is empty without credentials", - "uri": "mongodb://localhost/admin?authSource=", - "valid": false - }, - { - "description": "should throw an exception if authSource is invalid (GSSAPI)", - "uri": "mongodb://user%40DOMAIN.COM@localhost/?authMechanism=GSSAPI&authSource=foo", - "valid": false - }, - { - "description": "should throw an exception if no username (GSSAPI)", - "uri": "mongodb://localhost/?authMechanism=GSSAPI", - "valid": false - }, - { - "description": "should recognize the mechanism (MONGODB-CR)", - "uri": "mongodb://user:password@localhost/?authMechanism=MONGODB-CR", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "admin", - "mechanism": "MONGODB-CR", - "mechanism_properties": null - } - }, - { - "description": "should use the database when no authSource is specified (MONGODB-CR)", - "uri": "mongodb://user:password@localhost/foo?authMechanism=MONGODB-CR", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "foo", - "mechanism": "MONGODB-CR", - "mechanism_properties": null - } - }, - { - "description": "should use the authSource when specified (MONGODB-CR)", - "uri": "mongodb://user:password@localhost/foo?authMechanism=MONGODB-CR&authSource=bar", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "bar", - "mechanism": "MONGODB-CR", - "mechanism_properties": null - } - }, - { - "description": "should throw an exception if no username is supplied (MONGODB-CR)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-CR", - "valid": false - }, - { - "description": "should recognize the mechanism (MONGODB-X509)", - "uri": "mongodb://CN%3DmyName%2COU%3DmyOrgUnit%2CO%3DmyOrg%2CL%3DmyLocality%2CST%3DmyState%2CC%3DmyCountry@localhost/?authMechanism=MONGODB-X509", - "valid": true, - "credential": { - "username": "CN=myName,OU=myOrgUnit,O=myOrg,L=myLocality,ST=myState,C=myCountry", - "password": null, - "source": "$external", - "mechanism": "MONGODB-X509", - "mechanism_properties": null - } - }, - { - "description": "should ignore the database (MONGODB-X509)", - "uri": "mongodb://CN%3DmyName%2COU%3DmyOrgUnit%2CO%3DmyOrg%2CL%3DmyLocality%2CST%3DmyState%2CC%3DmyCountry@localhost/foo?authMechanism=MONGODB-X509", - "valid": true, - "credential": { - "username": "CN=myName,OU=myOrgUnit,O=myOrg,L=myLocality,ST=myState,C=myCountry", - "password": null, - "source": "$external", - "mechanism": "MONGODB-X509", - "mechanism_properties": null - } - }, - { - "description": "should accept valid authSource (MONGODB-X509)", - "uri": "mongodb://CN%3DmyName%2COU%3DmyOrgUnit%2CO%3DmyOrg%2CL%3DmyLocality%2CST%3DmyState%2CC%3DmyCountry@localhost/?authMechanism=MONGODB-X509&authSource=$external", - "valid": true, - "credential": { - "username": "CN=myName,OU=myOrgUnit,O=myOrg,L=myLocality,ST=myState,C=myCountry", - "password": null, - "source": "$external", - "mechanism": "MONGODB-X509", - "mechanism_properties": null - } - }, - { - "description": "should recognize the mechanism with no username (MONGODB-X509)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-X509", - "valid": true, - "credential": { - "username": null, - "password": null, - "source": "$external", - "mechanism": "MONGODB-X509", - "mechanism_properties": null - } - }, - { - "description": "should recognize the mechanism with no username when auth source is explicitly specified (MONGODB-X509)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-X509&authSource=$external", - "valid": true, - "credential": { - "username": null, - "password": null, - "source": "$external", - "mechanism": "MONGODB-X509", - "mechanism_properties": null - } - }, - { - "description": "should throw an exception if supplied a password (MONGODB-X509)", - "uri": "mongodb://user:password@localhost/?authMechanism=MONGODB-X509", - "valid": false - }, - { - "description": "should throw an exception if authSource is invalid (MONGODB-X509)", - "uri": "mongodb://CN%3DmyName%2COU%3DmyOrgUnit%2CO%3DmyOrg%2CL%3DmyLocality%2CST%3DmyState%2CC%3DmyCountry@localhost/foo?authMechanism=MONGODB-X509&authSource=bar", - "valid": false - }, - { - "description": "should recognize the mechanism (PLAIN)", - "uri": "mongodb://user:password@localhost/?authMechanism=PLAIN", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "$external", - "mechanism": "PLAIN", - "mechanism_properties": null - } - }, - { - "description": "should use the database when no authSource is specified (PLAIN)", - "uri": "mongodb://user:password@localhost/foo?authMechanism=PLAIN", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "foo", - "mechanism": "PLAIN", - "mechanism_properties": null - } - }, - { - "description": "should use the authSource when specified (PLAIN)", - "uri": "mongodb://user:password@localhost/foo?authMechanism=PLAIN&authSource=bar", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "bar", - "mechanism": "PLAIN", - "mechanism_properties": null - } - }, - { - "description": "should throw an exception if no username (PLAIN)", - "uri": "mongodb://localhost/?authMechanism=PLAIN", - "valid": false - }, - { - "description": "should recognize the mechanism (SCRAM-SHA-1)", - "uri": "mongodb://user:password@localhost/?authMechanism=SCRAM-SHA-1", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "admin", - "mechanism": "SCRAM-SHA-1", - "mechanism_properties": null - } - }, - { - "description": "should use the database when no authSource is specified (SCRAM-SHA-1)", - "uri": "mongodb://user:password@localhost/foo?authMechanism=SCRAM-SHA-1", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "foo", - "mechanism": "SCRAM-SHA-1", - "mechanism_properties": null - } - }, - { - "description": "should accept valid authSource (SCRAM-SHA-1)", - "uri": "mongodb://user:password@localhost/foo?authMechanism=SCRAM-SHA-1&authSource=bar", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "bar", - "mechanism": "SCRAM-SHA-1", - "mechanism_properties": null - } - }, - { - "description": "should throw an exception if no username (SCRAM-SHA-1)", - "uri": "mongodb://localhost/?authMechanism=SCRAM-SHA-1", - "valid": false - }, - { - "description": "should recognize the mechanism (SCRAM-SHA-256)", - "uri": "mongodb://user:password@localhost/?authMechanism=SCRAM-SHA-256", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "admin", - "mechanism": "SCRAM-SHA-256", - "mechanism_properties": null - } - }, - { - "description": "should use the database when no authSource is specified (SCRAM-SHA-256)", - "uri": "mongodb://user:password@localhost/foo?authMechanism=SCRAM-SHA-256", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "foo", - "mechanism": "SCRAM-SHA-256", - "mechanism_properties": null - } - }, - { - "description": "should accept valid authSource (SCRAM-SHA-256)", - "uri": "mongodb://user:password@localhost/foo?authMechanism=SCRAM-SHA-256&authSource=bar", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "bar", - "mechanism": "SCRAM-SHA-256", - "mechanism_properties": null - } - }, - { - "description": "should throw an exception if no username (SCRAM-SHA-256)", - "uri": "mongodb://localhost/?authMechanism=SCRAM-SHA-256", - "valid": false - }, - { - "description": "URI with no auth-related info doesn't create credential", - "uri": "mongodb://localhost/", - "valid": true, - "credential": null - }, - { - "description": "database in URI path doesn't create credentials", - "uri": "mongodb://localhost/foo", - "valid": true, - "credential": null - }, - { - "description": "authSource without username doesn't create credential (default mechanism)", - "uri": "mongodb://localhost/?authSource=foo", - "valid": true, - "credential": null - }, - { - "description": "should throw an exception if no username provided (userinfo implies default mechanism)", - "uri": "mongodb://@localhost.com/", - "valid": false - }, - { - "description": "should throw an exception if no username/password provided (userinfo implies default mechanism)", - "uri": "mongodb://:@localhost.com/", - "valid": false - }, - { - "description": "should recognise the mechanism (MONGODB-AWS)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-AWS", - "valid": true, - "credential": { - "username": null, - "password": null, - "source": "$external", - "mechanism": "MONGODB-AWS", - "mechanism_properties": null - } - }, - { - "description": "should recognise the mechanism when auth source is explicitly specified (MONGODB-AWS)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-AWS&authSource=$external", - "valid": true, - "credential": { - "username": null, - "password": null, - "source": "$external", - "mechanism": "MONGODB-AWS", - "mechanism_properties": null - } - }, - { - "description": "should throw an exception if username and no password (MONGODB-AWS)", - "uri": "mongodb://user@localhost/?authMechanism=MONGODB-AWS", - "valid": false, - "credential": null - }, - { - "description": "should use username and password if specified (MONGODB-AWS)", - "uri": "mongodb://user%21%40%23%24%25%5E%26%2A%28%29_%2B:pass%21%40%23%24%25%5E%26%2A%28%29_%2B@localhost/?authMechanism=MONGODB-AWS", - "valid": true, - "credential": { - "username": "user!@#$%^&*()_+", - "password": "pass!@#$%^&*()_+", - "source": "$external", - "mechanism": "MONGODB-AWS", - "mechanism_properties": null - } - }, - { - "description": "should use username, password and session token if specified (MONGODB-AWS)", - "uri": "mongodb://user:password@localhost/?authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:token%21%40%23%24%25%5E%26%2A%28%29_%2B", - "valid": true, - "credential": { - "username": "user", - "password": "password", - "source": "$external", - "mechanism": "MONGODB-AWS", - "mechanism_properties": { - "AWS_SESSION_TOKEN": "token!@#$%^&*()_+" - } - } - }, - { - "description": "should recognise the mechanism with test environment (MONGODB-OIDC)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:test", - "valid": true, - "credential": { - "username": null, - "password": null, - "source": "$external", - "mechanism": "MONGODB-OIDC", - "mechanism_properties": { - "ENVIRONMENT": "test" - } - } - }, - { - "description": "should recognise the mechanism when auth source is explicitly specified and with environment (MONGODB-OIDC)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authSource=$external&authMechanismProperties=ENVIRONMENT:test", - "valid": true, - "credential": { - "username": null, - "password": null, - "source": "$external", - "mechanism": "MONGODB-OIDC", - "mechanism_properties": { - "ENVIRONMENT": "test" - } - } - }, - { - "description": "should throw an exception if supplied a password (MONGODB-OIDC)", - "uri": "mongodb://user:pass@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:test", - "valid": false, - "credential": null - }, - { - "description": "should throw an exception if username is specified for test (MONGODB-OIDC)", - "uri": "mongodb://principalName@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:test", - "valid": false, - "credential": null - }, - { - "description": "should throw an exception if specified environment is not supported (MONGODB-OIDC)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:invalid", - "valid": false, - "credential": null - }, - { - "description": "should throw an exception if neither environment nor callbacks specified (MONGODB-OIDC)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC", - "valid": false, - "credential": null - }, - { - "description": "should throw an exception when unsupported auth property is specified (MONGODB-OIDC)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=UnsupportedProperty:unexisted", - "valid": false, - "credential": null - }, - { - "description": "should recognise the mechanism with azure provider (MONGODB-OIDC)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:foo", - "valid": true, - "credential": { - "username": null, - "password": null, - "source": "$external", - "mechanism": "MONGODB-OIDC", - "mechanism_properties": { - "ENVIRONMENT": "azure", - "TOKEN_RESOURCE": "foo" - } - } - }, - { - "description": "should accept a username with azure provider (MONGODB-OIDC)", - "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:foo", - "valid": true, - "credential": { - "username": "user", - "password": null, - "source": "$external", - "mechanism": "MONGODB-OIDC", - "mechanism_properties": { - "ENVIRONMENT": "azure", - "TOKEN_RESOURCE": "foo" - } - } - }, - { - "description": "should accept a url-encoded TOKEN_RESOURCE (MONGODB-OIDC)", - "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:mongodb%3A%2F%2Ftest-cluster", - "valid": true, - "credential": { - "username": "user", - "password": null, - "source": "$external", - "mechanism": "MONGODB-OIDC", - "mechanism_properties": { - "ENVIRONMENT": "azure", - "TOKEN_RESOURCE": "mongodb://test-cluster" - } - } - }, - { - "description": "should accept an un-encoded TOKEN_RESOURCE (MONGODB-OIDC)", - "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:mongodb://test-cluster", - "valid": true, - "credential": { - "username": "user", - "password": null, - "source": "$external", - "mechanism": "MONGODB-OIDC", - "mechanism_properties": { - "ENVIRONMENT": "azure", - "TOKEN_RESOURCE": "mongodb://test-cluster" - } - } - }, - { - "description": "should handle a complicated url-encoded TOKEN_RESOURCE (MONGODB-OIDC)", - "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:abcd%25ef%3Ag%26hi", - "valid": true, - "credential": { - "username": "user", - "password": null, - "source": "$external", - "mechanism": "MONGODB-OIDC", - "mechanism_properties": { - "ENVIRONMENT": "azure", - "TOKEN_RESOURCE": "abcd%ef:g&hi" - } - } - }, - { - "description": "should url-encode a TOKEN_RESOURCE (MONGODB-OIDC)", - "uri": "mongodb://user@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:a$b", - "valid": true, - "credential": { - "username": "user", - "password": null, - "source": "$external", - "mechanism": "MONGODB-OIDC", - "mechanism_properties": { - "ENVIRONMENT": "azure", - "TOKEN_RESOURCE": "a$b" - } - } - }, - { - "description": "should accept a username and throw an error for a password with azure provider (MONGODB-OIDC)", - "uri": "mongodb://user:pass@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:foo", - "valid": false, - "credential": null - }, - { - "description": "should throw an exception if no token audience is given for azure provider (MONGODB-OIDC)", - "uri": "mongodb://username@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:azure", - "valid": false, - "credential": null - }, - { - "description": "should recognise the mechanism with gcp provider (MONGODB-OIDC)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:gcp,TOKEN_RESOURCE:foo", - "valid": true, - "credential": { - "username": null, - "password": null, - "source": "$external", - "mechanism": "MONGODB-OIDC", - "mechanism_properties": { - "ENVIRONMENT": "gcp", - "TOKEN_RESOURCE": "foo" - } - } - }, - { - "description": "should throw an error for a username and password with gcp provider (MONGODB-OIDC)", - "uri": "mongodb://user:pass@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:gcp,TOKEN_RESOURCE:foo", - "valid": false, - "credential": null - }, - { - "description": "should throw an error if not TOKEN_RESOURCE with gcp provider (MONGODB-OIDC)", - "uri": "mongodb://user:pass@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:gcp", - "valid": false, - "credential": null - }, - { - "description": "should recognise the mechanism with k8s provider (MONGODB-OIDC)", - "uri": "mongodb://localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:k8s", - "valid": true, - "credential": { - "username": null, - "password": null, - "source": "$external", - "mechanism": "MONGODB-OIDC", - "mechanism_properties": { - "ENVIRONMENT": "k8s" - } - } - }, - { - "description": "should throw an error for a username and password with k8s provider (MONGODB-OIDC)", - "uri": "mongodb://user:pass@localhost/?authMechanism=MONGODB-OIDC&authMechanismProperties=ENVIRONMENT:k8s", - "valid": false, - "credential": null - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-encrypted.json b/driver-core/src/test/resources/client-side-encryption-corpus/corpus-encrypted.json deleted file mode 100644 index 1b72aa8a390..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-encrypted.json +++ /dev/null @@ -1,9515 +0,0 @@ -{ - "_id": "client_side_encryption_corpus", - "altname_aws": "aws", - "altname_local": "local", - "aws_double_rand_auto_id": { - "kms": "aws", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAABchrWPF5OPeuFpk4tUV325TmoNpGW+L5iPSXcLQIr319WJFIp3EDy5QiAHBfz2rThI7imU4eLXndIUrsjM0S/vg==", - "subType": "06" - } - } - }, - "aws_double_rand_auto_altname": { - "kms": "aws", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAABga5hXFiFvH/wOr0wOHSHFWRZ4pEs/UCC1XJWf46Dod3GY9Ry5j1ZyzeHueJxc4Ym5M8UHKSmJuXmNo9m9ZnkiA==", - "subType": "06" - } - } - }, - "aws_double_rand_explicit_id": { - "kms": "aws", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAABjTYZbsro/YxLWBb88qPXEIDQdzY7UZyK4UaZZ8h62OTxp43Zp9j6WvOEzKhXt4oJPMxlAxyTdqO6MllX5bsDrw==", - "subType": "06" - } - } - }, - "aws_double_rand_explicit_altname": { - "kms": "aws", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAABqkyXdeS3aWH2tRFoKxsIIL3ZH05gkiAEbutrjrdfw0b110iPhuCCOb0gP/nX/NRNCg1kCFZ543Vu0xZ0BRXlvQ==", - "subType": "06" - } - } - }, - "aws_double_det_explicit_id": { - "kms": "aws", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$numberDouble": "1.234" } - }, - "aws_double_det_explicit_altname": { - "kms": "aws", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$numberDouble": "1.234" } - }, - "aws_string_rand_auto_id": { - "kms": "aws", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAACAsI5E0rVT8TpIONY3TnbRvIxUjKsiy9ynVd/fE7U1lndE7KR6dTzs8QWK13kdKxO+njKPeC2ObBX904QmJ65Sw==", - "subType": "06" - } - } - }, - "aws_string_rand_auto_altname": { - "kms": "aws", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAACgBE6J6MRxPSDe+gfJPL8nBvuEIRBYxNS/73LqBTDJYyN/lsHQ6UlFDT5B4EkIPmHPTe+UBMOhZQ1bsP+DK8Aog==", - "subType": "06" - } - } - }, - "aws_string_rand_explicit_id": { - "kms": "aws", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAACbdTVDBWn35M5caKZgLFoiSVeFGKRj5K/QtupKNc8/dPIyCE+/a4PU51G/YIzFpYmp91nLpyq7lD/eJ/V0q66Zw==", - "subType": "06" - } - } - }, - "aws_string_rand_explicit_altname": { - "kms": "aws", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAACa4O+kE2BaqM0E+yiBrbCuE0YEGTrZ7L/+SuWm9gN3UupxwAQpRfxXAuUCTc9u1CXnvL+ga+VJMcWD2bawnn/Rg==", - "subType": "06" - } - } - }, - "aws_string_det_auto_id": { - "kms": "aws", - "type": "string", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAACyvOW8NcqRkZYzujivwVmYptJkic27PWr3Nq3Yv5Njz8cJdoyesVaQan6mn+U3wdfGEH8zbUUISdCx5qgvXEpvw==", - "subType": "06" - } - } - }, - "aws_string_det_explicit_id": { - "kms": "aws", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAACyvOW8NcqRkZYzujivwVmYptJkic27PWr3Nq3Yv5Njz8cJdoyesVaQan6mn+U3wdfGEH8zbUUISdCx5qgvXEpvw==", - "subType": "06" - } - } - }, - "aws_string_det_explicit_altname": { - "kms": "aws", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAACyvOW8NcqRkZYzujivwVmYptJkic27PWr3Nq3Yv5Njz8cJdoyesVaQan6mn+U3wdfGEH8zbUUISdCx5qgvXEpvw==", - "subType": "06" - } - } - }, - "aws_object_rand_auto_id": { - "kms": "aws", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAADI+/afY6Eka8j1VNThWIeGkDZ7vo4/l66a01Z+lVUFFnVLeUV/nz9kM6uTTplNRUa+RXmNmwkoR/BHRnGc7wRNA==", - "subType": "06" - } - } - }, - "aws_object_rand_auto_altname": { - "kms": "aws", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAADzN4hVXWXKerhggRRtwWnDu2W2wQ5KIWb/X1WCZJKTjQSQ5LNHVasabBCa4U1q46PQ5pDDM1PkVjW6o+zzl/4xw==", - "subType": "06" - } - } - }, - "aws_object_rand_explicit_id": { - "kms": "aws", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAADhSs5zKFMuuux3fqFFuPito3N+bp5TgmkUtJtFXjmA/EnLuexGARvEeGUsMJ/n0VzKbbsiE8+AsUNY3o9YXutqQ==", - "subType": "06" - } - } - }, - "aws_object_rand_explicit_altname": { - "kms": "aws", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAADpj8MSov16h26bFDrHepsNkW+tOLOjRP7oj1Tnj75qZ+uqxxVkQ5B/t/Ihk5fikHTJGAcRBR5Vv6kJ/ulMaDnvQ==", - "subType": "06" - } - } - }, - "aws_object_det_explicit_id": { - "kms": "aws", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "x": { "$numberInt": "1" } } - }, - "aws_object_det_explicit_altname": { - "kms": "aws", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "x": { "$numberInt": "1" } } - }, - "aws_array_rand_auto_id": { - "kms": "aws", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAETWDOZ6zV39H2+W+BkwZIoxI3BNF6phKoiBZ9+i4T9uEoyU3TmoTPjuI0YNwR1v/p5/9rlVCG0KLZd16eeMb3zxZXjqh6IAJqfhsBQ7bzBYI=", - "subType": "06" - } - } - }, - "aws_array_rand_auto_altname": { - "kms": "aws", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAE1xeHbld2JjUiPB1k+xMZuIzNSai7mv1iusCswxKEfYCZ7YtR0GDQTxN4676CwhcodSDiysjgOxSFIGlptKCvl0k46LNq0EGypP9yWBLvdjQ=", - "subType": "06" - } - } - }, - "aws_array_rand_explicit_id": { - "kms": "aws", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAEFVa4U2uW65MGihhdOmpZFgnwGTs3VeN5TXXbXJ5cfm0CwXF3EPlzAVjy5WO/+lbvFufpQnIiLH59/kVygmwn+2P9zPNJnSGIJW9gaV8Vye8=", - "subType": "06" - } - } - }, - "aws_array_rand_explicit_altname": { - "kms": "aws", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAE11VXbfg7DJQ5/CB9XdBO0hCrxOkK3RrEjPGJ0FXlUo76IMna1uo+NVmDnM63CRlGE3/TEbZPpp0w0jn4vZLKvBmGr7o7WQusRY4jnRf5oH4=", - "subType": "06" - } - } - }, - "aws_array_det_explicit_id": { - "kms": "aws", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": [ - { "$numberInt": "1" }, - { "$numberInt": "2" }, - { "$numberInt": "3" } - ] - }, - "aws_array_det_explicit_altname": { - "kms": "aws", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": [ - { "$numberInt": "1" }, - { "$numberInt": "2" }, - { "$numberInt": "3" } - ] - }, - "aws_binData=00_rand_auto_id": { - "kms": "aws", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAFpZYSktIHzGLZ6mcBFxywICqxdurqLVJcQR34ngix5YIOOulCYEhBSDzzSEyixEPCuU6cEzeuafpZRHX4qgcr9Q==", - "subType": "06" - } - } - }, - "aws_binData=00_rand_auto_altname": { - "kms": "aws", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAFshzESR9SyR++9r2yeaEjJYScMDez414s8pZkB3C8ihDa+rsyaxNy4yrF7qNEWjFrdFaH7zD2LdlPx+TKZgROlg==", - "subType": "06" - } - } - }, - "aws_binData=00_rand_explicit_id": { - "kms": "aws", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAFpYwZRPDom7qyAe5WW/QNSq97/OYgRT8xUEaaR5pkbQEFd/Cwtl8Aib/3Bs1CT3MVaHVWna2u5Gcc4s/v18zLhg==", - "subType": "06" - } - } - }, - "aws_binData=00_rand_explicit_altname": { - "kms": "aws", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAFBq1RIU1YGHKAS1SAtS42fKtQBHQ/BCQzRutirNdvWlrXxF81LSaS7QgQyycZ2ePiOLsSm2vZS4xaQETeCgRC4g==", - "subType": "06" - } - } - }, - "aws_binData=00_det_auto_id": { - "kms": "aws", - "type": "binData=00", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAF6SJGmfD3hLVc4tLPm4v2zFuHoRxUDLumBR8Q0AlKK2nQPyvuHEPVBD3vQdDi+Q7PwFxmovJsHccr59VnzvpJeg==", - "subType": "06" - } - } - }, - "aws_binData=00_det_explicit_id": { - "kms": "aws", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAF6SJGmfD3hLVc4tLPm4v2zFuHoRxUDLumBR8Q0AlKK2nQPyvuHEPVBD3vQdDi+Q7PwFxmovJsHccr59VnzvpJeg==", - "subType": "06" - } - } - }, - "aws_binData=00_det_explicit_altname": { - "kms": "aws", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAF6SJGmfD3hLVc4tLPm4v2zFuHoRxUDLumBR8Q0AlKK2nQPyvuHEPVBD3vQdDi+Q7PwFxmovJsHccr59VnzvpJeg==", - "subType": "06" - } - } - }, - "aws_binData=04_rand_auto_id": { - "kms": "aws", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAFM5685zqlM8pc3xubtCFuf724g/bWXsebpNzw5E5HrxUqSBBVOvjs3IJH74+Supe169qejY358nOG41mLZvO2wJByvT14qmgUGpgBaLaxPR0=", - "subType": "06" - } - } - }, - "aws_binData=04_rand_auto_altname": { - "kms": "aws", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAFfLqOzpfjz/XYHDLnliUAA5ehi6s+OIjvrLa59ubqEf8DuoCEWlO13Dl8X42IBB4hoSsO2RUeWtc9MeH4SdIUh/xJN3qS7qzjh/H+GvZRdAM=", - "subType": "06" - } - } - }, - "aws_binData=04_rand_explicit_id": { - "kms": "aws", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAFkmKfKAbz9tqVaiM9MRhYttiY3vgDwXpdYLQ4uUgWX89KRayLADWortYL+Oq+roFhO3oiwB9vjeWGIdgbj5wSh/50JT/2Gs85TXFe1GFjfWs=", - "subType": "06" - } - } - }, - "aws_binData=04_rand_explicit_altname": { - "kms": "aws", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAFKbufv83ddN+07Q5Ocq0VxUEV+BesSrVM7Bol3cMlWjHi7P+MrdwhNEa94xlxlDwU3b+RD6kW+AuNEQ2byA3CX2JjZE1gHwN7l0ukXuqpD0A=", - "subType": "06" - } - } - }, - "aws_binData=04_det_auto_id": { - "kms": "aws", - "type": "binData=04", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAFlg7ceq9w/JMhHcNzQks6UrKYAffpUyeWuBIpcuLoB7YbFO61Dphseh77pzZbk3OvmveUq6EtCP2pmsq7hA+QV4hkv6BTn4m6wnXw6ss/qfE=", - "subType": "06" - } - } - }, - "aws_binData=04_det_explicit_id": { - "kms": "aws", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAFlg7ceq9w/JMhHcNzQks6UrKYAffpUyeWuBIpcuLoB7YbFO61Dphseh77pzZbk3OvmveUq6EtCP2pmsq7hA+QV4hkv6BTn4m6wnXw6ss/qfE=", - "subType": "06" - } - } - }, - "aws_binData=04_det_explicit_altname": { - "kms": "aws", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAFlg7ceq9w/JMhHcNzQks6UrKYAffpUyeWuBIpcuLoB7YbFO61Dphseh77pzZbk3OvmveUq6EtCP2pmsq7hA+QV4hkv6BTn4m6wnXw6ss/qfE=", - "subType": "06" - } - } - }, - "aws_undefined_rand_explicit_id": { - "kms": "aws", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$undefined": true } - }, - "aws_undefined_rand_explicit_altname": { - "kms": "aws", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$undefined": true } - }, - "aws_undefined_det_explicit_id": { - "kms": "aws", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$undefined": true } - }, - "aws_undefined_det_explicit_altname": { - "kms": "aws", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$undefined": true } - }, - "aws_objectId_rand_auto_id": { - "kms": "aws", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAHASE+V+LlkmwgF9QNjBK8QBvC973NaTMk6wbd57VB2EpQzrgxMtR5gYzVeqq4xaaHqrncyZCOIxDJkFlaim2NqA==", - "subType": "06" - } - } - }, - "aws_objectId_rand_auto_altname": { - "kms": "aws", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAHf/+9Qj/ozcDoUb8RNBnajU1d9hJ/6fE17IEZnw+ma6v5yH8LqZk9w3dtm6Sfw1unMhcMKrmIgs6kxqRWhNREJg==", - "subType": "06" - } - } - }, - "aws_objectId_rand_explicit_id": { - "kms": "aws", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAHzX8ejVLhoarQ5xgWsJitU/9eBm/Hlt2IIbZtS0SBc80qzkkWTaP9Zl9wrILH/Hwwx8RFnts855eKII3NJFa3BA==", - "subType": "06" - } - } - }, - "aws_objectId_rand_explicit_altname": { - "kms": "aws", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAHG5l6nUCY8f/6xO6TsPDrZHcdPRyMe3muMlY2DxHwv9GJNDR5Ne5VEAzUjnbgoy+B29SX4oY8cXJ6XhVz8mt3Eg==", - "subType": "06" - } - } - }, - "aws_objectId_det_auto_id": { - "kms": "aws", - "type": "objectId", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAHTMY2l+gY8glm4HeSsGfCSfOsTVTzYU8qnQV8iqEFHrO5SBJac59gv3N/jukMwAnt0j6vIIQrROkVetU24YY7sQ==", - "subType": "06" - } - } - }, - "aws_objectId_det_explicit_id": { - "kms": "aws", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAHTMY2l+gY8glm4HeSsGfCSfOsTVTzYU8qnQV8iqEFHrO5SBJac59gv3N/jukMwAnt0j6vIIQrROkVetU24YY7sQ==", - "subType": "06" - } - } - }, - "aws_objectId_det_explicit_altname": { - "kms": "aws", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAHTMY2l+gY8glm4HeSsGfCSfOsTVTzYU8qnQV8iqEFHrO5SBJac59gv3N/jukMwAnt0j6vIIQrROkVetU24YY7sQ==", - "subType": "06" - } - } - }, - "aws_bool_rand_auto_id": { - "kms": "aws", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAISm4UFt1HC2j0ObpTBg7SvF2Dq31i9To2ED4F3JcTihhq0fVzaSCsUz9VTJ0ziHmeNPNdfPPZO6qA/CDEZBO4jg==", - "subType": "06" - } - } - }, - "aws_bool_rand_auto_altname": { - "kms": "aws", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAIj93KeAa96DmZXdB8boFvW19jhJSMmtSs5ag5FDSkH8MdKG2d2VoBOdUlBrL+LHYELqeDHCszY7qCirvb5mIgZg==", - "subType": "06" - } - } - }, - "aws_bool_rand_explicit_id": { - "kms": "aws", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAIMbDFEuHIl5MNEsWnYLIand1vpK6EMv7Mso6qxrN4wHSVVwmxK+GCPgrKoUQsNuTssFWNCu0IhwrXOagDEfmlxw==", - "subType": "06" - } - } - }, - "aws_bool_rand_explicit_altname": { - "kms": "aws", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAIkIaWfmPdxgAV5Rtb6on6T0NGt9GPFDScQD5I/Ch0ngiTCCKceJOjU0ljd3YTgfWRA1p/MlMIV0I5YAWZXKTHlg==", - "subType": "06" - } - } - }, - "aws_bool_det_explicit_id": { - "kms": "aws", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": true - }, - "aws_bool_det_explicit_altname": { - "kms": "aws", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": true - }, - "aws_date_rand_auto_id": { - "kms": "aws", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAJz1VG4+QnQXEE+TGu/pzfPugGMVTiC1xnenG1ByRdPvsERVw9WComWl1tb9tt9oblD7H/q0y1+y8HevkDqohB2Q==", - "subType": "06" - } - } - }, - "aws_date_rand_auto_altname": { - "kms": "aws", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAJa1kI2mIIYWjf7zjf5dD9+psvAQpjZ3nnsoXA5upcIwEtZaC8bxKKHVpOLOP3rTbvT5EV6vLhXkferGoyaqd/8w==", - "subType": "06" - } - } - }, - "aws_date_rand_explicit_id": { - "kms": "aws", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAJ9Q5Xe4UuOLQTUwosk47A6xx40XJcNoICCNtKrHqsUYy0QLCFRc5v4nA0160BVghURizbUtX8iuIp11pnsDyRtA==", - "subType": "06" - } - } - }, - "aws_date_rand_explicit_altname": { - "kms": "aws", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAJkHOdUc/4U82wxWJZ0SYABkJjQqNApkH2Iy/5S+PoatPgynoeSFTU9FmAbuWV/gbtIfBiaCOIjlsdonl/gf9+5w==", - "subType": "06" - } - } - }, - "aws_date_det_auto_id": { - "kms": "aws", - "type": "date", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAJEEpQNsiqMWPqD4lhMkiOJHGE8FxOeYrKPiiAp/bZTrLKyCSS0ZL1WT9H3cGzxWPm5veihCjKqWhjatC/pjtzbQ==", - "subType": "06" - } - } - }, - "aws_date_det_explicit_id": { - "kms": "aws", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAJEEpQNsiqMWPqD4lhMkiOJHGE8FxOeYrKPiiAp/bZTrLKyCSS0ZL1WT9H3cGzxWPm5veihCjKqWhjatC/pjtzbQ==", - "subType": "06" - } - } - }, - "aws_date_det_explicit_altname": { - "kms": "aws", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAJEEpQNsiqMWPqD4lhMkiOJHGE8FxOeYrKPiiAp/bZTrLKyCSS0ZL1WT9H3cGzxWPm5veihCjKqWhjatC/pjtzbQ==", - "subType": "06" - } - } - }, - "aws_null_rand_explicit_id": { - "kms": "aws", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "aws_null_rand_explicit_altname": { - "kms": "aws", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "aws_null_det_explicit_id": { - "kms": "aws", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "aws_null_det_explicit_altname": { - "kms": "aws", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "aws_regex_rand_auto_id": { - "kms": "aws", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAALnhViSt3HqTDzyLN4mWO9srBU8TjRvPWsAJYfj/5sgI/yFuWdrggMs3Aq6G+K3tRrX3Yb+osy5CLiFCxq9WIvAA==", - "subType": "06" - } - } - }, - "aws_regex_rand_auto_altname": { - "kms": "aws", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAALbL2RS2tGQLBZ+6LtXLKAWFKcoKui+u4+gMIlFemLgpdO2eLqrMJB53ccqZImX8ons9UgAwDkiD68hWy8e7KHfg==", - "subType": "06" - } - } - }, - "aws_regex_rand_explicit_id": { - "kms": "aws", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAALa0+ftF6W/0Ul4J9VT/3chXFktE1o+OK4S14h2kyOqDVNA8yMKuyCK5nWl1yZvjJ76TuhEABte23oxcBP5QwalQ==", - "subType": "06" - } - } - }, - "aws_regex_rand_explicit_altname": { - "kms": "aws", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAALS4Yo9Fwk6OTx2CWdnObFT2L4rHngeIbdCyT4/YMJYd+jLU3mph14M1ptZZg+TBIgSPHq+BkvpRDifbMmOVr/Hg==", - "subType": "06" - } - } - }, - "aws_regex_det_auto_id": { - "kms": "aws", - "type": "regex", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAALpwNlokiTCUtTa2Kx9NVGvXR/aKPGhR5iaCT7nHEk4BOiZ9Kr4cRHdPCeZ7A+gjG4cKoT62sm3Fj1FwSOl8J8aQ==", - "subType": "06" - } - } - }, - "aws_regex_det_explicit_id": { - "kms": "aws", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAALpwNlokiTCUtTa2Kx9NVGvXR/aKPGhR5iaCT7nHEk4BOiZ9Kr4cRHdPCeZ7A+gjG4cKoT62sm3Fj1FwSOl8J8aQ==", - "subType": "06" - } - } - }, - "aws_regex_det_explicit_altname": { - "kms": "aws", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAALpwNlokiTCUtTa2Kx9NVGvXR/aKPGhR5iaCT7nHEk4BOiZ9Kr4cRHdPCeZ7A+gjG4cKoT62sm3Fj1FwSOl8J8aQ==", - "subType": "06" - } - } - }, - "aws_dbPointer_rand_auto_id": { - "kms": "aws", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAMfCVAnMNbRGsThnoVGb2KDsCIU2ehcPtebk/TFG4GZvEmculscLLih813lEz5NHS2sAXBn721EzUS7d0TKAPbmEYFwUBnijIQIPvUoUO8AQM=", - "subType": "06" - } - } - }, - "aws_dbPointer_rand_auto_altname": { - "kms": "aws", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAMvYJ5BtaMLVXV+qj85q5WqKRlzlHOBIIxZfUE/BBXUwqSTpJLdQQD++DDh6F2dtorBeYa3oUv2ef3ImASk5j23joU35Pm3Zt9Ci1pMNGodWs=", - "subType": "06" - } - } - }, - "aws_dbPointer_rand_explicit_id": { - "kms": "aws", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAMdsmYtPDw8kKjfB2kWfx5W1oNEkWWct1lRpesN303pUWsawDJpfBx40lg18So2X/g4yGIwpY3qfEKQZA4vCJeT+MTjhRXFjXA7eS/mxv8f3E=", - "subType": "06" - } - } - }, - "aws_dbPointer_rand_explicit_altname": { - "kms": "aws", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAM0hcvS5zmY3mlTp0SfME/rINlflF/sx2KvP0eJTdH+Uk0WHuTkFIJAza+bXvV/gB7iNC350qyzUX3M6NHx/9s/5yBpY8MawTZTZ7WCQIA+ZI=", - "subType": "06" - } - } - }, - "aws_dbPointer_det_auto_id": { - "kms": "aws", - "type": "dbPointer", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAMp4QxbaEOij66L+RtaMekrDSm6QbfJBTQ8lQFhxfq9n7SVuQ9Zwdy14Ja8tyI3cGgQzQ/73rHUJ3CKA4+OYr63skYUkkkdlHxUrIMd5j5woc=", - "subType": "06" - } - } - }, - "aws_dbPointer_det_explicit_id": { - "kms": "aws", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAMp4QxbaEOij66L+RtaMekrDSm6QbfJBTQ8lQFhxfq9n7SVuQ9Zwdy14Ja8tyI3cGgQzQ/73rHUJ3CKA4+OYr63skYUkkkdlHxUrIMd5j5woc=", - "subType": "06" - } - } - }, - "aws_dbPointer_det_explicit_altname": { - "kms": "aws", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAMp4QxbaEOij66L+RtaMekrDSm6QbfJBTQ8lQFhxfq9n7SVuQ9Zwdy14Ja8tyI3cGgQzQ/73rHUJ3CKA4+OYr63skYUkkkdlHxUrIMd5j5woc=", - "subType": "06" - } - } - }, - "aws_javascript_rand_auto_id": { - "kms": "aws", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAN3HzAC9BTD7Jgi0PR4RS/Z6L6QtAQ7VhbKRbX+1smmnYniH6jVBM6zyxMDM8h9YjMPNs8EJrGDnisuf33w5KI/A==", - "subType": "06" - } - } - }, - "aws_javascript_rand_auto_altname": { - "kms": "aws", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAANJpw+znlu3ecSiNyZ0EerVsow4aDRF2auI3Wy69EVexJkQlHO753PjRn8hG/x2kY8ROy5IUU43jaugP5AN1bwNQ==", - "subType": "06" - } - } - }, - "aws_javascript_rand_explicit_id": { - "kms": "aws", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAANzoDiq8uI0+l8COY8YdM9S3rpLvPOHOWmJqJNtOyS0ZXUx1SB5paRJ4W3Eg8KuXEeoFwvBDe9cW9YT66CzkjlBw==", - "subType": "06" - } - } - }, - "aws_javascript_rand_explicit_altname": { - "kms": "aws", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAN/JhtRongJweLC5SdrXHhsFz3p82q3cwXf8Sru21DK6S39S997y3uhVLn0xlX5d94PxK1XVYSjz1oVuMxZouZ7Q==", - "subType": "06" - } - } - }, - "aws_javascript_det_auto_id": { - "kms": "aws", - "type": "javascript", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAANE39aEGiuUZ1WyakVEBgkGzLp5whkIjJ4uiaFLXniRszJL70FRkcf+aFXlA5Y4So9/ODKF76qbSsH4Jk6L+3mog==", - "subType": "06" - } - } - }, - "aws_javascript_det_explicit_id": { - "kms": "aws", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAANE39aEGiuUZ1WyakVEBgkGzLp5whkIjJ4uiaFLXniRszJL70FRkcf+aFXlA5Y4So9/ODKF76qbSsH4Jk6L+3mog==", - "subType": "06" - } - } - }, - "aws_javascript_det_explicit_altname": { - "kms": "aws", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAANE39aEGiuUZ1WyakVEBgkGzLp5whkIjJ4uiaFLXniRszJL70FRkcf+aFXlA5Y4So9/ODKF76qbSsH4Jk6L+3mog==", - "subType": "06" - } - } - }, - "aws_symbol_rand_auto_id": { - "kms": "aws", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAOBv1T9tleM0xwNe7efg/MlShyzvXe3Pmg1GzPl3gjFRHZGWXR578KqX+8oiz65eXGzNuyOFvcpnR2gYCs3NeKeQfctO5plEiIva6nzCI5SK8=", - "subType": "06" - } - } - }, - "aws_symbol_rand_auto_altname": { - "kms": "aws", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAOwLgGws8CMh+GgkEJFAx8tDIflyjsgG+/1FmZZobKAg8NOKqfXjtbnNCbvR28OCk6g/8SqBm8m53G6JciwvthJ0DirdfEexiUqu7IPtaeeyw=", - "subType": "06" - } - } - }, - "aws_symbol_rand_explicit_id": { - "kms": "aws", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAORQi3dNkXzZeruWu19kEhDu6fFD/h47ILzk+OVKQMoriAQC5YFyVRp1yAkIaWsrsPcyCHlfZ99FySSQeqSYbZZNj5FqyonWvDuPTduHDy3CI=", - "subType": "06" - } - } - }, - "aws_symbol_rand_explicit_altname": { - "kms": "aws", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAOj+Yl1pQPiJ6mESOISOyUYsKN/VIvC8f0derhxIPakXkwn57U0sxv+geUkrl3JZDxY3+cX5M1JZmY+PfjaYQhbTorf9RZaVC2Wwo2lMftWi0=", - "subType": "06" - } - } - }, - "aws_symbol_det_auto_id": { - "kms": "aws", - "type": "symbol", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAO5IHripygBGEsVK8RFWZ1rIIVUap8KVDuqOspZpERaj+5ZEfqIcyrP/WK9KdvwOfdOWXfP/mOwuImYgNdbaQe+ejkYe4W0Y0uneCuw88k95Q=", - "subType": "06" - } - } - }, - "aws_symbol_det_explicit_id": { - "kms": "aws", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAO5IHripygBGEsVK8RFWZ1rIIVUap8KVDuqOspZpERaj+5ZEfqIcyrP/WK9KdvwOfdOWXfP/mOwuImYgNdbaQe+ejkYe4W0Y0uneCuw88k95Q=", - "subType": "06" - } - } - }, - "aws_symbol_det_explicit_altname": { - "kms": "aws", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAO5IHripygBGEsVK8RFWZ1rIIVUap8KVDuqOspZpERaj+5ZEfqIcyrP/WK9KdvwOfdOWXfP/mOwuImYgNdbaQe+ejkYe4W0Y0uneCuw88k95Q=", - "subType": "06" - } - } - }, - "aws_javascriptWithScope_rand_auto_id": { - "kms": "aws", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAPT31GSNkY1RM43miv1XPYtDX1vU/xORiM3U0pumjqA+JLU/HMhH++75OcMhcAQqMjm2nZtZScxdGJsJJPEEzqjbFNMJgYc9sqR5uLnzk+2dg=", - "subType": "06" - } - } - }, - "aws_javascriptWithScope_rand_auto_altname": { - "kms": "aws", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAPUxgaKAxSQ1uzOZtzsbtrxtDT2P/zWY6lYsbChXuRUooqvyjXSkNDqKBBA7Gp5BdGiVB/JLR47Tihpbcw1s1yGhwQRvnqeDvPrf91nvElXRY=", - "subType": "06" - } - } - }, - "aws_javascriptWithScope_rand_explicit_id": { - "kms": "aws", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAPv8W0ZtquFCLTG0TqvRjdzKa/4mvqT2FuEGQ0mXG2k2BZh2LY5APr/kgW0tP4eLjHzVld6OLiM9ZKAvENCZ6/fKOvqSwpIfkdLWUIeB4REQg=", - "subType": "06" - } - } - }, - "aws_javascriptWithScope_rand_explicit_altname": { - "kms": "aws", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAPMVhWjaxLffdAOkVgIJpjgNIldMS451NQs3C1jb+pzopHp3DlfZ+AHQpK9reMVVKjaqanhWBpL25q+feA60XVgZPCUDroiRYqMFqU//y0amw=", - "subType": "06" - } - } - }, - "aws_javascriptWithScope_det_explicit_id": { - "kms": "aws", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$code": "x=1", "$scope": {} } - }, - "aws_javascriptWithScope_det_explicit_altname": { - "kms": "aws", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$code": "x=1", "$scope": {} } - }, - "aws_int_rand_auto_id": { - "kms": "aws", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAQFV5b3vsoZe+MT4z8soetpmrWJpm7be41FNu/rdEqHWTG32jCym6762PCNYH5+vA7ldCWQkdt+ncneHsxzPrm9w==", - "subType": "06" - } - } - }, - "aws_int_rand_auto_altname": { - "kms": "aws", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAQY9+QenvU1Tk/dEGZP11uOZJLHAJ9hWHbEhxbtxItt1LsdU/8gOZfypilIO5BUkLT/15PUuXV28GISNh6yIuWhw==", - "subType": "06" - } - } - }, - "aws_int_rand_explicit_id": { - "kms": "aws", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAQruCugbneumhcinuXm89WW1PXVuSOewttp9cpsPPsCRVqe/uAkZOdJnZ2KaEZ9zki2GeqaJTs1qDmaJofc6GMEA==", - "subType": "06" - } - } - }, - "aws_int_rand_explicit_altname": { - "kms": "aws", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAQb15qXl/tejk4pmgkc4pUxzt4eJrv/cetgzgcPVaROAQSzd8ptbgCjaV8vP46uqozRoaDFZbQ06t65c3f0x/Ucw==", - "subType": "06" - } - } - }, - "aws_int_det_auto_id": { - "kms": "aws", - "type": "int", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAQCXo6ieWvfoqkG+rP7J2BV013AVf/oNMmmGWe44VEHahF+qZHzW5I/F2qIA+xgKkk172pFq0iTSOpe+K2WHMKFw==", - "subType": "06" - } - } - }, - "aws_int_det_explicit_id": { - "kms": "aws", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAQCXo6ieWvfoqkG+rP7J2BV013AVf/oNMmmGWe44VEHahF+qZHzW5I/F2qIA+xgKkk172pFq0iTSOpe+K2WHMKFw==", - "subType": "06" - } - } - }, - "aws_int_det_explicit_altname": { - "kms": "aws", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAAQCXo6ieWvfoqkG+rP7J2BV013AVf/oNMmmGWe44VEHahF+qZHzW5I/F2qIA+xgKkk172pFq0iTSOpe+K2WHMKFw==", - "subType": "06" - } - } - }, - "aws_timestamp_rand_auto_id": { - "kms": "aws", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAR63xXG8mrlixkQzD5VBIPE6NHicaWcS5CBhiIJDcZ0x8D9c5TgRJUfCeWhKvWFD4o0DoxcBQ2opPormFDpvmq/g==", - "subType": "06" - } - } - }, - "aws_timestamp_rand_auto_altname": { - "kms": "aws", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAARAgY9LsUxP6gP4gYRvvzZ4iaHVQRNbycATiVag1YNSiDmEr4LYserYuBscdrIy4v3zgGaulFM9KV86bx0ItycZA==", - "subType": "06" - } - } - }, - "aws_timestamp_rand_explicit_id": { - "kms": "aws", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAARLneAZqPcHdzGGnXz2Ne5E7HP9cDC1+yoIwcA8OSF/IlzEjrrMAi3z6Izol6gWDlD7VOh7QYL3sASJOXyzF1hPQ==", - "subType": "06" - } - } - }, - "aws_timestamp_rand_explicit_altname": { - "kms": "aws", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAARH2bU7KNo5SHxiO8JFEcT9wryuHNXyM7ADop1oPcESyay1Nc0WHPD3nr0yMAK481NxOkE3qXyaslu7bcP/744WA==", - "subType": "06" - } - } - }, - "aws_timestamp_det_auto_id": { - "kms": "aws", - "type": "timestamp", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAARG7kGfx0ky+d4Hl/fRBu8oUR1Mph26Dkv3J7fxGYanpzOFMiHIfVO0uwYMvsfzG54y0DDNlS3FmmS13DzepbzGQ==", - "subType": "06" - } - } - }, - "aws_timestamp_det_explicit_id": { - "kms": "aws", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAARG7kGfx0ky+d4Hl/fRBu8oUR1Mph26Dkv3J7fxGYanpzOFMiHIfVO0uwYMvsfzG54y0DDNlS3FmmS13DzepbzGQ==", - "subType": "06" - } - } - }, - "aws_timestamp_det_explicit_altname": { - "kms": "aws", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAARG7kGfx0ky+d4Hl/fRBu8oUR1Mph26Dkv3J7fxGYanpzOFMiHIfVO0uwYMvsfzG54y0DDNlS3FmmS13DzepbzGQ==", - "subType": "06" - } - } - }, - "aws_long_rand_auto_id": { - "kms": "aws", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAASZbes2EdR78crt2pXVElW2YwAQh8HEBapYYeav2VQeg2syXaV/qZuD8ofnAVn4v/DydTTMVMmK+sVU/TlnAu2eA==", - "subType": "06" - } - } - }, - "aws_long_rand_auto_altname": { - "kms": "aws", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAASt+7fmMYH+fLHgybc+sng8/UmKP3YPUEPCz1SXVQljQp6orsCILSgtgGPsdeGnN5NSxh3XzerHs6zlR92fWpZCw==", - "subType": "06" - } - } - }, - "aws_long_rand_explicit_id": { - "kms": "aws", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAS01fF1uo6zYDToJnOT/EbDipzk7YZ6I+IspZF+avjU3XYfpRxT9NdAgKr0euWJwyAsdpWqqCwFummfrPeZOy04A==", - "subType": "06" - } - } - }, - "aws_long_rand_explicit_altname": { - "kms": "aws", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAS6tpH796bqy58mXf38rJvVtA1uBcxBE5yIGQ4RN44oypc/pvw0ouhFI1dkoneKMtAFU/5RygZV+RvQhRtgKn76A==", - "subType": "06" - } - } - }, - "aws_long_det_auto_id": { - "kms": "aws", - "type": "long", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAASC7O/8JeB4WTqQFPuMpFRsAuonPS3yu7IAPZeRPIr03CmM6HNndYIKMoFM13eELNZTdJSgg9u9ItGqRw+/XMHzQ==", - "subType": "06" - } - } - }, - "aws_long_det_explicit_id": { - "kms": "aws", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAASC7O/8JeB4WTqQFPuMpFRsAuonPS3yu7IAPZeRPIr03CmM6HNndYIKMoFM13eELNZTdJSgg9u9ItGqRw+/XMHzQ==", - "subType": "06" - } - } - }, - "aws_long_det_explicit_altname": { - "kms": "aws", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQFkgAAAAAAAAAAAAAAAAAASC7O/8JeB4WTqQFPuMpFRsAuonPS3yu7IAPZeRPIr03CmM6HNndYIKMoFM13eELNZTdJSgg9u9ItGqRw+/XMHzQ==", - "subType": "06" - } - } - }, - "aws_decimal_rand_auto_id": { - "kms": "aws", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAATgf5zW9EgnWHPxj4HAGt472eN9UXP41TaF8V2J7S2zqSpiBZGKDuOIjw2FBSqaNp53vvfl9HpwAuQBJZhrwkBCKRkKV/AAR3/pTpuoqhSKaM=", - "subType": "06" - } - } - }, - "aws_decimal_rand_auto_altname": { - "kms": "aws", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAATPRfvZWdupE2N0W1DXUx7X8Zz7g43jawJL7PbQtTYetI78xRETkMdygwSEHgs+cvnUBBtYIeKRVkOGZQkwf568OclhDiPxUeD38cR5blBq/U=", - "subType": "06" - } - } - }, - "aws_decimal_rand_explicit_id": { - "kms": "aws", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAAT+ZnCg2lSMIohZ9RJ4CNs3LZ0g+nV04cYAmrxTSrTSBPGlZ7Ywh5A2rCss7AUijYZiKiYyZbuAzukbOuVRhdCtm+xo9+DyLAwTezF18okk6Y=", - "subType": "06" - } - } - }, - "aws_decimal_rand_explicit_altname": { - "kms": "aws", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgFkgAAAAAAAAAAAAAAAAAATlnQYASsTZRRHzFjcbCClXartcXBVRrYv7JImMkDmAj6EAjf/ZqpjeykkS/wohMhXaNwyZBdREr+n+GDV7imYoL4WRBOLnqB6hrYidlWqNzE=", - "subType": "06" - } - } - }, - "aws_decimal_det_explicit_id": { - "kms": "aws", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$numberDecimal": "1.234" } - }, - "aws_decimal_det_explicit_altname": { - "kms": "aws", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$numberDecimal": "1.234" } - }, - "aws_minKey_rand_explicit_id": { - "kms": "aws", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$minKey": 1 } - }, - "aws_minKey_rand_explicit_altname": { - "kms": "aws", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$minKey": 1 } - }, - "aws_minKey_det_explicit_id": { - "kms": "aws", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$minKey": 1 } - }, - "aws_minKey_det_explicit_altname": { - "kms": "aws", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$minKey": 1 } - }, - "aws_maxKey_rand_explicit_id": { - "kms": "aws", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$maxKey": 1 } - }, - "aws_maxKey_rand_explicit_altname": { - "kms": "aws", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$maxKey": 1 } - }, - "aws_maxKey_det_explicit_id": { - "kms": "aws", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$maxKey": 1 } - }, - "aws_maxKey_det_explicit_altname": { - "kms": "aws", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$maxKey": 1 } - }, - "local_double_rand_auto_id": { - "kms": "local", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAABGF195CB8nRmK9+KxYO7T96MeXucC/ILQtEEQAS4zrwj3Qz7YEQrf/apvbKTCkn3siN2XSDLQ/7dmddZa9xa9yQ==", - "subType": "06" - } - } - }, - "local_double_rand_auto_altname": { - "kms": "local", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAABY8g18z6ZOjGtfNxaAmU95tXMdoM6qbtDMpB72paqiHZTW1UGB22HPXiEnVz05JTBzzX4fc6tOldX6aJel812Zg==", - "subType": "06" - } - } - }, - "local_double_rand_explicit_id": { - "kms": "local", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAABDlHwN8hYyScEhhx64TdJ2Qp2rmKRg8983zdqIL1914tyPwRQq7ySCOhmFif2S7v4KT+r0uOfimYvKD1n9rKHlg==", - "subType": "06" - } - } - }, - "local_double_rand_explicit_altname": { - "kms": "local", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAB2VnTFlaCRzAZZTQiMWQORFNgXIuAJlHJXIHiYow2eO6JbVghWTpH+MsdafBNPVnc0zKuZBL0Qs2Nuk1xiQaqhA==", - "subType": "06" - } - } - }, - "local_double_det_explicit_id": { - "kms": "local", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$numberDouble": "1.234" } - }, - "local_double_det_explicit_altname": { - "kms": "local", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$numberDouble": "1.234" } - }, - "local_string_rand_auto_id": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAC5NBAPM8q2n9fnkwQfE9so/XcO51plPBNs5VlBRbDw68k9T6/uZ2TWsAvTYtVooY59zHHr2QS3usKbGQB6J61rA==", - "subType": "06" - } - } - }, - "local_string_rand_auto_altname": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACM/EjGMrkYHvSZra26m74upuvLkfKXTs+tTWquGzrgWYLnLt8I6XBIwx1VymS9EybrCU/ewmtgjLUNUFQacIeXA==", - "subType": "06" - } - } - }, - "local_string_rand_explicit_id": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACn4tD26UG8lO9gTZaxen6yXzHo/a2lokeY1ClxHMtJODoJr2JZzIDHP3A9aZ8L4+Vu+nyqphaWyGaGONKu8gpcQ==", - "subType": "06" - } - } - }, - "local_string_rand_explicit_altname": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACZfoO2LjY+IB31FZ1Tq7pHr0DCFKGJqWcXcOrnZ7bV9Euc9f101motJc31sp8nF5CTCfd83VQE0319eQrxDDaSw==", - "subType": "06" - } - } - }, - "local_string_det_auto_id": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACW0cZMYWOY3eoqQQkSdBtS9iHC4CSQA27dy6XJGcmTV8EDuhGNnPmbx0EKFTDb0PCSyCjMyuE4nsgmNYgjTaSuw==", - "subType": "06" - } - } - }, - "local_string_det_explicit_id": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACW0cZMYWOY3eoqQQkSdBtS9iHC4CSQA27dy6XJGcmTV8EDuhGNnPmbx0EKFTDb0PCSyCjMyuE4nsgmNYgjTaSuw==", - "subType": "06" - } - } - }, - "local_string_det_explicit_altname": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACW0cZMYWOY3eoqQQkSdBtS9iHC4CSQA27dy6XJGcmTV8EDuhGNnPmbx0EKFTDb0PCSyCjMyuE4nsgmNYgjTaSuw==", - "subType": "06" - } - } - }, - "local_object_rand_auto_id": { - "kms": "local", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAADlekcUsETAkkKTjCVx5EISJN+sftrQax/VhaWXLyRgRz97adXXmwZkMyt+035SHZsF91i2LaXziMA4RHoP+nKFw==", - "subType": "06" - } - } - }, - "local_object_rand_auto_altname": { - "kms": "local", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAADpaQmy5r6q9gLqEm+FIi/OyQgcuUnrICCP9rC4S3wR6qUHd82IW/3dFQUzwTkaXxgStjopamQMuZ4ESRj0xx0bA==", - "subType": "06" - } - } - }, - "local_object_rand_explicit_id": { - "kms": "local", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAADCHRJCINzWY0u4gZPWEmHg/JoQ8IW4yMfUyzYJCQrEMp4rUeupIuxqSuq2QyLBYZBBv0r7t3lNH49I5qDeav2vA==", - "subType": "06" - } - } - }, - "local_object_rand_explicit_altname": { - "kms": "local", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAADrHQQUnLF1jdNmFY/V266cS28XAB4nOKetHAcSbwkeUxNzgZT1g+XMQaYfcNMMv/ywypKU1KpgLMsEOpm4qcPkQ==", - "subType": "06" - } - } - }, - "local_object_det_explicit_id": { - "kms": "local", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "x": { "$numberInt": "1" } } - }, - "local_object_det_explicit_altname": { - "kms": "local", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "x": { "$numberInt": "1" } } - }, - "local_array_rand_auto_id": { - "kms": "local", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAEXa7bQ5vGPNsLdklM/H+sop8aCL4vlDiVUoVjTAGjTngn2WLcdKLWxaNSyMdJpsI/NsxQJ58YrcwP+yHzi9rZVtRdbg7m8p+CYcq1vUm6UoQ=", - "subType": "06" - } - } - }, - "local_array_rand_auto_altname": { - "kms": "local", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAEVlZlOvtRmGIhcYi/qPl3HKi/qf0yRQrkbVo9rScYkxDCBN9wA55pAWHDQ/5Sjy4d0DwL57k+M1G9e7xSIrv8xXKwoIuuabhSWaIX2eJHroY=", - "subType": "06" - } - } - }, - "local_array_rand_explicit_id": { - "kms": "local", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAEYBLSYHHt2rohezMF4lMjNdqy9CY33EHf+pgRbJwVXZScLDgn9CcqeRsdU8bW5h2qgNpQvoSMBB7pW+Dgp1RauTHZSOd4PcZpAGjwoFDWSSM=", - "subType": "06" - } - } - }, - "local_array_rand_explicit_altname": { - "kms": "local", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAES1IJ8S2NxWekolQockxLJvzFSGfKQ9Xbi55vO8LyWo0sIG9ZgPQXtVQkZ301CsdFduvx9A0vDqQ0MGYc4plxNnpUTizJPRUDyez5dOgZ9tI=", - "subType": "06" - } - } - }, - "local_array_det_explicit_id": { - "kms": "local", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": [ - { "$numberInt": "1" }, - { "$numberInt": "2" }, - { "$numberInt": "3" } - ] - }, - "local_array_det_explicit_altname": { - "kms": "local", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": [ - { "$numberInt": "1" }, - { "$numberInt": "2" }, - { "$numberInt": "3" } - ] - }, - "local_binData=00_rand_auto_id": { - "kms": "local", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAF+hgWs4ZCo9GnmhSM9SDSWzWX4E7Tlp4TwlEy3zfO/rrMREECGB4u8LD8Ju9b8YP+xcZhMI1tcz/vrQS87NffUg==", - "subType": "06" - } - } - }, - "local_binData=00_rand_auto_altname": { - "kms": "local", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAFtEvaXWpGfXC1GlKu0AeRDaeBKHryGoS0tAUr48vfYk7umCr+fJKyXCY9vSv7wCiQxWLe8V/EZWkHsu0zqhJw9w==", - "subType": "06" - } - } - }, - "local_binData=00_rand_explicit_id": { - "kms": "local", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAF/1L5bvmMX3Bk2nAw8KvvRd/7nZ82XHVasT0jrlPhSiJU7ehJMeUCOb7HCHU6KgCzZB9C2W3NoVhLKIhE9ZnYdg==", - "subType": "06" - } - } - }, - "local_binData=00_rand_explicit_altname": { - "kms": "local", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAFK0W5IWKzggR4UU+fhwA2p8YCHLfmx5y1OEtHc/9be9eEYTORACDmWY6207Vd4LhBJCedd+Q5qMm7NRZjjhyLEQ==", - "subType": "06" - } - } - }, - "local_binData=00_det_auto_id": { - "kms": "local", - "type": "binData=00", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAF1ofBnK9+ERP29P/i14GQ/y3muic6tNKY532zCkzQkJSktYCOeXS8DdY1DdaOP/asZWzPTdgwby6/iZcAxJU+xQ==", - "subType": "06" - } - } - }, - "local_binData=00_det_explicit_id": { - "kms": "local", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAF1ofBnK9+ERP29P/i14GQ/y3muic6tNKY532zCkzQkJSktYCOeXS8DdY1DdaOP/asZWzPTdgwby6/iZcAxJU+xQ==", - "subType": "06" - } - } - }, - "local_binData=00_det_explicit_altname": { - "kms": "local", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAF1ofBnK9+ERP29P/i14GQ/y3muic6tNKY532zCkzQkJSktYCOeXS8DdY1DdaOP/asZWzPTdgwby6/iZcAxJU+xQ==", - "subType": "06" - } - } - }, - "local_binData=04_rand_auto_id": { - "kms": "local", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAFxq38aA4k/tYHPwJFRK0pahlo/3zjCe3VHJRqURRA+04lbJCvdkQTawxWlf8o+3Pcetl1UcPTQigdYp5KbIkstuPstLbT+TZXHVD1os9LTRw=", - "subType": "06" - } - } - }, - "local_binData=04_rand_auto_altname": { - "kms": "local", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAFTXNWchCPmCSY0+AL22/kCBmAoDJDX5T18jpJHLdvZtHs0zwD64b9hLvfRK268BlNu4P37KDFE6LT0QzjG7brqzFJf3ZaadDCKeIw1q7DWQs=", - "subType": "06" - } - } - }, - "local_binData=04_rand_explicit_id": { - "kms": "local", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAF7XgMgKjQmWYWmobrYWKiGYCKsy5kTgVweFBuzvFISaZjFsq2hrZB2DwUaOeT6XUPH/Onrdjc3fNElf3FdQDHif4rt+1lh9jEX+nMbRw9i3s=", - "subType": "06" - } - } - }, - "local_binData=04_rand_explicit_altname": { - "kms": "local", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAFGoA/1H0waFLor6LbkUCLC2Wm9j/ZT7yifPbf0G7WvO0+gBLlffr3aJIQ9ik5vxPbmDDMCoYlbEYgb8i9I5tKC17WPhjVH2N2+4l9y7aEmS4=", - "subType": "06" - } - } - }, - "local_binData=04_det_auto_id": { - "kms": "local", - "type": "binData=04", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAFwO3hsD8ee/uwgUiHWem8fGe54LsTJWqgbRCacIe6sxrsyLT6EsVIqg4Sn7Ou+FC3WJbFld5kx8euLe/MHa8FGYjxD97z5j+rUx5tt3T6YbA=", - "subType": "06" - } - } - }, - "local_binData=04_det_explicit_id": { - "kms": "local", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAFwO3hsD8ee/uwgUiHWem8fGe54LsTJWqgbRCacIe6sxrsyLT6EsVIqg4Sn7Ou+FC3WJbFld5kx8euLe/MHa8FGYjxD97z5j+rUx5tt3T6YbA=", - "subType": "06" - } - } - }, - "local_binData=04_det_explicit_altname": { - "kms": "local", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAFwO3hsD8ee/uwgUiHWem8fGe54LsTJWqgbRCacIe6sxrsyLT6EsVIqg4Sn7Ou+FC3WJbFld5kx8euLe/MHa8FGYjxD97z5j+rUx5tt3T6YbA=", - "subType": "06" - } - } - }, - "local_undefined_rand_explicit_id": { - "kms": "local", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$undefined": true } - }, - "local_undefined_rand_explicit_altname": { - "kms": "local", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$undefined": true } - }, - "local_undefined_det_explicit_id": { - "kms": "local", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$undefined": true } - }, - "local_undefined_det_explicit_altname": { - "kms": "local", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$undefined": true } - }, - "local_objectId_rand_auto_id": { - "kms": "local", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAHfvxWRZOzfao3faE3RglL0IcDpBcNwqiGL5KgSokmRxWjjWeiel88Mbo5Plo0SswwNQ2H7C5GVG21L+UbvcW63g==", - "subType": "06" - } - } - }, - "local_objectId_rand_auto_altname": { - "kms": "local", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAHhd9lSOO7bHE7PM+Uxa2v3X1FF66IwyEr0wqnyTaOM+cHQLmec/RlEaRIQ1x2AiW7LwmmVgZ0xBMK9CMh0Lhbyw==", - "subType": "06" - } - } - }, - "local_objectId_rand_explicit_id": { - "kms": "local", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAHETwT9bo+JtboBVW/8GzzMQCpn22iiNJnlxYfyO45jvYJQRs29RRIouCsnFkmC7cfAO3GlVxv113euYjIO7AlAg==", - "subType": "06" - } - } - }, - "local_objectId_rand_explicit_altname": { - "kms": "local", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAHhsguAMBzQUFBAitpJDzKEaMDGUGfvCzmUUhf4rnp8xeall/p91TUudaSMcU11XEgJ0Mym4IbYRd8+TfUai0nvw==", - "subType": "06" - } - } - }, - "local_objectId_det_auto_id": { - "kms": "local", - "type": "objectId", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAH4ElF4AvQ+kkGfhadgKNy3GcYrDZPN6RpzaMYIhcCGDvC9W+cIS9dH1aJbPU7vTPmEZnnynPTDWjw3rAj2+9mOA==", - "subType": "06" - } - } - }, - "local_objectId_det_explicit_id": { - "kms": "local", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAH4ElF4AvQ+kkGfhadgKNy3GcYrDZPN6RpzaMYIhcCGDvC9W+cIS9dH1aJbPU7vTPmEZnnynPTDWjw3rAj2+9mOA==", - "subType": "06" - } - } - }, - "local_objectId_det_explicit_altname": { - "kms": "local", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAH4ElF4AvQ+kkGfhadgKNy3GcYrDZPN6RpzaMYIhcCGDvC9W+cIS9dH1aJbPU7vTPmEZnnynPTDWjw3rAj2+9mOA==", - "subType": "06" - } - } - }, - "local_bool_rand_auto_id": { - "kms": "local", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAIxGld4J/2vSWg5tjQulpkm9C6WeUcLbv2yfKRXPAbmLpv3u4Yrmr5qisJtqmDPTcb993WosvCYAh0UGW+zpsdEg==", - "subType": "06" - } - } - }, - "local_bool_rand_auto_altname": { - "kms": "local", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAIpUFPiS2uoW1Aqs0WQkBa201OBmsuJ8WUKcv5aBPASkcwfaw9qSWs3QrbEDR2GyoU4SeYOByCAQMzXCPoIYAFdQ==", - "subType": "06" - } - } - }, - "local_bool_rand_explicit_id": { - "kms": "local", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAIJuzu1a60meYlU3LMjw/7G4Vh/lqKopxdpGWoLXEmY/NoHgX6Fkv9iTwxv/Nv8rZwtawpFV+mQUG/6A1IHMBASQ==", - "subType": "06" - } - } - }, - "local_bool_rand_explicit_altname": { - "kms": "local", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAIn9VjxL5TdGgJLckNHRrIaL32L31q5OERRZG2M5OYKk66TnrlfEs+ykcDvGwMGKpr/PYjY5kBHDc/oELGJJbWRQ==", - "subType": "06" - } - } - }, - "local_bool_det_explicit_id": { - "kms": "local", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": true - }, - "local_bool_det_explicit_altname": { - "kms": "local", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": true - }, - "local_date_rand_auto_id": { - "kms": "local", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAJPPv4MC5xzt2uxPGBHH9g2z03o9SQjjmuxt97Ub1UcKCCHsGED3bx6YSrocuEMiFFI4d5Fqgl8HNeS4j0PR0tYA==", - "subType": "06" - } - } - }, - "local_date_rand_auto_altname": { - "kms": "local", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAJ6i2A9Hi4xWlOMjFMGpwaRctR1VFnb4El166n18RvjKic46V+WoadvLHS32RhPOvkLVYwIeU4C+vrO5isBNoUdw==", - "subType": "06" - } - } - }, - "local_date_rand_explicit_id": { - "kms": "local", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAJHcniV7Q0C8ZTWrE0hp5i5bUPlrrRdNLZckfODw8XNVtVPDjbznglccQmI7w1t8kOVp65eKzVzUOXN0YkqA+1QA==", - "subType": "06" - } - } - }, - "local_date_rand_explicit_altname": { - "kms": "local", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAJKCUCjC3hsmEKKYwGP3ceh3zR+ArE8LYFOQfN87aEsTr60VrzHXmsE8PvizRhhMnrp07ljzQkuat39L+0QSR2qQ==", - "subType": "06" - } - } - }, - "local_date_det_auto_id": { - "kms": "local", - "type": "date", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAJ1GMYQTruoKr6fv9XCbcVkx/3yivymPSMEkPCRDYxQv45w4TqBKMDfpRd1TOLOv1qvcb+gjH+z5IfVBMp2IpG/Q==", - "subType": "06" - } - } - }, - "local_date_det_explicit_id": { - "kms": "local", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAJ1GMYQTruoKr6fv9XCbcVkx/3yivymPSMEkPCRDYxQv45w4TqBKMDfpRd1TOLOv1qvcb+gjH+z5IfVBMp2IpG/Q==", - "subType": "06" - } - } - }, - "local_date_det_explicit_altname": { - "kms": "local", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAJ1GMYQTruoKr6fv9XCbcVkx/3yivymPSMEkPCRDYxQv45w4TqBKMDfpRd1TOLOv1qvcb+gjH+z5IfVBMp2IpG/Q==", - "subType": "06" - } - } - }, - "local_null_rand_explicit_id": { - "kms": "local", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "local_null_rand_explicit_altname": { - "kms": "local", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "local_null_det_explicit_id": { - "kms": "local", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "local_null_det_explicit_altname": { - "kms": "local", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "local_regex_rand_auto_id": { - "kms": "local", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAALXKw7zSgqQj1AKoWO0MoMxsBuu0cMB6KdJQCRKdupoLV/Y22owwsVpDDMv5sgUpkG5YIV+Fz7taHodXE07qHopw==", - "subType": "06" - } - } - }, - "local_regex_rand_auto_altname": { - "kms": "local", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAALntOLXq7VW1+jwba/dSbidMo2bewNo7AtK9A1CPwk9XrjUQaEOQxfRpho3BYQEo2U67fQdsY/tyhaj4jduHn9JQ==", - "subType": "06" - } - } - }, - "local_regex_rand_explicit_id": { - "kms": "local", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAALlMMG2iS/gEOEsVKR7sxBJP2IUzZ+aRbozDSkqADncresBvaPBSE17lng5NG7H1JRCAcP1rH/Te+0CrMd7JpRAQ==", - "subType": "06" - } - } - }, - "local_regex_rand_explicit_altname": { - "kms": "local", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAL1YNnlVu5+njDLxh1LMhIPOH19RykAXhxrUbCy6TI5MLQsAOSgAJbXOTXeKr0D8/Ff0phToWOKl193gOOIp8yZQ==", - "subType": "06" - } - } - }, - "local_regex_det_auto_id": { - "kms": "local", - "type": "regex", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAALiZbL5nFIZl7cSLH5E3wK3jJeAeFc7hLHNITtLAu+o10raEs5i/UCihMHmkf8KHZxghs056pfm5BjPzlL9x7IHQ==", - "subType": "06" - } - } - }, - "local_regex_det_explicit_id": { - "kms": "local", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAALiZbL5nFIZl7cSLH5E3wK3jJeAeFc7hLHNITtLAu+o10raEs5i/UCihMHmkf8KHZxghs056pfm5BjPzlL9x7IHQ==", - "subType": "06" - } - } - }, - "local_regex_det_explicit_altname": { - "kms": "local", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAALiZbL5nFIZl7cSLH5E3wK3jJeAeFc7hLHNITtLAu+o10raEs5i/UCihMHmkf8KHZxghs056pfm5BjPzlL9x7IHQ==", - "subType": "06" - } - } - }, - "local_dbPointer_rand_auto_id": { - "kms": "local", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAMUdAA9uOSk1tXJVe/CG3Ps6avYTEF1eHj1wSlCHkFxqlMtTO+rIQpikpjH0MrcXvEEdAO8g5hFZ01I7DWyK5AAxTxDqVF+kOaQ2VfKs6hyuo=", - "subType": "06" - } - } - }, - "local_dbPointer_rand_auto_altname": { - "kms": "local", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAMiNqvqLwZrPnsF235z+Obl1K9iEXdJ5GucMGpJdRG4lRvRE0Oy1vh6ztNTpYPY/tXyUFTBWlzl/lITalSEm/dT1Bnlh0iPAFrAiNySf662og=", - "subType": "06" - } - } - }, - "local_dbPointer_rand_explicit_id": { - "kms": "local", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAM+Tn31YcKiowBTJWRYCYAEO7UARDE2/jTVGEKXCpiwEqqP3JSAS0b80zYt8dxo5mVhUo2a02ClKrB8vs+B6sU1kXrahSaVSEHZlRSGN9fWgo=", - "subType": "06" - } - } - }, - "local_dbPointer_rand_explicit_altname": { - "kms": "local", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAMdOZZUvpJIqG9qiOLy5x4BdftyHipPDZn/eeLEc7ir3v4jJsY3dsv6fQERo5U9lMynNGA9PJePVzq5tWsIMX0EcCQcMfGmosfkYDzN1OX99A=", - "subType": "06" - } - } - }, - "local_dbPointer_det_auto_id": { - "kms": "local", - "type": "dbPointer", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAMQWace2C1w3yqtmo/rgz3YtIDnx1Ia/oDsoHnnMZlEy5RoK3uosi1hvNAZCSg3Sen0H7MH3XVhGGMCL4cS69uJ0ENSvh+K6fiZzAXCKUPfvM=", - "subType": "06" - } - } - }, - "local_dbPointer_det_explicit_id": { - "kms": "local", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAMQWace2C1w3yqtmo/rgz3YtIDnx1Ia/oDsoHnnMZlEy5RoK3uosi1hvNAZCSg3Sen0H7MH3XVhGGMCL4cS69uJ0ENSvh+K6fiZzAXCKUPfvM=", - "subType": "06" - } - } - }, - "local_dbPointer_det_explicit_altname": { - "kms": "local", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAMQWace2C1w3yqtmo/rgz3YtIDnx1Ia/oDsoHnnMZlEy5RoK3uosi1hvNAZCSg3Sen0H7MH3XVhGGMCL4cS69uJ0ENSvh+K6fiZzAXCKUPfvM=", - "subType": "06" - } - } - }, - "local_javascript_rand_auto_id": { - "kms": "local", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAANNL2AMKwTDyMIvxLKhBxZKx50C0tBdkLwuXmuMcrUqZeH8bsvjtttoM9LWkkileMyeTWgxblJ1b+uQ+V+4VT6fA==", - "subType": "06" - } - } - }, - "local_javascript_rand_auto_altname": { - "kms": "local", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAANBjBlHGw3K3TWQHpvfa1z0bKhNnVFC/lZArIexo3wjdGq3MdkGA5cuBIp87HHmOIv6o/pvQ9K74v48RQl+JH44A==", - "subType": "06" - } - } - }, - "local_javascript_rand_explicit_id": { - "kms": "local", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAANjvM7u3vNVyKpyI7g5kbzBpHPzXzOQToDSng5/c9yjMG+qi4TPtOyassobJOnMmDYBLyqRXCl/GsDLprbg5jxuA==", - "subType": "06" - } - } - }, - "local_javascript_rand_explicit_altname": { - "kms": "local", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAANMtO7KneuVx4gSOjX4MQjKL80zJhnt+efDBylkpNsqKyxBXB60nkiredGzwaK3/4QhIfGJrC1fQpwUwu/v1L17g==", - "subType": "06" - } - } - }, - "local_javascript_det_auto_id": { - "kms": "local", - "type": "javascript", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAANmQsg9E/BzGJVNVhSNyunS/TH0332oVFdPS6gjX0Cp/JC0YhB97DLz3N4e/q8ECaz7tTdQt9JacNUgxo+YCULUA==", - "subType": "06" - } - } - }, - "local_javascript_det_explicit_id": { - "kms": "local", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAANmQsg9E/BzGJVNVhSNyunS/TH0332oVFdPS6gjX0Cp/JC0YhB97DLz3N4e/q8ECaz7tTdQt9JacNUgxo+YCULUA==", - "subType": "06" - } - } - }, - "local_javascript_det_explicit_altname": { - "kms": "local", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAANmQsg9E/BzGJVNVhSNyunS/TH0332oVFdPS6gjX0Cp/JC0YhB97DLz3N4e/q8ECaz7tTdQt9JacNUgxo+YCULUA==", - "subType": "06" - } - } - }, - "local_symbol_rand_auto_id": { - "kms": "local", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAOOuO2b23mekwI8b6gWeEgRy1lLOCsNyBKvdmizK7/oOVKCvd+3kwUn9a6TxygooiVAN/Aohr1cjb8jRlMPWpkP0iO0+Tt6+vkizgFsQW4iio=", - "subType": "06" - } - } - }, - "local_symbol_rand_auto_altname": { - "kms": "local", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAOhN4QPOcmGnFKGvTfhz6TQleDA02X6oWULLHTnOUJYfE3OUSyf2ULEQh1yhdKdwXMuYVgGl28pMosiwkBShrXYe5ZlMjiZCIMZWSdUMV0tXk=", - "subType": "06" - } - } - }, - "local_symbol_rand_explicit_id": { - "kms": "local", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAO9aWi9RliwQHdXHoJME9VyN6XgyGd95Eclx+ZFYfLxBGAuUnPNjSfVuNZwYdyKC8JX79+mYhk7IXmcGV4z+4486sxyLk3idi4Kmpz2ESqV5g=", - "subType": "06" - } - } - }, - "local_symbol_rand_explicit_altname": { - "kms": "local", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAO/qev3DPfpkQoSW9aHOyalwfI/VYDQVN5VMINx4kw2vEqHiI1HRdZRPOz3q74TlQEy3TMNMTYdCvh5bpN/PptRZCTQbzP6ugz9dTp79w5/Ok=", - "subType": "06" - } - } - }, - "local_symbol_det_auto_id": { - "kms": "local", - "type": "symbol", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAOsg5cs6VpZWoTOFg4ztZmpj8kSTeCArVcI1Zz2pOnmMqNv/vcKQGhKSBbfniMripr7iuiYtlgkHGsdO2FqUp6Jb8NEWm5uWqdNU21zR9SRkE=", - "subType": "06" - } - } - }, - "local_symbol_det_explicit_id": { - "kms": "local", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAOsg5cs6VpZWoTOFg4ztZmpj8kSTeCArVcI1Zz2pOnmMqNv/vcKQGhKSBbfniMripr7iuiYtlgkHGsdO2FqUp6Jb8NEWm5uWqdNU21zR9SRkE=", - "subType": "06" - } - } - }, - "local_symbol_det_explicit_altname": { - "kms": "local", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAOsg5cs6VpZWoTOFg4ztZmpj8kSTeCArVcI1Zz2pOnmMqNv/vcKQGhKSBbfniMripr7iuiYtlgkHGsdO2FqUp6Jb8NEWm5uWqdNU21zR9SRkE=", - "subType": "06" - } - } - }, - "local_javascriptWithScope_rand_auto_id": { - "kms": "local", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAP5gLMvLOAc6vGAvC7bGmEC4eweptAiX3A7L0iCoHps/wm0FBLkfpF6F4pCjVYiY1lTID38wliRLPyhntCj+cfvlMfKSjouNgXMIWyQ8GKZ2c=", - "subType": "06" - } - } - }, - "local_javascriptWithScope_rand_auto_altname": { - "kms": "local", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAPVsw9Opn/P5SAdJhX4MTxIcsmaG8isIN4NKPi9k1u/Vj7AVkcxYqwurAghaJpmfoAgMruvzi1hcKvd05yHd9Nk0vkvODwDgnjJB6QO+qUce8=", - "subType": "06" - } - } - }, - "local_javascriptWithScope_rand_explicit_id": { - "kms": "local", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAPLUa+nsrqiHkVdE5K1xl/ZsiZqQznG2yVXyA3b3loBylbcL2NEBp1JUeGnPZ0y5ZK4AmoL6NMH2Io313rW3V8FTArs/OOQWPRJSe6h0M3wXk=", - "subType": "06" - } - } - }, - "local_javascriptWithScope_rand_explicit_altname": { - "kms": "local", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAPzUKaXCH0JImSlY73HVop9g9c0YssNEiA7Dy7Vji61avxvnuJJfghDchdwwaY7Vc8+0bymoanUWcErRctLzjm+1uKeMnFQokR8wFtnS3PgpQ=", - "subType": "06" - } - } - }, - "local_javascriptWithScope_det_explicit_id": { - "kms": "local", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$code": "x=1", "$scope": {} } - }, - "local_javascriptWithScope_det_explicit_altname": { - "kms": "local", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$code": "x=1", "$scope": {} } - }, - "local_int_rand_auto_id": { - "kms": "local", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAQHXpXb3KlHA2KFTBgl0VoLCu0CUf1ae4DckkwDorbredVSqxvA5e+NvVudY5yuea6bC9F57JlbjI8NWYAUw4q0Q==", - "subType": "06" - } - } - }, - "local_int_rand_auto_altname": { - "kms": "local", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAQSxXMF4+TKV+a3lcxXky8VepEqdg5wI/jg+C4CAUgNurq2XhgrxyqiMjkU8z07tfyoLYyX6P+dTrwj6nzvvchCw==", - "subType": "06" - } - } - }, - "local_int_rand_explicit_id": { - "kms": "local", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAQmzteYnshCI8HBGd7UYUKvcg4xl6M8PRyi1xX/WHbjyQkAJXxczS8hO91wuqStE3tBNSmulUejz9S691ufTd6ZA==", - "subType": "06" - } - } - }, - "local_int_rand_explicit_altname": { - "kms": "local", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAQLCHLru//++QSoWVEyw2v6TUfCnlrPJXrpLLezWf16vK85jTfm8vJbb2X2UzX04wGzVL9tCFFsWX6Z5gHXhgSBg==", - "subType": "06" - } - } - }, - "local_int_det_auto_id": { - "kms": "local", - "type": "int", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAQIxWjLBromNUgiOoeoZ4RUJUYIfhfOmab0sa4qYlS9bgYI41FU6BtzaOevR16O9i+uACbiHL0X6FMXKjOmiRAug==", - "subType": "06" - } - } - }, - "local_int_det_explicit_id": { - "kms": "local", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAQIxWjLBromNUgiOoeoZ4RUJUYIfhfOmab0sa4qYlS9bgYI41FU6BtzaOevR16O9i+uACbiHL0X6FMXKjOmiRAug==", - "subType": "06" - } - } - }, - "local_int_det_explicit_altname": { - "kms": "local", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAQIxWjLBromNUgiOoeoZ4RUJUYIfhfOmab0sa4qYlS9bgYI41FU6BtzaOevR16O9i+uACbiHL0X6FMXKjOmiRAug==", - "subType": "06" - } - } - }, - "local_timestamp_rand_auto_id": { - "kms": "local", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAARntIycg0Xkd16GEa//VSJI4Rkl7dT6MpRa+D3MiTEeio5Yy8zGK0u2BtEP/9MCRQw2hJDYj5znVqwhdduM0OTiA==", - "subType": "06" - } - } - }, - "local_timestamp_rand_auto_altname": { - "kms": "local", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAARWA9Ox5ejDPeWxfjbRgcGCtF/G5yrPMbBJD9ESDFc0NaVe0sdNNTisEVxsSkn7M/S4FCibKh+C8femr7xhu1iTw==", - "subType": "06" - } - } - }, - "local_timestamp_rand_explicit_id": { - "kms": "local", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAARrEfOL4+4Qh7IkhHnHcBEANGfMF8n2wUDnsZ0lXEb0fACKzaN5OKaxMIQBs/3pFBw721qRfCHY+ByKeaQuABbzg==", - "subType": "06" - } - } - }, - "local_timestamp_rand_explicit_altname": { - "kms": "local", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAARW8nwmnBt+LFIAcFWvOzX8llrGcveQKFhyYUIth9d7wtpTyc9myFp8GBQCnjDpKzA6lPmbqVYeLU0L9q0h6SHGQ==", - "subType": "06" - } - } - }, - "local_timestamp_det_auto_id": { - "kms": "local", - "type": "timestamp", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAR6uMylGytMq8QDr5Yz3w9HlW2MkGt6yIgUKcXYSaXru8eer+EkLv66/vy5rHqTfV0+8ryoi+d+PWO5U6b3Ng5Gg==", - "subType": "06" - } - } - }, - "local_timestamp_det_explicit_id": { - "kms": "local", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAR6uMylGytMq8QDr5Yz3w9HlW2MkGt6yIgUKcXYSaXru8eer+EkLv66/vy5rHqTfV0+8ryoi+d+PWO5U6b3Ng5Gg==", - "subType": "06" - } - } - }, - "local_timestamp_det_explicit_altname": { - "kms": "local", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAR6uMylGytMq8QDr5Yz3w9HlW2MkGt6yIgUKcXYSaXru8eer+EkLv66/vy5rHqTfV0+8ryoi+d+PWO5U6b3Ng5Gg==", - "subType": "06" - } - } - }, - "local_long_rand_auto_id": { - "kms": "local", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAASrinKUOpHIB7MNRmCAPWcP4CjZwfr5JaRT3G/GqY9B/6csj3+N9jmo1fYvM8uHcnmf5hzDDOamaE2FF1jDKkrHw==", - "subType": "06" - } - } - }, - "local_long_rand_auto_altname": { - "kms": "local", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAShWMPYDkCpTC2XLYyykPJMihASLKn6HHcB2Eh7jFwQb/8D1HCQoPmOHMyXaN4AtIKm1oqEfma6FSnEPENQoledQ==", - "subType": "06" - } - } - }, - "local_long_rand_explicit_id": { - "kms": "local", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAASd2h34ZLib+GiYayrm/FIZ/weg8wF41T0PfF8NCLTJCoT7gIkdpNRz2zkkQgZMR31efNKtsM8Bs4wgZbkrXsXWg==", - "subType": "06" - } - } - }, - "local_long_rand_explicit_altname": { - "kms": "local", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAASPAvdjz+a3FvXqDSjazaGqwZxrfXlfFB5/VjQFXQB0gpodCEaz1qaLSKfCWBg83ftrYKa/1sa44gU5NBthDfDwQ==", - "subType": "06" - } - } - }, - "local_long_det_auto_id": { - "kms": "local", - "type": "long", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAASQk372m/hW3WX82/GH+ikPv3QUwK7Hh/RBpAguiNxMdNhkgA/y2gznVNm17t6djyub7+d5zN4P5PLS/EOm2kjtw==", - "subType": "06" - } - } - }, - "local_long_det_explicit_id": { - "kms": "local", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAASQk372m/hW3WX82/GH+ikPv3QUwK7Hh/RBpAguiNxMdNhkgA/y2gznVNm17t6djyub7+d5zN4P5PLS/EOm2kjtw==", - "subType": "06" - } - } - }, - "local_long_det_explicit_altname": { - "kms": "local", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAASQk372m/hW3WX82/GH+ikPv3QUwK7Hh/RBpAguiNxMdNhkgA/y2gznVNm17t6djyub7+d5zN4P5PLS/EOm2kjtw==", - "subType": "06" - } - } - }, - "local_decimal_rand_auto_id": { - "kms": "local", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAATLnMMDZhnGSn5F5xHhsJXxiTGXd61Eq6fgppOlxUNVlsZNYyr5tZ3owfTTqRuD9yRg97x65WiHewBBnJJSeirCTAy9zZxWPVlJSiC0gO7rbM=", - "subType": "06" - } - } - }, - "local_decimal_rand_auto_altname": { - "kms": "local", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAATenMh7NKQioGjpuEojIrYKFaJhbuGxUgu2yTTbe3TndhgHryhW9GXiUqo8WTpnXqpC5E/z03ZYLWfCbe7qGdL6T7bbrTpaTaWZnnAm3XaCqY=", - "subType": "06" - } - } - }, - "local_decimal_rand_explicit_id": { - "kms": "local", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAT9vqXuKRh+2HxeCMr+pQYdhYNw7xrTdU4dySWz0X6tCK7LZO5AV72utmRJxID7Bqv1ZlXAk00V92oDLyKG9kHeG5+S34QE/aLCPsAWcppfxY=", - "subType": "06" - } - } - }, - "local_decimal_rand_explicit_altname": { - "kms": "local", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAATtqOCFMbOkls3LikQNXlnlkRr5gJns1+5Kvbt7P7texMa/QlXkYSHhtwESyfOcCQ2sw1T0eZ9DDuNaznpdK2KIqZBkVEC9iMoxqIqXF7Nab0=", - "subType": "06" - } - } - }, - "local_decimal_det_explicit_id": { - "kms": "local", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$numberDecimal": "1.234" } - }, - "local_decimal_det_explicit_altname": { - "kms": "local", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$numberDecimal": "1.234" } - }, - "local_minKey_rand_explicit_id": { - "kms": "local", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$minKey": 1 } - }, - "local_minKey_rand_explicit_altname": { - "kms": "local", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$minKey": 1 } - }, - "local_minKey_det_explicit_id": { - "kms": "local", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$minKey": 1 } - }, - "local_minKey_det_explicit_altname": { - "kms": "local", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$minKey": 1 } - }, - "local_maxKey_rand_explicit_id": { - "kms": "local", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$maxKey": 1 } - }, - "local_maxKey_rand_explicit_altname": { - "kms": "local", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$maxKey": 1 } - }, - "local_maxKey_det_explicit_id": { - "kms": "local", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { "$maxKey": 1 } - }, - "local_maxKey_det_explicit_altname": { - "kms": "local", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { "$maxKey": 1 } - }, - "payload=0,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACcsBdT93ivCyvtkfQz9qb1A9Ll+I6hnGE0kFy3rmVG6xAvipmRJSoVq3iv7iUEDvaqmPXfjeH8h8cPYT86v3XSg==", - "subType": "06" - } - } - }, - "payload=1,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACQOzpNBEGSrANr3Wl8uYpqeIc7pjc8e2LS2FaSrb8tM9F3mR1FqGgfJtn3eD+HZf3Y3WEDGK8975a/1BufkMqIQ==", - "subType": "06" - } - } - }, - "payload=2,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACyGJEcuN1pG5oSEyxuKFwqddGHVU5Untbib7LkmtoJe9HngTofkOpeHZH/hV6Z3CFxLu6WFliJoySsFFbnFy9ag==", - "subType": "06" - } - } - }, - "payload=3,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACLbp4w6mx45lR1vvgmeRja/y8U+WnR2oH4IpfrDi4lKM+JPVnJweiN3/1wAy+sXSy0S1Yh9yxmhh9ISoTkAuVxw==", - "subType": "06" - } - } - }, - "payload=4,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACG0qMY/GPZ/2CR61cxbuizywefyMZVdeTCn5KFjqwejgxeBwX0JmGNHKKWbQIDQykRFv0q0WHUgsRmRhaotNCyQ==", - "subType": "06" - } - } - }, - "payload=5,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACJI1onNpQfZhaYWrPEzHvNaJRqUDZK2xoyonB5E473BPgp3zvn0Jmz1deL8GzS+HlkjCrx39OvHyVt3+3S0kYYw==", - "subType": "06" - } - } - }, - "payload=6,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAClyKY9tZBjl7SewSXr3MdoWRDUNgLaXDUjENpjyYvi/54EQ9a+J/LAAh1892i+mLpYxEUAmcftPyfX3VhbCgUQw==", - "subType": "06" - } - } - }, - "payload=7,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACAMbEA+kNvnVV7B//ds2/QoVot061kbazoMwB/psB5eFdLVB5qApAXEWgQEMwkNnsTUYbtSduQz6uGwdagtNBRw==", - "subType": "06" - } - } - }, - "payload=8,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACzdSK/d7Ni6D8qUgNopnEU5ia1K5llhBGk3O1Tf71t4ThnQjYW9eI/rIohWmev5CGWLHhwuvvKUtFcTAe+NMQww==", - "subType": "06" - } - } - }, - "payload=9,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACzQcEa+ktF2EZf35TtyatnSGGaIVvFhZNuo5P3VwQvoONJrK2cSad7PBDAv3xDAB+VPZAigXAGQvd051sHooOHg==", - "subType": "06" - } - } - }, - "payload=10,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACpfoDmApsR5xOD3TDhcHeD7Jco3kPFuuWjDpHtMepMOJ3S0c+ngGGhzPGZtEz2xuD/E7AQn1ryp/WAQ+WwkaJkQ==", - "subType": "06" - } - } - }, - "payload=11,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACICMRXmx3oKqYv0IpmzkSMBIGT4Li3MPBF4Lw1s5F69WvZApD58glIKB6b7koIrF5qc2Wrb1/Nw+stRv0zvQ8Y9CcFV4OHm6WoEw+XDlWXJ4=", - "subType": "06" - } - } - }, - "payload=12,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACTArUn0WUTojQC4fSvq3TwJVTsZNhWAK2WB057u2EnkUzMC0xsbU6611W6Okx6idZ7pMudXpBC34fRDrJPXOu3BxK+ZLCOWS2FqsvWq3HeTY=", - "subType": "06" - } - } - }, - "payload=13,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACU1Ojn7EM2i+5KK2Beh1gPLhryK3Y7PtaZ/v4JvstxuAV4OHOR9yROP7pwenHXxczkWXvcyMY9OCdmHO8pkQkXO21798IPkDDN/ejJUFI0Uw=", - "subType": "06" - } - } - }, - "payload=14,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAAC0ZLwSliCbcr/e1uiYWk6gRuD/5qiyulQ7IUNWjhpBR6SLUfX2+yExLzps9hoOp53j9zRSKIzyleZ8yGLTLeN+Lz9BUe2ZT+sV8NiqZz3pkA=", - "subType": "06" - } - } - }, - "payload=15,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACQ9pmlQeFDr+jEhFwjL/eGVxdv70JdnkLaKdJ3/jkvCX1VPU5HmQIi+JWY3Rrw844E/6sBR6zIODn5aM0WfyP8a2zKRAWaVQZ7n+QE9hDN/8=", - "subType": "06" - } - } - }, - "payload=16,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AizggCwAAAAAAAAAAAAAAAACiOcItInDGHqvkH0I3udp5nnX32XzDeqya/3KDjgZPT5GHek1vFTZ4924JVxFqFQz+No9rOVmyxm8O2fxjTK2vsjtADzKGnMTtFYZqghYCuc=", - "subType": "06" - } - } - }, - "payload=0,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACijFptWQy7a1Y0rpXEvamXWI9v9dnx0Qj84/mKUsVpc3agkQ0B04uPYeROdt2MeEeiZoEKVWV0NjBocAQCEz7dw==", - "subType": "06" - } - } - }, - "payload=1,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAChR90taVWsZk+++sgibX6CnFeQQHNoB8V+n2gmDe3CIT/t+WvhMf9D+mQipbAlrUyHgGihKMHcvAZ5RZ/spaH4Q==", - "subType": "06" - } - } - }, - "payload=2,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAC67wemDv1Xdu7+EMR9LMBTOxfyAqsGaxQibwamZItzplslL/Dp3t9g9vPuNzq0dWwhnfxQ9GBe8OA3dtRaifYCA==", - "subType": "06" - } - } - }, - "payload=3,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACVLxch+uC7weXrbtylCo1m4HYZmh0sd9JCrlTECO2M56JK1X9a30i2BDUdhPuoTvvODv74CGXkZKdist3o0mGAQ==", - "subType": "06" - } - } - }, - "payload=4,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACexfIZGkOYaCGktOUc6cgAYg7Bd/C5ZYmdb7b8+rd5BKWbthW6N6CxhDIyh/DHvkPAeIzfTYA2/9w6tsjfD/TPQ==", - "subType": "06" - } - } - }, - "payload=5,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACjUH/dPW4egOvFMJJnpWK8v27MeLkbXC4GFl1j+wPqTsIEeIWkzEmcXjHLTQGE2GplHHc/zxwRwD2dXdbzvsCDw==", - "subType": "06" - } - } - }, - "payload=6,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACzvS+QkGlvb05pNn+vBMml09yKmE8yM6lwccNIST5uZSsUxXf2hrxPtO7Ylc4lmBAJt/9bcM59JIeT9fpYMc75w==", - "subType": "06" - } - } - }, - "payload=7,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACSf2RxHJpRuh4j8nS1dfonUtsJEwgqfWrwOsfuT/tAGXgDN0ObUpzL2K7G2vmePjP4dwycCSIL3+2j34bqBJK1Q==", - "subType": "06" - } - } - }, - "payload=8,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACu96YYeLXXoYdEZYNU9UAZjSd6G4fOE1edrA6/RjZKVGWKxftmvj5g1VAOiom0XuTZUe1ihbnwhvKexeoa3Vc8Q==", - "subType": "06" - } - } - }, - "payload=9,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACX+UjBKo9+N0Z+mbyqZqkQv2ETMSn6aPTONWgJtw5nWklcxKjUSSLI+8LW/6M6Xf9a7177GsqmV2f/yCRF58Xtw==", - "subType": "06" - } - } - }, - "payload=10,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACL6TVscFzIJ9+Zj6LsCZ9xhaZuTZdvz1nJe4l69nKyj9hCjnyuiV6Ve4AXwQ5W1wiPfkJ0fCZS33NwiHw7QQ/vg==", - "subType": "06" - } - } - }, - "payload=11,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACPLq7IcWhTVwkKmy0flN7opoQzx7tTe1eD9JIc25FC9B6KGQkdcRDglDDR7/m6+kBtTnq88y63vBgomTxA8ZxQE+3pB7zCiBhX0QznuXvP44=", - "subType": "06" - } - } - }, - "payload=12,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACxv7v4pKtom5z1g9FUuyjEWAbdzJ3ytPNZlOfVr6KZnUPhIH7PfCz3/lTdYYWBTj01+SUZiC/7ruof9QDhsSiNWP7nUyHpQ/C3joI/BBjtDA=", - "subType": "06" - } - } - }, - "payload=13,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACZhiElQ/MvyVMwMkZPu8pT54Ap6TlpVSEbE4nIQzzeU3XKVuspMdI5IXvvgfULXKXc+AOu6oQXZ+wAJ1tErVOsb48HF1g0wbXbBA31C5qLEM=", - "subType": "06" - } - } - }, - "payload=14,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACdp8mDOeDuDLhE0LzTOT2p0CMaUsAQrGCzmiK6Ab9xvaIcPPcejUcpdO3XXAS/pPab4+TUwO5GbI5pDJ29zwaOiOz2H3OJ2m2p5BHQp9mCys=", - "subType": "06" - } - } - }, - "payload=15,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAACmtLohoP/gotuon2IvnGeLEfCWHRMhG9Wp4tPu/vbJJkJkbQTP35HRG9VrMV7KKrEQbOsJ2Y6UDBra4tyjn0fIkwwc/0X9i+xaP+TrwpNabE=", - "subType": "06" - } - } - }, - "payload=16,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASzggCwAAAAAAAAAAAAAAAAC6s9eUtSneKWj3/A7S+bPZLj3t1WtUh7ltW80b8jCRzA+kOI26j1MEb1tt68HgcnH1IJ3YQ/+UHlV95OgwSnIxlib/HJn3U0s8mpuCWe1Auo=", - "subType": "06" - } - } - }, - "azure_double_rand_auto_id": { - "kms": "azure", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAB0S2kOZe54q6iZqeTLndkX+kehTKtb30jTP7FS+Zx+cxhFs626OrGY+jrH41cLfroCccacyNHUZFRinfqZPNOyw==", - "subType": "06" - } - } - }, - "azure_double_rand_auto_altname": { - "kms": "azure", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAABYViH7PLjCIdmTibW9dGCJADwXx2dRSMYxEmulPu89clAoeLDa8pwJ7YxLFQCcTGmZRfmp58dDDAzV8tyyE8QMg==", - "subType": "06" - } - } - }, - "azure_double_rand_explicit_id": { - "kms": "azure", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAABeRahSj4pniBp0rLIEZE8MdeyiIKcYuTZiuGzGiXbFbntEPow88DFHIBSxbMGR7p/8jCpPL+GqBwFkPkafXbMzg==", - "subType": "06" - } - } - }, - "azure_double_rand_explicit_altname": { - "kms": "azure", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAABdaa3vKtO4cAEUjYJfOPl1KbbgeWtphfUuJd6MxR9VReNSf1jc+kONwmkPVQs2WyZ1n+TSQMGRoBp1nHRttDdTg==", - "subType": "06" - } - } - }, - "azure_double_det_explicit_id": { - "kms": "azure", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDouble": "1.2339999999999999858" - } - }, - "azure_double_det_explicit_altname": { - "kms": "azure", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDouble": "1.2339999999999999858" - } - }, - "azure_string_rand_auto_id": { - "kms": "azure", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAACeoztcDg9oZ7ixHinReWQTrAumpsfyb0E1s3BGOFHgBCi1tW79CEXfqN8riFRc1YeRTlN4k5ShgHaBWBlax+XoQ==", - "subType": "06" - } - } - }, - "azure_string_rand_auto_altname": { - "kms": "azure", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAACov9cXQvDHeKOS5Gxcxa8vdAcTsTXDYgUucGzsCyh4TnTWKGQEVk3DHndUXX569TKCjq5QsC//oWEwweCn1nZ4g==", - "subType": "06" - } - } - }, - "azure_string_rand_explicit_id": { - "kms": "azure", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAACKU5qTdMdO0buQ/37ZRANUAAafcsoNMOTxJsDOfkqUb+/kRgM1ePlwVvk4EJiAGhJ/4SEmEOpwv05TT3PxGur2Q==", - "subType": "06" - } - } - }, - "azure_string_rand_explicit_altname": { - "kms": "azure", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAACX/ODKGHUyAKxoJ/c/3lEDBTc+eP/VS8OHrLhYoP96McpnFSgYi5jfUwvrFYa715fkass4N0nAHE6TzoGTYyk6Q==", - "subType": "06" - } - } - }, - "azure_string_det_auto_id": { - "kms": "azure", - "type": "string", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAACmVI7YK4JLOzutEdQ79he817Vk5EDP/3hXwOlGmERZCtp8J8HcqClhV+pyvRLGbwmlh12fbSs9nEp7mrobQm9wA==", - "subType": "06" - } - } - }, - "azure_string_det_explicit_id": { - "kms": "azure", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAACmVI7YK4JLOzutEdQ79he817Vk5EDP/3hXwOlGmERZCtp8J8HcqClhV+pyvRLGbwmlh12fbSs9nEp7mrobQm9wA==", - "subType": "06" - } - } - }, - "azure_string_det_explicit_altname": { - "kms": "azure", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAACmVI7YK4JLOzutEdQ79he817Vk5EDP/3hXwOlGmERZCtp8J8HcqClhV+pyvRLGbwmlh12fbSs9nEp7mrobQm9wA==", - "subType": "06" - } - } - }, - "azure_object_rand_auto_id": { - "kms": "azure", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAADWkZMsfCo4dOPMH1RXC7GkZFt1RCjJf0vaLDA09ih1Jl47SOetZELQ7B1TQjRQitktzrfD43jk8Fn4J5ZYZu1qQ==", - "subType": "06" - } - } - }, - "azure_object_rand_auto_altname": { - "kms": "azure", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAADJFMymfstltZP1oAqj4bgbCk8uLGtCd12eLqvSq0ZO+JDvls7PAovwmoWwigHunP8BBXT8sLydK+jn1sHfnhrlw==", - "subType": "06" - } - } - }, - "azure_object_rand_explicit_id": { - "kms": "azure", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAADCen+XrLYKg7gIVubVfdbQwuJ0mFHxhSUUyyBWj4RCeLeLUYXckboPGixXWB9XdwcOnInfF9u6qvktY67GtYASQ==", - "subType": "06" - } - } - }, - "azure_object_rand_explicit_altname": { - "kms": "azure", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAADnUyp/7eLmxxxOdsP+mNuJABK4PQoKFWDAY7lDrH6MYa03ryASOihPZWYZWXZLrbAf7cQQhElEkKqKwY8+NXgqg==", - "subType": "06" - } - } - }, - "azure_object_det_explicit_id": { - "kms": "azure", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "azure_object_det_explicit_altname": { - "kms": "azure", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "azure_array_rand_auto_id": { - "kms": "azure", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAEtk14WyoatZcNPlg3y/XJNsBt6neFJeQwR06B9rMGV58oIsmeE5zMtUOBYTgzlnwyKpqI/XVAg8s1VxvsrvGCyLVPwGVyDztwtMgVSW6QM3s=", - "subType": "06" - } - } - }, - "azure_array_rand_auto_altname": { - "kms": "azure", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAERTO63J4Nj1BpFlqVduA2IrAiGoV4jEOH3FnFgx7ZP7da/YBmLX/bc1EqdpC8v4faHxp74iU0xAB0yW4WgySDX7rriL5cw9sMpqgLRaBxGug=", - "subType": "06" - } - } - }, - "azure_array_rand_explicit_id": { - "kms": "azure", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAEs09qQdNVwh+KFqKPREQkw0XFdRNHAvjYJzs5MDE9+QxvtKlmVKSK3wkxDdCrcH4r7ePV2nCy2h1IHYqaDnnt4s5dSawI2l88iTT+bBcCSrU=", - "subType": "06" - } - } - }, - "azure_array_rand_explicit_altname": { - "kms": "azure", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAEaQ/YL50up4YIMJuVJSiAP06IQ+YjdKLIfkN/prbOZMiXErcD1Vq1hwGhfGdpEsLVu8E7IhJb4wakVC/2dLZoRP95az6HqRRauNNZAIQMKfY=", - "subType": "06" - } - } - }, - "azure_array_det_explicit_id": { - "kms": "azure", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "azure_array_det_explicit_altname": { - "kms": "azure", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "azure_binData=00_rand_auto_id": { - "kms": "azure", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAFl/leuLAHf1p6aRKHdFyN9FM6MW2XzBemql2xQgqkwJ6YOQXW6Pu/aI1scXVOrvrSu3+wBvByjHu++1AqFgzZRQ==", - "subType": "06" - } - } - }, - "azure_binData=00_rand_auto_altname": { - "kms": "azure", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAF4Nq/LwyufT/mx0LtFSkupNHTuyjbr4yUy1N5/37XhkpqZ1e4sWCHGNaTDEm5+cvdnbqZ/MMkBv855dc8N7vnGA==", - "subType": "06" - } - } - }, - "azure_binData=00_rand_explicit_id": { - "kms": "azure", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAFv1Kbv54uXJ76Ih63vtmszQtzkXqDlv8LDCFO3sjzu70+tgRXOhLm3J8uZpwoiNkgM6oNLn0en7tnEekYB9++CA==", - "subType": "06" - } - } - }, - "azure_binData=00_rand_explicit_altname": { - "kms": "azure", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAFgcYC1n7cGGXpv0qf1Kb8t9y/6kbhscGt2QJkQpAiqadFPPYDU/wwaKdDz94NpAHMZizUbhf9tvZ3UXl1bozhDA==", - "subType": "06" - } - } - }, - "azure_binData=00_det_auto_id": { - "kms": "azure", - "type": "binData=00", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAFvswfP3+jgia6rAyrypvbso3Xm4d7MEgJRUCWFYzA+9ov++vmeirgoTp/rFavTNOPb+61fvl1WKbVwrgODusaMg==", - "subType": "06" - } - } - }, - "azure_binData=00_det_explicit_id": { - "kms": "azure", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAFvswfP3+jgia6rAyrypvbso3Xm4d7MEgJRUCWFYzA+9ov++vmeirgoTp/rFavTNOPb+61fvl1WKbVwrgODusaMg==", - "subType": "06" - } - } - }, - "azure_binData=00_det_explicit_altname": { - "kms": "azure", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAFvswfP3+jgia6rAyrypvbso3Xm4d7MEgJRUCWFYzA+9ov++vmeirgoTp/rFavTNOPb+61fvl1WKbVwrgODusaMg==", - "subType": "06" - } - } - }, - "azure_binData=04_rand_auto_id": { - "kms": "azure", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAFMzMC3BLn/zWE9dxpcD8G0h4aifSY0zSHS9xTVJXgq21s2WU++Ov2UvHatVozmtZltsUN9JvSWqOBQRkFsrXvI7bc4lYfOoOmfpTHFcRDA/c=", - "subType": "06" - } - } - }, - "azure_binData=04_rand_auto_altname": { - "kms": "azure", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAFDlBN5hUTcjamOg/sgyeG0S52kphsjUgvlpuqHYz6VVdLtZ69cGHOVqqyml3x2rVqWUZJjd4ZodOhlwWq9p+i5IYNot2QaBvi8NZSaiThTc0=", - "subType": "06" - } - } - }, - "azure_binData=04_rand_explicit_id": { - "kms": "azure", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAFjvS2ozJuAL3rCvyBpraVtgL91OMdiskmgYnyfKlzd8EhYLd1cL4yxnTUjRXx+W+p8uN0/QZo+mynhcWnwcq83raY+I1HftSTx+S6rZ0qyDM=", - "subType": "06" - } - } - }, - "azure_binData=04_rand_explicit_altname": { - "kms": "azure", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAFqUMd/I0yOdy5W4THvFc6yrgSzB6arkRs/06b0M9Ii+QtAY6vbz+/aJ0Iy3Jm8TahC1wOZVmTj5luQpr+PHZMCEAFadv+0K/Nsx6xVhAh9gg=", - "subType": "06" - } - } - }, - "azure_binData=04_det_auto_id": { - "kms": "azure", - "type": "binData=04", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAFmN+KMrERGmfmue8/hG4D+ZcGzxC2HntdYBLjEolzvS9FV5JH/adxyUAnMpyL8FNznARL51rbv/G1nXPn9mPabsQ4BtWEAQbHx9TiXd+xbB0=", - "subType": "06" - } - } - }, - "azure_binData=04_det_explicit_id": { - "kms": "azure", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAFmN+KMrERGmfmue8/hG4D+ZcGzxC2HntdYBLjEolzvS9FV5JH/adxyUAnMpyL8FNznARL51rbv/G1nXPn9mPabsQ4BtWEAQbHx9TiXd+xbB0=", - "subType": "06" - } - } - }, - "azure_binData=04_det_explicit_altname": { - "kms": "azure", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAFmN+KMrERGmfmue8/hG4D+ZcGzxC2HntdYBLjEolzvS9FV5JH/adxyUAnMpyL8FNznARL51rbv/G1nXPn9mPabsQ4BtWEAQbHx9TiXd+xbB0=", - "subType": "06" - } - } - }, - "azure_undefined_rand_explicit_id": { - "kms": "azure", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "azure_undefined_rand_explicit_altname": { - "kms": "azure", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "azure_undefined_det_explicit_id": { - "kms": "azure", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "azure_undefined_det_explicit_altname": { - "kms": "azure", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "azure_objectId_rand_auto_id": { - "kms": "azure", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAH3sYVJpCKi310YxndMwm5ltEbbiRO1RwZxxeEkzI8tptbNXC8t7RkrT8VSJZ43wbGYCiqH5RZy9v8pYwtUm4STw==", - "subType": "06" - } - } - }, - "azure_objectId_rand_auto_altname": { - "kms": "azure", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAHD7agzVEc0JwesHHhkpGYIDAHQ+3Hc691kqic6YmVvK2N45fD5aRKftaZNs5OxSj3tNHSo7lQ+DVtPj8uSSpsVg==", - "subType": "06" - } - } - }, - "azure_objectId_rand_explicit_id": { - "kms": "azure", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAHEgKgy2mpMLpfeEWqbvQOaRZAy+cEGXGon3e53/JoH6dZneEyyt4ZrcrK6uRqyUPWX0q104JbCYxfbtHtdzWgPQ==", - "subType": "06" - } - } - }, - "azure_objectId_rand_explicit_altname": { - "kms": "azure", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAHqSv6Nruw3TIi7y0FPRjSfnJmWSdv5XMhAtnHNkT8MVuHeM32ayo0yc8dTA1wlkRtAI5JrGxTfERCXYuCojvvXg==", - "subType": "06" - } - } - }, - "azure_objectId_det_auto_id": { - "kms": "azure", - "type": "objectId", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAHcPRjIOyLDUJCDcdWkUySKCFS2AFkIa1OQyQAfC3Zh5HwJ1O7j2o+iYKRerhbni8lBiZH7EUMm1JcxM99lLC5jQ==", - "subType": "06" - } - } - }, - "azure_objectId_det_explicit_id": { - "kms": "azure", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAHcPRjIOyLDUJCDcdWkUySKCFS2AFkIa1OQyQAfC3Zh5HwJ1O7j2o+iYKRerhbni8lBiZH7EUMm1JcxM99lLC5jQ==", - "subType": "06" - } - } - }, - "azure_objectId_det_explicit_altname": { - "kms": "azure", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAHcPRjIOyLDUJCDcdWkUySKCFS2AFkIa1OQyQAfC3Zh5HwJ1O7j2o+iYKRerhbni8lBiZH7EUMm1JcxM99lLC5jQ==", - "subType": "06" - } - } - }, - "azure_bool_rand_auto_id": { - "kms": "azure", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAIYVWPvzSmiCs9LwRlv/AoQWhaS5mzoKX4W26M5eg/gPjOZbEVYOV80pWMxCcZWRAyV/NDWDUmKtRQDMU9b8lCJw==", - "subType": "06" - } - } - }, - "azure_bool_rand_auto_altname": { - "kms": "azure", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAIsAB01Ugqtw4T9SkuJBQN1y/ewpRAyz0vjFPdKI+jmPMmaXpMlXDJU8ZbTKm/nh6sjJCFcY5oZJ83ylbp2gHc6w==", - "subType": "06" - } - } - }, - "azure_bool_rand_explicit_id": { - "kms": "azure", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAIr8/qFd564X1mqHEhB0y7bzGFdrHuw+Gk45nXla3VvGHzeIJy6j2Wdl0uziWslMmBvNp8WweW+jQ6E2Fu7SiojQ==", - "subType": "06" - } - } - }, - "azure_bool_rand_explicit_altname": { - "kms": "azure", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAIWsca5FAnS2zhHnmKmexvvXMTgsZZ7uAFHnjQassUcay6mvIWH4hOnGiRxt5Zm0wO4S6cZq+PZrmEH5/n9rJcJQ==", - "subType": "06" - } - } - }, - "azure_bool_det_explicit_id": { - "kms": "azure", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": true - }, - "azure_bool_det_explicit_altname": { - "kms": "azure", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": true - }, - "azure_date_rand_auto_id": { - "kms": "azure", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAJwKo7XW5daIFlwY1mDAnJdHlcUgF+74oViL28hQGhde63pkPyyS6lPkYrc1gcCK5DL7PwsSX4Vb9SsNAG9860xw==", - "subType": "06" - } - } - }, - "azure_date_rand_auto_altname": { - "kms": "azure", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAJYZdWIqvqTztGKJkSASMEOjyrUFKnYql8fMIEzfEZWx2BYsIkxxOUUUCASg/Jsn09fTLVQ7yLD+LwycuI2uaXsw==", - "subType": "06" - } - } - }, - "azure_date_rand_explicit_id": { - "kms": "azure", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAJuWzKqi3KV8GbGGnT7i9N4BACUuNjt5AgKsjWIfrWRXK1+jRQFq0bYlVWaliT9CNIygL2aTF0H4eHl55PAI84MQ==", - "subType": "06" - } - } - }, - "azure_date_rand_explicit_altname": { - "kms": "azure", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAJ5JTtTuP4zTnEbaVlS/W59SrZ08LOC4ZIl+h+H4RnfHUfBXDwUou+APolVaYko+VZMKecrikdPeewgzWaqazJ1g==", - "subType": "06" - } - } - }, - "azure_date_det_auto_id": { - "kms": "azure", - "type": "date", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAJCREIp/SPolAZcVU1iOmaJaN2tFId5HhrjNmhp6xhA1AIPLnN+U7TAqesxFN7iebR9fXI5fZxYNgyWqQC1rqUJw==", - "subType": "06" - } - } - }, - "azure_date_det_explicit_id": { - "kms": "azure", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAJCREIp/SPolAZcVU1iOmaJaN2tFId5HhrjNmhp6xhA1AIPLnN+U7TAqesxFN7iebR9fXI5fZxYNgyWqQC1rqUJw==", - "subType": "06" - } - } - }, - "azure_date_det_explicit_altname": { - "kms": "azure", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAJCREIp/SPolAZcVU1iOmaJaN2tFId5HhrjNmhp6xhA1AIPLnN+U7TAqesxFN7iebR9fXI5fZxYNgyWqQC1rqUJw==", - "subType": "06" - } - } - }, - "azure_null_rand_explicit_id": { - "kms": "azure", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "azure_null_rand_explicit_altname": { - "kms": "azure", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "azure_null_det_explicit_id": { - "kms": "azure", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "azure_null_det_explicit_altname": { - "kms": "azure", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "azure_regex_rand_auto_id": { - "kms": "azure", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAALsMm3W2ogEiI6m0l8dS5Xhqnw+vMBvN1EesOTqAZOk4tQleX6fWARwUUnjFxbuejU7ISb50fc/Ul+ntL9z/2nHQ==", - "subType": "06" - } - } - }, - "azure_regex_rand_auto_altname": { - "kms": "azure", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAALITQNQI0hfCeMTxH0Hce1Cf5tinQG+Bq8EolUACvxUUQcDqIXfFXn19tV/Qyj4lIdnnwh/18hiswgEpJRK7uLGw==", - "subType": "06" - } - } - }, - "azure_regex_rand_explicit_id": { - "kms": "azure", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAALw/1QI/bKeiGUrrtC+yXOTvxZ2mJjSelPPGOm1mge0ws8DsX0DPHmo6MjhnRO4u0c/LWiE3hwHG2rYjAFlFXZ5A==", - "subType": "06" - } - } - }, - "azure_regex_rand_explicit_altname": { - "kms": "azure", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAL6Sl58UfFCHCZzWIB4r19/ZjeSRAoWeTFCFedKiwyR8/xnL+8jzXK/9+vTIspP6j35lFapr+f4iBNB9WjdpYNKA==", - "subType": "06" - } - } - }, - "azure_regex_det_auto_id": { - "kms": "azure", - "type": "regex", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAALxshM91Tsql/8kPe3dC16oP36XSUIN6godiRVIJLJ+NAwYtEkThthQsln7CrkIxIx6npN6A/hw1CBJERS/cqWhw==", - "subType": "06" - } - } - }, - "azure_regex_det_explicit_id": { - "kms": "azure", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAALxshM91Tsql/8kPe3dC16oP36XSUIN6godiRVIJLJ+NAwYtEkThthQsln7CrkIxIx6npN6A/hw1CBJERS/cqWhw==", - "subType": "06" - } - } - }, - "azure_regex_det_explicit_altname": { - "kms": "azure", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAALxshM91Tsql/8kPe3dC16oP36XSUIN6godiRVIJLJ+NAwYtEkThthQsln7CrkIxIx6npN6A/hw1CBJERS/cqWhw==", - "subType": "06" - } - } - }, - "azure_dbPointer_rand_auto_id": { - "kms": "azure", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAMaAd1v/XCYM2Kzi/f4utR6aHOFORmzZ17EepEjkn5IeKshktUpPWjI/dBwSunn5Qxx2zI3nm06c3SDvp6tw8qb7u4qXjLQYhlsQ0bHvvm+vE=", - "subType": "06" - } - } - }, - "azure_dbPointer_rand_auto_altname": { - "kms": "azure", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAM6VNjkN9bMIzfC7AX0ZhOEXPpyPE0nzYq3c5TNHrgeGWdZDR9GVdbO9t55zQrQJJ2Mmevh8c0WaAUV+YODv7ty6TDBsPbaKWWqMzu/v9RXHo=", - "subType": "06" - } - } - }, - "azure_dbPointer_rand_explicit_id": { - "kms": "azure", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAM66tywuMhwdyUjxfl7EOdKHNCLeIPnct3PgKrAKlOQFjiNQUIA2ShVy0qYpJcvvFsuQ5e8Bjr0IqeBc8mC7n4euRSM1UXpLqI5XHgXMMaYpI=", - "subType": "06" - } - } - }, - "azure_dbPointer_rand_explicit_altname": { - "kms": "azure", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAMtPQEbZ4gWoSYjVZLd5X6j0XxutWY1Ecrys2ErKRgZaxP0uGe8uw0cnr2Z5PYylaYmsSicLwD1PwWY42PKmaGBDraHmdfqDOPvrNxhBrfU/E=", - "subType": "06" - } - } - }, - "azure_dbPointer_det_auto_id": { - "kms": "azure", - "type": "dbPointer", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAMxUcVqq6RpAUCv08qGkmjuwVAIgLeYyh7xZnMeCYVGmhJKIP1Zdt1SvRGRV0jzwCQmXgxNd04adRwJnG/PRQIsL9aH3ilJgEnUbOo1nqR7yw=", - "subType": "06" - } - } - }, - "azure_dbPointer_det_explicit_id": { - "kms": "azure", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAMxUcVqq6RpAUCv08qGkmjuwVAIgLeYyh7xZnMeCYVGmhJKIP1Zdt1SvRGRV0jzwCQmXgxNd04adRwJnG/PRQIsL9aH3ilJgEnUbOo1nqR7yw=", - "subType": "06" - } - } - }, - "azure_dbPointer_det_explicit_altname": { - "kms": "azure", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAMxUcVqq6RpAUCv08qGkmjuwVAIgLeYyh7xZnMeCYVGmhJKIP1Zdt1SvRGRV0jzwCQmXgxNd04adRwJnG/PRQIsL9aH3ilJgEnUbOo1nqR7yw=", - "subType": "06" - } - } - }, - "azure_javascript_rand_auto_id": { - "kms": "azure", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAANWXPb5z3a0S7F26vkmBF3fV+oXYUj15OEtnSlXlUrc+gbhbPDxSvCPnTBEy5sNu4ndkvEZZxYgZInkF2q4rhlfQ==", - "subType": "06" - } - } - }, - "azure_javascript_rand_auto_altname": { - "kms": "azure", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAANN4mcwLz/J4eOUknhVsy6kdF1ThDP8cx6dNpOwJWAiyPHEsn+i6JmMTlfQMBrUp9HB/u3R+jLO5yz4XgLUKE8Tw==", - "subType": "06" - } - } - }, - "azure_javascript_rand_explicit_id": { - "kms": "azure", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAANJ+t5Z8hSQaoNzszzkWndAo4A0avDf9bKFa7euznz8ZYInnl9RUVqWMyxjSuIotAvTyYSJzxh+w2hKCgVf+MjEA==", - "subType": "06" - } - } - }, - "azure_javascript_rand_explicit_altname": { - "kms": "azure", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAANRLOQFpmkEg/KdWMmaurkNtUhy45rgtoipc9kQz6olgDWiMim81XC0AW5cOvjbHXL3w7Du28Kwdsp4j0PTTXHUQ==", - "subType": "06" - } - } - }, - "azure_javascript_det_auto_id": { - "kms": "azure", - "type": "javascript", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAANUrNUS/7/dmKVWBd+2JKGEn1hxbFSyu3p5sDNatukG2m16t4WwxzmYAg8PuQbAxekprs7iaLA+7D2Kn3ZuMSQOw==", - "subType": "06" - } - } - }, - "azure_javascript_det_explicit_id": { - "kms": "azure", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAANUrNUS/7/dmKVWBd+2JKGEn1hxbFSyu3p5sDNatukG2m16t4WwxzmYAg8PuQbAxekprs7iaLA+7D2Kn3ZuMSQOw==", - "subType": "06" - } - } - }, - "azure_javascript_det_explicit_altname": { - "kms": "azure", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAANUrNUS/7/dmKVWBd+2JKGEn1hxbFSyu3p5sDNatukG2m16t4WwxzmYAg8PuQbAxekprs7iaLA+7D2Kn3ZuMSQOw==", - "subType": "06" - } - } - }, - "azure_symbol_rand_auto_id": { - "kms": "azure", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAORMcgtQSU+/2Qlq57neRrVuAFSeSwkqdo+z1fh6IKjyEzhCy+u5bTzSzTopyKJQTCUZA2mSpRezWkM87oiGfhMFkBRVreMcE62eH+BLlgUaM=", - "subType": "06" - } - } - }, - "azure_symbol_rand_auto_altname": { - "kms": "azure", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAOIKlAw/A3nwHn0tO2cYtJx0azB8MGmXtt+bRptzn8yHlUSpMpYaiU0ssBBiLkmMLAITYebLqDk3NHESyP7PvbSfX1E2XVn2Nf694ZqPWMec8=", - "subType": "06" - } - } - }, - "azure_symbol_rand_explicit_id": { - "kms": "azure", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAO8SXW76AEr/6D6zyP1RYwmwdVM2AINaXZn3Ipy+fynWTUV6XIPIRR7xMTttNo2zlh7fgXDZ28PmjooGlQzn0q0JVQmXPCIPM3aqAmMcgyuqg=", - "subType": "06" - } - } - }, - "azure_symbol_rand_explicit_altname": { - "kms": "azure", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAOtoJWm2Ucre0foHIiOutsX1WIyub7t3Lby3/F8zRXn+l6ixlTjAPgWFwpRnYg96Lt2ACDDQ9CO51ejr9qk0b8LDBwG3qU5Cuibsp7vo1VsdI=", - "subType": "06" - } - } - }, - "azure_symbol_det_auto_id": { - "kms": "azure", - "type": "symbol", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAOvp/FMMmWVMkiuN51uFMFBiRQAcc9jftlNsHsLoNtohZaGni26kgX94b+/EI8pdWF5xA/73JlGlij0Rt+vC9s/zTDItRpn0bJL54WPphDcmA=", - "subType": "06" - } - } - }, - "azure_symbol_det_explicit_id": { - "kms": "azure", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAOvp/FMMmWVMkiuN51uFMFBiRQAcc9jftlNsHsLoNtohZaGni26kgX94b+/EI8pdWF5xA/73JlGlij0Rt+vC9s/zTDItRpn0bJL54WPphDcmA=", - "subType": "06" - } - } - }, - "azure_symbol_det_explicit_altname": { - "kms": "azure", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAOvp/FMMmWVMkiuN51uFMFBiRQAcc9jftlNsHsLoNtohZaGni26kgX94b+/EI8pdWF5xA/73JlGlij0Rt+vC9s/zTDItRpn0bJL54WPphDcmA=", - "subType": "06" - } - } - }, - "azure_javascriptWithScope_rand_auto_id": { - "kms": "azure", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAPCw9NnvJyuTYIgZxr1w1UiG85PGZ4rO62DWWDF98HwVM/Y6u7hNdNjkaWjYFsPMl38ioHw/pS8GFR62QmH2RAw/BV0wI7pNy2evANr3i3gKg=", - "subType": "06" - } - } - }, - "azure_javascriptWithScope_rand_auto_altname": { - "kms": "azure", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAPXQzqnQ2UWkIYof8/OfadNMa7iVKAbOaiu7YGm8iVrx+W6uxKLPFugVqHtQ29hYXXf33xr8rqGNxDlAe7/x1OeYEif71f7LUkmKF9WxJV9Ko=", - "subType": "06" - } - } - }, - "azure_javascriptWithScope_rand_explicit_id": { - "kms": "azure", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAP0nxlppgPyjLx0eBempbOlL21G6KbABSrE6+YuNDcsjJjxCQuLR9+aoAwa+yCDEC7GZ1E3oP489edKUuNpE4Ts26jy4aRegu4DmyECUeBwAg=", - "subType": "06" - } - } - }, - "azure_javascriptWithScope_rand_explicit_altname": { - "kms": "azure", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAPO89afu9Sb+cK9wwM1cO1DPjvu5UNyObjjTScy1hy9PzllJGfj7b84f0Ah74jPYsMPwI0Eslu/IYF3+5jmquq5Qp/VUQESlxqRqRK0xIeMfs=", - "subType": "06" - } - } - }, - "azure_javascriptWithScope_det_explicit_id": { - "kms": "azure", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "azure_javascriptWithScope_det_explicit_altname": { - "kms": "azure", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "azure_int_rand_auto_id": { - "kms": "azure", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAQUyy4uWmWdzypsK81q9egREg4s80X3L2hzxJzC+fL08Xzy1z9grpPPCfJrluUVKMMGmmZR8gJPJ70igN3unJbzg==", - "subType": "06" - } - } - }, - "azure_int_rand_auto_altname": { - "kms": "azure", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAQr4gyoHKpGsSJo8CMsYSJk/KilFMJhsDCmxrha7yfNW1uR5sjyZj4B4s6uTXGw76x7aR/AvecDlY3QFJb8L1mjg==", - "subType": "06" - } - } - }, - "azure_int_rand_explicit_id": { - "kms": "azure", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAQ0zgXYPV1MuEFksmDpVDoWkoZQelm3+rYrMiT64KYywO//75799W8TbR3a7O6Q/ErjKQOin2OCp8EWwZqTDdz5w==", - "subType": "06" - } - } - }, - "azure_int_rand_explicit_altname": { - "kms": "azure", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAQG+qz00yizREbP3tla1elMiwf8TKLbUU2XWUP+E0vey/wvbjTTIzqwUlz/b9St77CHJhavypP3hMrngXR9GapbQ==", - "subType": "06" - } - } - }, - "azure_int_det_auto_id": { - "kms": "azure", - "type": "int", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAQCkJH+CataLqp/xBjO77QBprC2xPV+rE+goSZ3C6aqwXIeTYHTOqEbeaFb5iZcqYH5nWvNvnfbZSIMyvSfrPjhw==", - "subType": "06" - } - } - }, - "azure_int_det_explicit_id": { - "kms": "azure", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAQCkJH+CataLqp/xBjO77QBprC2xPV+rE+goSZ3C6aqwXIeTYHTOqEbeaFb5iZcqYH5nWvNvnfbZSIMyvSfrPjhw==", - "subType": "06" - } - } - }, - "azure_int_det_explicit_altname": { - "kms": "azure", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAQCkJH+CataLqp/xBjO77QBprC2xPV+rE+goSZ3C6aqwXIeTYHTOqEbeaFb5iZcqYH5nWvNvnfbZSIMyvSfrPjhw==", - "subType": "06" - } - } - }, - "azure_timestamp_rand_auto_id": { - "kms": "azure", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAARwcXYtx+A7g/zGkjGdkyVxZGCO9Nzj3D70NIpl2TeH2j9qYGP4DenwL1xSgrL2Ez+X58d2BvNhKrjA9y2w1Z8kA==", - "subType": "06" - } - } - }, - "azure_timestamp_rand_auto_altname": { - "kms": "azure", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAARQ0Pjx3l92Aqhn2e1hot2M9rQ6aLPE2Iw8AVhm5AD8FWywWih12Fn2p9+kiE33yKPOCyrTWQHKPtB4yYhqnJgGg==", - "subType": "06" - } - } - }, - "azure_timestamp_rand_explicit_id": { - "kms": "azure", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAARvFMlIzh2IjpHkTJ8buqTOqBA0+CxVDsZacUhSHVMgJLN+0DJsJy8OfkmKMu9Lk5hULY00Udoja87x+79mYfmeQ==", - "subType": "06" - } - } - }, - "azure_timestamp_rand_explicit_altname": { - "kms": "azure", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAAR+2SCd7V5ukAkh7CYpNPIatzTL8osNoA4Mb5jjjbos8eMamImw0fbH8YA+Rdm4CgGdQQ9VDX7MtMWlArkj0Jpew==", - "subType": "06" - } - } - }, - "azure_timestamp_det_auto_id": { - "kms": "azure", - "type": "timestamp", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAARe72T/oC09QGE1vuljb6ZEHa6llEwMLT+C4s9u1fREkOKndpmrOlGE8zOey4teizY1ypOMkIZ8GDQJJ4kLSpNkQ==", - "subType": "06" - } - } - }, - "azure_timestamp_det_explicit_id": { - "kms": "azure", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAARe72T/oC09QGE1vuljb6ZEHa6llEwMLT+C4s9u1fREkOKndpmrOlGE8zOey4teizY1ypOMkIZ8GDQJJ4kLSpNkQ==", - "subType": "06" - } - } - }, - "azure_timestamp_det_explicit_altname": { - "kms": "azure", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAARe72T/oC09QGE1vuljb6ZEHa6llEwMLT+C4s9u1fREkOKndpmrOlGE8zOey4teizY1ypOMkIZ8GDQJJ4kLSpNkQ==", - "subType": "06" - } - } - }, - "azure_long_rand_auto_id": { - "kms": "azure", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAASSSgX7k8iw0xFe0AiIzOu0e0P7Ujyfsk/Cdl0fR5X8V3QLVER+1Qa47Qpb8iWL2VLBSh+55HvIEtvhWn8SwXaog==", - "subType": "06" - } - } - }, - "azure_long_rand_auto_altname": { - "kms": "azure", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAASUhKr5K7ulGTeFbhIvJ2DDE10gRAFn5+2zqnsIFSY8lYV2PBYcENdeNBXZs6kyIAYhJdQyuOChVCerTI5jmQWDw==", - "subType": "06" - } - } - }, - "azure_long_rand_explicit_id": { - "kms": "azure", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAASHxawpjTHdXYRWQSZ7Qi7gFC+o4dW2mPH8s5nQkPFY/EubcJbdAZ5HFp66NfPaDJ/NSH6Vy+TkpX3683RC+bjSQ==", - "subType": "06" - } - } - }, - "azure_long_rand_explicit_altname": { - "kms": "azure", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAASVaMAv6UjuBOUZMJ9qz+58TQWmgaMpS9xrJziJY80ml9aRlDTtRubP7U40CgbDvrtY1QgHbkF/di1XDCB6iXMMg==", - "subType": "06" - } - } - }, - "azure_long_det_auto_id": { - "kms": "azure", - "type": "long", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAS06L8oEPeMvVlA32VlobdOWG24OoyMbv9PyYsHLsbT0bHFwU7lYUSQG9EkYVRNPEDzvXpciE1jT7KT8CRY8XT/g==", - "subType": "06" - } - } - }, - "azure_long_det_explicit_id": { - "kms": "azure", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAS06L8oEPeMvVlA32VlobdOWG24OoyMbv9PyYsHLsbT0bHFwU7lYUSQG9EkYVRNPEDzvXpciE1jT7KT8CRY8XT/g==", - "subType": "06" - } - } - }, - "azure_long_det_explicit_altname": { - "kms": "azure", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQGVERAAAAAAAAAAAAAAAAAS06L8oEPeMvVlA32VlobdOWG24OoyMbv9PyYsHLsbT0bHFwU7lYUSQG9EkYVRNPEDzvXpciE1jT7KT8CRY8XT/g==", - "subType": "06" - } - } - }, - "azure_decimal_rand_auto_id": { - "kms": "azure", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAATJ6LZgPu9F+rPtYsMuvwOx62+g1dAk858BUtE9FjC/300DnbDiolhkHNcyoFs07NYUNgLthW2rISb/ejmsDCt/oqnf8zWYf9vrJEfHaS/Ocw=", - "subType": "06" - } - } - }, - "azure_decimal_rand_auto_altname": { - "kms": "azure", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAATX8eD6qFYWKwIGvXtQG79fXKuPW9hkIV0OwrmNNIqRltw6gPHl+/1X8Q6rgmjCxqvhB05AxTj7xz64gP+ILkPQY8e8VGuCOvOdwDo2IPwy18=", - "subType": "06" - } - } - }, - "azure_decimal_rand_explicit_id": { - "kms": "azure", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAATBjQ9E5wDdTS/iI1XDqGmDBC5aLbPB4nSyrjRLfv1zEoPRjmcHlQmMRJA0mori2VQv6EBFNHeczFCenJaSAkuh77czeXM2vH3T6qwEIDs4dw=", - "subType": "06" - } - } - }, - "azure_decimal_rand_explicit_altname": { - "kms": "azure", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AgGVERAAAAAAAAAAAAAAAAATtkjbhdve7MNuLaTm6qvaewuVUxeC1DMz1fd4RC4jeiBFMd5uZUVJTiOIerwQ6P5G5lkMlezKDWgKl2FUvZH6c7V3JknhsaWcV5iLWGUL6Zc=", - "subType": "06" - } - } - }, - "azure_decimal_det_explicit_id": { - "kms": "azure", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "azure_decimal_det_explicit_altname": { - "kms": "azure", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "azure_minKey_rand_explicit_id": { - "kms": "azure", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "azure_minKey_rand_explicit_altname": { - "kms": "azure", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "azure_minKey_det_explicit_id": { - "kms": "azure", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "azure_minKey_det_explicit_altname": { - "kms": "azure", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "azure_maxKey_rand_explicit_id": { - "kms": "azure", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "azure_maxKey_rand_explicit_altname": { - "kms": "azure", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "azure_maxKey_det_explicit_id": { - "kms": "azure", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "azure_maxKey_det_explicit_altname": { - "kms": "azure", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "gcp_double_rand_auto_id": { - "kms": "gcp", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAABFoHQxnh1XSC0k1B01uFFg7rE9sZVBn4PXo26JX8gx9tuxu+4l9Avb23H9BfOzuWiEc43iw87K/W2y0VfKp5CCg==", - "subType": "06" - } - } - }, - "gcp_double_rand_auto_altname": { - "kms": "gcp", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAABRkZkEtQEFB/r268cNfYRQbN4u5Cxjl9Uh+8wq9TFWLQH2E/9wj2vTLlxQ2cQsM7Qd+XxR5idjfBf9CKAfvUa/A==", - "subType": "06" - } - } - }, - "gcp_double_rand_explicit_id": { - "kms": "gcp", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAABDSUZ+0BbDDEZxCXA+J2T6Js8Uor2dfXSf7s/hpLrg6dxcW2chpht9XLiLOXG5w83TzCAI5pF8cQgBpBpYjR8RQ==", - "subType": "06" - } - } - }, - "gcp_double_rand_explicit_altname": { - "kms": "gcp", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAABCYxugs7L+4S+1rr0VILSbtBm79JPTLuzluQAv0+8hbu5Z6zReOL6Ta1vQH1oA+pSPGYA4euye3zNl1X6ZewbPw==", - "subType": "06" - } - } - }, - "gcp_double_det_explicit_id": { - "kms": "gcp", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDouble": "1.2339999999999999858" - } - }, - "gcp_double_det_explicit_altname": { - "kms": "gcp", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDouble": "1.2339999999999999858" - } - }, - "gcp_string_rand_auto_id": { - "kms": "gcp", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAACx3wSslJEiD80YLTH0n4Bbs4yWVPQl15AU8pZMLLQePqEtI+BJy3t2bqNP1098jS0CGSf+LQmQvXhJn1aNFeMTw==", - "subType": "06" - } - } - }, - "gcp_string_rand_auto_altname": { - "kms": "gcp", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAC5BTe5KP5UxSIk6dJlkz8aaZ/9fg44XPWHafiiL/48lcv3AWbu2gcBo1EDuc1sJQu6XMrtDCRQ7PCHsL7sEQMGQ==", - "subType": "06" - } - } - }, - "gcp_string_rand_explicit_id": { - "kms": "gcp", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAACyJN55OcyXXJ71x8VphTaIuIg6kQtGgVKPhWx0LSdYc6JOjB6LTdA7SEWiSlSWWFZE26UmKcPbkbLDAYf4IVrzQ==", - "subType": "06" - } - } - }, - "gcp_string_rand_explicit_altname": { - "kms": "gcp", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAACoa0d9gqfPP5s3+GoruwzxoQFgli8SmjpTVRLAOcFxqGdfrwSbpYffSw/OR45sZPxXCL6T2MtUvZsl7ukv0jBnw==", - "subType": "06" - } - } - }, - "gcp_string_det_auto_id": { - "kms": "gcp", - "type": "string", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAACTCkyETcWayIZ9YEoQEBVIF3i7iXEe6M3KjYYaSVCYdqSbSHBzlwKWYbP+Xj/MMYBYTLZ1aiRQWCMK4gWPYppZw==", - "subType": "06" - } - } - }, - "gcp_string_det_explicit_id": { - "kms": "gcp", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAACTCkyETcWayIZ9YEoQEBVIF3i7iXEe6M3KjYYaSVCYdqSbSHBzlwKWYbP+Xj/MMYBYTLZ1aiRQWCMK4gWPYppZw==", - "subType": "06" - } - } - }, - "gcp_string_det_explicit_altname": { - "kms": "gcp", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAACTCkyETcWayIZ9YEoQEBVIF3i7iXEe6M3KjYYaSVCYdqSbSHBzlwKWYbP+Xj/MMYBYTLZ1aiRQWCMK4gWPYppZw==", - "subType": "06" - } - } - }, - "gcp_object_rand_auto_id": { - "kms": "gcp", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAADy+8fkyeNYdIK001YogXfKc25zRXS1VGIFVWR6jRfrexy9C8LBBfX3iDwGNPbP2pkC3Tq16OoziQB6iNGf7s7yg==", - "subType": "06" - } - } - }, - "gcp_object_rand_auto_altname": { - "kms": "gcp", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAADixoDdvm57gH8ooOaKI57WyZD5uaPmuYgmrgAFuV8I+oaalqYctnNSYlzQKCMQX/mIcTxvW3oOWY7+IzAz7npvw==", - "subType": "06" - } - } - }, - "gcp_object_rand_explicit_id": { - "kms": "gcp", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAADvq0OAoijgHaVMhsoNMdfWFLyISDo6Y13sYM0CoBXS/oXJNIJJvhgKPbFSV/h4IgiDLy4qNYOTJQvpqt094RPgQ==", - "subType": "06" - } - } - }, - "gcp_object_rand_explicit_altname": { - "kms": "gcp", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAADuTZF7/uqGjFbjzBYspPkxGWvvVAEN/ib8bfPOQrEobtTWuU+ju9H3TlT9DMuFy7RdUZnPB0D3HkM8+zky5xeBw==", - "subType": "06" - } - } - }, - "gcp_object_det_explicit_id": { - "kms": "gcp", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "gcp_object_det_explicit_altname": { - "kms": "gcp", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "gcp_array_rand_auto_id": { - "kms": "gcp", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAE085kJIBX6S93D94bcRjkOegEKsksi2R1cxoVDoOpSdHh3S6bZAOh50W405wvnOKf3KTP9SICDUehQKQZSC026Y5dwVQ2GiM7PtpSedthKJs=", - "subType": "06" - } - } - }, - "gcp_array_rand_auto_altname": { - "kms": "gcp", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAEk/FAXsaqyVr6I+MY5L0axeLhskcEfLZeB8whLMKbjLDLa8Iep+IdrFVSfKo03Zr/7Ah8Js01aT6+Vt4EDMJK0mGKZJOjsrAf3b6RS+Mzebg=", - "subType": "06" - } - } - }, - "gcp_array_rand_explicit_id": { - "kms": "gcp", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAEDY7J9JGiurctYr7ytakNjcryVm42fkubcVpQpUYEkpK/G9NLGjrJuFgNW5ZVjYiPKEBbDB7vEtJqGux0BU++hrvVHNJ3wUT2mbDE18NE4KE=", - "subType": "06" - } - } - }, - "gcp_array_rand_explicit_altname": { - "kms": "gcp", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAErFFlw8W9J2y+751RnYLw0TSK9ThD6sP3i4zPbZtiuhc90RFoJhScvqM9i4sDKuYePZZRLBxdX4EZhZClOmswCGDLCIWsQlSvCwgDcIsRR/w=", - "subType": "06" - } - } - }, - "gcp_array_det_explicit_id": { - "kms": "gcp", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "gcp_array_det_explicit_altname": { - "kms": "gcp", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "gcp_binData=00_rand_auto_id": { - "kms": "gcp", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAF0R5BNkQKfm6wx/tob8nVGDEYV/pvy9UeCqc9gFNuB5d9KxCkgyxryV65rbB90OriqvWFO2jcxzchRYgRI3fQ+A==", - "subType": "06" - } - } - }, - "gcp_binData=00_rand_auto_altname": { - "kms": "gcp", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAF4wcT8XGc3xNdKYDX5/cbUwPDdnkIXlWWCCYeSXSk2oWPxMZnPsVQ44nXKJJsKitoE3r/hL1sSG5239WzCWyx9g==", - "subType": "06" - } - } - }, - "gcp_binData=00_rand_explicit_id": { - "kms": "gcp", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAF07OFs5mlx0AB6QBanaybLuhuFbG+19KxSqHlSgELcz6TQKI6equX97OZdaWSWf2SSeiYm5E6+Y3lgA5l4KxC2A==", - "subType": "06" - } - } - }, - "gcp_binData=00_rand_explicit_altname": { - "kms": "gcp", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAFZ74Q7JMm7y2i3wRmjIRKefhmdnrhP1NXJgploi+44eQ2eRraZsW7peGPYyIfsXEbhgV5+aLmiYgvemBywfdogQ==", - "subType": "06" - } - } - }, - "gcp_binData=00_det_auto_id": { - "kms": "gcp", - "type": "binData=00", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAFhwJkocj36WXoY3mg2GWUrJ5IQTo9MvkwEwRFKdkcxm9pX2PZPK7bN5ZWw3IFcQ/0GfaW6V4LYr8WarZdLF0p5g==", - "subType": "06" - } - } - }, - "gcp_binData=00_det_explicit_id": { - "kms": "gcp", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAFhwJkocj36WXoY3mg2GWUrJ5IQTo9MvkwEwRFKdkcxm9pX2PZPK7bN5ZWw3IFcQ/0GfaW6V4LYr8WarZdLF0p5g==", - "subType": "06" - } - } - }, - "gcp_binData=00_det_explicit_altname": { - "kms": "gcp", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAFhwJkocj36WXoY3mg2GWUrJ5IQTo9MvkwEwRFKdkcxm9pX2PZPK7bN5ZWw3IFcQ/0GfaW6V4LYr8WarZdLF0p5g==", - "subType": "06" - } - } - }, - "gcp_binData=04_rand_auto_id": { - "kms": "gcp", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAFmDO47RTVXzm8D4hfhLICILrQJg3yOwG3HYfCdz7yaanPow2Y6bMxvXxk+kDS29aS8pJKDqJQQoMGc1ZFD3yYKsLQHRi/8rW6TNDQd4sCQ00=", - "subType": "06" - } - } - }, - "gcp_binData=04_rand_auto_altname": { - "kms": "gcp", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAFpiu9Q3LTuPmgdWBqo5Kw0vGF9xU1rMyE4xwR8GccZ7ZMrUcR4AnZnAP7ah5Oz8e7qonNYX4d09obesYSLlIjyK7J7qg+GWiEURgbvmOngaA=", - "subType": "06" - } - } - }, - "gcp_binData=04_rand_explicit_id": { - "kms": "gcp", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAFHRy8dveGuMng9WMmadIp39jD7iEfl3bEjKmzyNoAc0wIcSJZo9kdGbNEwZ4p+A1gz273fmAt/AJwAxwvqdlanLWBr4wiSKz1Mu9VaBcTlyY=", - "subType": "06" - } - } - }, - "gcp_binData=04_rand_explicit_altname": { - "kms": "gcp", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAFiqO+sKodqXuVox0zTbKuY4Ng0QE1If2hDLWXljAEZdYABPk20UJyL/CHR49WP2Cwvi4evJCf8sEfKpR+ugPiyxWzP3iVe6qqTzP93BBjqoc=", - "subType": "06" - } - } - }, - "gcp_binData=04_det_auto_id": { - "kms": "gcp", - "type": "binData=04", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAFEp5Gut6iENHUqDMVdBm4cxQy35gnslTf7vSWW9InFh323BvaTTiubxbxTiMKIa/u47MfMprL9HNQSwgpAQc4lped+YnlRW8RYvTcG4frFtA=", - "subType": "06" - } - } - }, - "gcp_binData=04_det_explicit_id": { - "kms": "gcp", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAFEp5Gut6iENHUqDMVdBm4cxQy35gnslTf7vSWW9InFh323BvaTTiubxbxTiMKIa/u47MfMprL9HNQSwgpAQc4lped+YnlRW8RYvTcG4frFtA=", - "subType": "06" - } - } - }, - "gcp_binData=04_det_explicit_altname": { - "kms": "gcp", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAFEp5Gut6iENHUqDMVdBm4cxQy35gnslTf7vSWW9InFh323BvaTTiubxbxTiMKIa/u47MfMprL9HNQSwgpAQc4lped+YnlRW8RYvTcG4frFtA=", - "subType": "06" - } - } - }, - "gcp_undefined_rand_explicit_id": { - "kms": "gcp", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "gcp_undefined_rand_explicit_altname": { - "kms": "gcp", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "gcp_undefined_det_explicit_id": { - "kms": "gcp", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "gcp_undefined_det_explicit_altname": { - "kms": "gcp", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "gcp_objectId_rand_auto_id": { - "kms": "gcp", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAH8Kt6coc8bPI4QIwS1tIdk6pPA05xlZvrOyAQgvoqaozMtWzG15OunQLDdS3yJ5WRiV7kO6CIKqRrvL2RykB5sw==", - "subType": "06" - } - } - }, - "gcp_objectId_rand_auto_altname": { - "kms": "gcp", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAHU5Yzmz2mbgNQrGSvglgVuv14nQWzipBkZUVSO4eYZ7wLrj/9t0fnizsu7Isgg5oA9fV0Snh/A9pDnHZWoccXUw==", - "subType": "06" - } - } - }, - "gcp_objectId_rand_explicit_id": { - "kms": "gcp", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAHsdq5/FLqbjMDiNzf+6k9yxUtFVjS/xSqErqaboOl21934pAzgkOzBGodpKKFuK0Ta4f3h21XS+84wlIYPMlTtw==", - "subType": "06" - } - } - }, - "gcp_objectId_rand_explicit_altname": { - "kms": "gcp", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAHokIdXxNQ/NBMdMAVNxyVuz/J5pMMdtfxxJxr7PbsRJ3FoD2QNjTgE1Wsz0G4o09Wv9UWD+/mIqPVlLgx1sRtPw==", - "subType": "06" - } - } - }, - "gcp_objectId_det_auto_id": { - "kms": "gcp", - "type": "objectId", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAHkcbaj3Hy3b4HkjRkMgiw5h6jBW7Sc56QSJmAPmVSc2T4B8d79A49dW0RyEiInZJcnVRjrYzUTRtgRaG4/FRd8g==", - "subType": "06" - } - } - }, - "gcp_objectId_det_explicit_id": { - "kms": "gcp", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAHkcbaj3Hy3b4HkjRkMgiw5h6jBW7Sc56QSJmAPmVSc2T4B8d79A49dW0RyEiInZJcnVRjrYzUTRtgRaG4/FRd8g==", - "subType": "06" - } - } - }, - "gcp_objectId_det_explicit_altname": { - "kms": "gcp", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAHkcbaj3Hy3b4HkjRkMgiw5h6jBW7Sc56QSJmAPmVSc2T4B8d79A49dW0RyEiInZJcnVRjrYzUTRtgRaG4/FRd8g==", - "subType": "06" - } - } - }, - "gcp_bool_rand_auto_id": { - "kms": "gcp", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAIf7vUYS5XFrEU4g03lzj9dk8a2MkaQdlH8nE/507D2Gm5XKQLi2jCENZ9UaQm3MQtVr4Uqrgz2GZiQHt9mXcG3w==", - "subType": "06" - } - } - }, - "gcp_bool_rand_auto_altname": { - "kms": "gcp", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAIdOC4Tx/TaVLRtOL/Qh8RUFIzHFB6nSegZoITwZeDethd8V3+R+aIAgzfN3pvmZzagHyVCm2nbNYJNdjOJhuDrg==", - "subType": "06" - } - } - }, - "gcp_bool_rand_explicit_id": { - "kms": "gcp", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAIzB14mX2vaZdiW9kGc+wYEgTCXA0FB5AVEyuERD00+K7U5Otlc6ZUwMtb9nGUu+M7PnnfxiDFHCrUWrTkAZzSUw==", - "subType": "06" - } - } - }, - "gcp_bool_rand_explicit_altname": { - "kms": "gcp", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAIhRLg79ACCMfeERBgG1wirirrZXZzbK11RxHkAbf14Fji2L3sdMBdLBU5I028+rmtDdC7khcNMt11V6XGKpAjnA==", - "subType": "06" - } - } - }, - "gcp_bool_det_explicit_id": { - "kms": "gcp", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": true - }, - "gcp_bool_det_explicit_altname": { - "kms": "gcp", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": true - }, - "gcp_date_rand_auto_id": { - "kms": "gcp", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAJL+mjI8xBmSahOOi3XkGRGxjhGNdJb445KZtRAaUdCV0vMKbrefuiDHJDPCYo7mLYNhRSIhQfs63IFYMrlKP26A==", - "subType": "06" - } - } - }, - "gcp_date_rand_auto_altname": { - "kms": "gcp", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAJbeyqO5FRmqvPYyOb0tdKtK6JOg8QKbCl37/iFeEm7N0T0Pjb8Io4U0ndB3O6fjokc3kDQrZcQkV+OFWIMuKFjw==", - "subType": "06" - } - } - }, - "gcp_date_rand_explicit_id": { - "kms": "gcp", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAJVz3rSYIcoYtM0tZ8pB2Ytgh8RvYPeZvW7aUVJfZkZlIhfUHOHEf5kHqxzt8E1l2n3lmK/7ZVCFUuCCmr8cZyWw==", - "subType": "06" - } - } - }, - "gcp_date_rand_explicit_altname": { - "kms": "gcp", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAJAiQqNyUcpuDEpFt7skp2NSHFCux2XObrIIFgXReYgtWoapL/n4zksJXl89PGavzNPBZbzgEa8uwwAe+S+Y6TLg==", - "subType": "06" - } - } - }, - "gcp_date_det_auto_id": { - "kms": "gcp", - "type": "date", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAJmATV2A1P5DmrS8uES6AMD9y+EU3x7u4K4J0p296iSkCEgIdZZORhPIEnuJK3FHw1II6IEShW2nd7sOJRZSGKcg==", - "subType": "06" - } - } - }, - "gcp_date_det_explicit_id": { - "kms": "gcp", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAJmATV2A1P5DmrS8uES6AMD9y+EU3x7u4K4J0p296iSkCEgIdZZORhPIEnuJK3FHw1II6IEShW2nd7sOJRZSGKcg==", - "subType": "06" - } - } - }, - "gcp_date_det_explicit_altname": { - "kms": "gcp", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAJmATV2A1P5DmrS8uES6AMD9y+EU3x7u4K4J0p296iSkCEgIdZZORhPIEnuJK3FHw1II6IEShW2nd7sOJRZSGKcg==", - "subType": "06" - } - } - }, - "gcp_null_rand_explicit_id": { - "kms": "gcp", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "gcp_null_rand_explicit_altname": { - "kms": "gcp", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "gcp_null_det_explicit_id": { - "kms": "gcp", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "gcp_null_det_explicit_altname": { - "kms": "gcp", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "gcp_regex_rand_auto_id": { - "kms": "gcp", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAALiebb3hWwJRqlgVEhLYKKvo6cnlU7BFnZnvlZ8GuIr11fUvcnS9Tg2m7vPmfL7WVyuNrXlR48x28Es49YuaxuIg==", - "subType": "06" - } - } - }, - "gcp_regex_rand_auto_altname": { - "kms": "gcp", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAALouDFNLVgBXqhJvBRj9DKacuD1AQ2NAVDW93P9NpZDFFwGOFxmKUcklbPj8KkHqvma8ovVUBTLLUDR+tKFRvC2Q==", - "subType": "06" - } - } - }, - "gcp_regex_rand_explicit_id": { - "kms": "gcp", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAALtdcT9+3R1he4eniT+1opqs/YtujFlqzBXssv+hCKhJQVY/IXde32nNpQ1WTgUc7jfIJl/v9HvuA9cDHPtDWWTg==", - "subType": "06" - } - } - }, - "gcp_regex_rand_explicit_altname": { - "kms": "gcp", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAALAwlRAlj4Zpn+wu9eOcs5CsNgrkVwrgmu1tc4wyQp0Lt+3UcplYsXQMrMPcTx3yB0JcI4Kh65n/DrAaA+G/a6iw==", - "subType": "06" - } - } - }, - "gcp_regex_det_auto_id": { - "kms": "gcp", - "type": "regex", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAALbCutQ7D94gk0djewcQiEdMFVVa21+Dn5enQf/mqPi3o7vPy7OejDBk9fiZRffsioRMhlx2cxqa8T3+AkeN96yg==", - "subType": "06" - } - } - }, - "gcp_regex_det_explicit_id": { - "kms": "gcp", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAALbCutQ7D94gk0djewcQiEdMFVVa21+Dn5enQf/mqPi3o7vPy7OejDBk9fiZRffsioRMhlx2cxqa8T3+AkeN96yg==", - "subType": "06" - } - } - }, - "gcp_regex_det_explicit_altname": { - "kms": "gcp", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAALbCutQ7D94gk0djewcQiEdMFVVa21+Dn5enQf/mqPi3o7vPy7OejDBk9fiZRffsioRMhlx2cxqa8T3+AkeN96yg==", - "subType": "06" - } - } - }, - "gcp_dbPointer_rand_auto_id": { - "kms": "gcp", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAMG8P+Y2YNIgknxE0/yPDCHASBvCU1IJwsEyaJPuOjn03enxEN7z/wbjVMN0lGUptDP3SVL+OIZtQ35VRP84MtnbdhcfZWqMhLjzrCjmtHUEg=", - "subType": "06" - } - } - }, - "gcp_dbPointer_rand_auto_altname": { - "kms": "gcp", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAMKCLFUN6ApB5fSVEWazRddhKTEwgqI/mxfe0BBxht69pZQYhTjhOJP0YcIrtr+RCeHOa4FIJgQod1CFOellIzO5YH5CuV4wPxCAlOdbJcBK8=", - "subType": "06" - } - } - }, - "gcp_dbPointer_rand_explicit_id": { - "kms": "gcp", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAM7ULEA6uKKv4Pu4Sa3aAt7dXtEwfQC98aJoLBapHT+xXtn5GWPynOZQNtV3lGaYExQjiGdYbzOcav3SVy/sYTe3ktgkQnuZfe0tk0zyvKIMM=", - "subType": "06" - } - } - }, - "gcp_dbPointer_rand_explicit_altname": { - "kms": "gcp", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAMoMveHO1MadAKuT498xiKWWBUKRbH7k7P2YETDg/BufVw0swos07rk6WJa1vqyF61QEmACjy4pmlK/5P0VfKJBAIvif51YqHPQkobJVS3nVA=", - "subType": "06" - } - } - }, - "gcp_dbPointer_det_auto_id": { - "kms": "gcp", - "type": "dbPointer", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAMz+9m1bE+Th9YeyPmJdtJPO0F5QYsGYtU/Eom/LSoYjDmTmV2ehkKx/cevIxJfZUc+Mvv/uGoeuubGl8tiX4l+f6yLrSIS6QBtIHYKXk+JNE=", - "subType": "06" - } - } - }, - "gcp_dbPointer_det_explicit_id": { - "kms": "gcp", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAMz+9m1bE+Th9YeyPmJdtJPO0F5QYsGYtU/Eom/LSoYjDmTmV2ehkKx/cevIxJfZUc+Mvv/uGoeuubGl8tiX4l+f6yLrSIS6QBtIHYKXk+JNE=", - "subType": "06" - } - } - }, - "gcp_dbPointer_det_explicit_altname": { - "kms": "gcp", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAMz+9m1bE+Th9YeyPmJdtJPO0F5QYsGYtU/Eom/LSoYjDmTmV2ehkKx/cevIxJfZUc+Mvv/uGoeuubGl8tiX4l+f6yLrSIS6QBtIHYKXk+JNE=", - "subType": "06" - } - } - }, - "gcp_javascript_rand_auto_id": { - "kms": "gcp", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAANqBD0ITMn4BaFnDp7BX7vXbRBkFwmjQRVUeBbwsQtv5WVlJMAd/2+w7tyH8Wc44x0/9U/DA5GVhpTrtdDyPBI3w==", - "subType": "06" - } - } - }, - "gcp_javascript_rand_auto_altname": { - "kms": "gcp", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAANtA0q4mbkAaKX4x1xk0/094Mln0wnh2bYnI6s6dh+l2WLDH7A9JMZxCl6kc4uOsEfbOvjP/PLIYtdMGs14EjM5A==", - "subType": "06" - } - } - }, - "gcp_javascript_rand_explicit_id": { - "kms": "gcp", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAANfrW3pmeiFdBFt5tJS6Auq9Wo/J4r/vMRiueLWxig5S1zYuf9kFPJMK/nN9HqQPIcBIJIC2i/uEPgeepaNXACCw==", - "subType": "06" - } - } - }, - "gcp_javascript_rand_explicit_altname": { - "kms": "gcp", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAANL7UZNzpwfwhRn/HflWIE9CSxGYNwLSo9d86HsOJ42rrZKq6HQqm/hiEAg0lyqCxVIVFxYEc2BUWSaq4/+SSyZw==", - "subType": "06" - } - } - }, - "gcp_javascript_det_auto_id": { - "kms": "gcp", - "type": "javascript", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAANB2d97R8nUJqnG0JPsWzyFe5pct5jvUljdkPnlZvLN1ZH+wSu4WmLfjri6IzzYP//f8tywn4Il+R4lZ0Kr/RAeA==", - "subType": "06" - } - } - }, - "gcp_javascript_det_explicit_id": { - "kms": "gcp", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAANB2d97R8nUJqnG0JPsWzyFe5pct5jvUljdkPnlZvLN1ZH+wSu4WmLfjri6IzzYP//f8tywn4Il+R4lZ0Kr/RAeA==", - "subType": "06" - } - } - }, - "gcp_javascript_det_explicit_altname": { - "kms": "gcp", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAANB2d97R8nUJqnG0JPsWzyFe5pct5jvUljdkPnlZvLN1ZH+wSu4WmLfjri6IzzYP//f8tywn4Il+R4lZ0Kr/RAeA==", - "subType": "06" - } - } - }, - "gcp_symbol_rand_auto_id": { - "kms": "gcp", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAOsGdnr6EKcBdOAvYrP0o1pWbhhJbYsqfVwwwS1zq6ZkBayOss2J3TuYwBGXhJFlq3iIiWLdxGQ883XIvuAECnqUNuvpK2rOLwtDg8xJLiH24=", - "subType": "06" - } - } - }, - "gcp_symbol_rand_auto_altname": { - "kms": "gcp", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAOpfa6CUSnJBvnWdd7pSZ2pXAbYm68Yka6xa/fuyhVx/Tc926/JpqmOmQtXqbOj8dZra0rQ3/yxHySwgD7s9Qr+xvyL7LvAguGkGmEV5H4Xz4=", - "subType": "06" - } - } - }, - "gcp_symbol_rand_explicit_id": { - "kms": "gcp", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAO085iqYGFdtjiFWHcNqE0HuKMNHmk49DVh+pX8Pb4p3ehB57JL1nRqaXqHPqhFenxSEInT/te9HQRr+ADcHADvUGsScfm/n85v85nq6X+5y4=", - "subType": "06" - } - } - }, - "gcp_symbol_rand_explicit_altname": { - "kms": "gcp", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAOiidb+2TsbAb2wc7MtDzb/UYsjgVNSw410Sz9pm+Uy7aZROE5SURKXdLjrCH2ZM2a+XCAl3o9yAoNgmAjEvYVxjmyzLK00EVjT42MBOrdA+k=", - "subType": "06" - } - } - }, - "gcp_symbol_det_auto_id": { - "kms": "gcp", - "type": "symbol", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAOFBGo77joqvZl7QQMB9ebMsAI3uro8ILQTJsTUgAqNzSh1mNzqihGHZYe84xtgMrVxNuwcjkidkRbNnLXWLuarOx4tgmOLx5A5G1eYEe3s7Q=", - "subType": "06" - } - } - }, - "gcp_symbol_det_explicit_id": { - "kms": "gcp", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAOFBGo77joqvZl7QQMB9ebMsAI3uro8ILQTJsTUgAqNzSh1mNzqihGHZYe84xtgMrVxNuwcjkidkRbNnLXWLuarOx4tgmOLx5A5G1eYEe3s7Q=", - "subType": "06" - } - } - }, - "gcp_symbol_det_explicit_altname": { - "kms": "gcp", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAOFBGo77joqvZl7QQMB9ebMsAI3uro8ILQTJsTUgAqNzSh1mNzqihGHZYe84xtgMrVxNuwcjkidkRbNnLXWLuarOx4tgmOLx5A5G1eYEe3s7Q=", - "subType": "06" - } - } - }, - "gcp_javascriptWithScope_rand_auto_id": { - "kms": "gcp", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAPUsQHeXWhdmyfQ2Sq1ev1HMuMhBTc/FZFKO9tMMcI9qzjr+z4IdCOFCcx24/T/6NCsDpMiOGNnCdaBCCNRwNM0CTIkpHNLO+RSZORDgAsm9Q=", - "subType": "06" - } - } - }, - "gcp_javascriptWithScope_rand_auto_altname": { - "kms": "gcp", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAPRZawtuu0gErebyFqiQw0LxniWhdeujGzaqfAXriGo/2fU7PalzTlWQa8wsv0y7Q/i1K4JbQwCEFpJWLppmtZshCGbVWjpPljB2BH4NNrLPE=", - "subType": "06" - } - } - }, - "gcp_javascriptWithScope_rand_explicit_id": { - "kms": "gcp", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAP0qkQjuKmKIqdrsrR9djxt+1jFlEL7K9bP1oz7QWuY38dZJOoGwa6G1bP4wDzjsucJLCEgU2IY+t7BHraBFXvR/Aar8ID5eXcvJ7iOPIyqUw=", - "subType": "06" - } - } - }, - "gcp_javascriptWithScope_rand_explicit_altname": { - "kms": "gcp", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAP6L41iuBWGLg3hQZuhXp4MupTQvIT07+/+CRY292sC02mehk5BkuSOEVrehlvyvBJFKia4Bqd/UWvY8PnUPLqFKTLnokONWbAuh36y3gjStw=", - "subType": "06" - } - } - }, - "gcp_javascriptWithScope_det_explicit_id": { - "kms": "gcp", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "gcp_javascriptWithScope_det_explicit_altname": { - "kms": "gcp", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "gcp_int_rand_auto_id": { - "kms": "gcp", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAQ+6oRKWMSvC+3UGrHSyGeVlR9bFnZtFTmYlUoGn04k6ndtCl8rsmBVUV6dMMYd7znnZtTSIGPI8q6jwf/NJjdIw==", - "subType": "06" - } - } - }, - "gcp_int_rand_auto_altname": { - "kms": "gcp", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAQnz5jAbrrdutTPFA4m3MvlVJr3bpurTKY5xjwO5k8DZpeWTJzr+kVEJjG6M8/RgC/0UFNgBBrDbDhYa8PZHRijw==", - "subType": "06" - } - } - }, - "gcp_int_rand_explicit_id": { - "kms": "gcp", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAQfRFoxUgjrv8up/eZ/fLlr/z++d/jFm30nYvKqsnQT7vkmmujJWc8yAtthR9OI6W5biBgAkounqRHhvatLZC6gA==", - "subType": "06" - } - } - }, - "gcp_int_rand_explicit_altname": { - "kms": "gcp", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAQY/ePk59RY6vLejx9a5ITwkT9000KAubVSqMoQwv7lNXO+GKZfZoLHG6k1MA/IxTvl1Zbz1Tw1bTctmj0HPEGNA==", - "subType": "06" - } - } - }, - "gcp_int_det_auto_id": { - "kms": "gcp", - "type": "int", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAQE9RVV9pOuysUUEGKq0u6ztFM0gTpoOHcHsTFQstA7+L9XTvxWEgL3RgNeq5KtKdODlxl62niV8dnQwlSoDSSWw==", - "subType": "06" - } - } - }, - "gcp_int_det_explicit_id": { - "kms": "gcp", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAQE9RVV9pOuysUUEGKq0u6ztFM0gTpoOHcHsTFQstA7+L9XTvxWEgL3RgNeq5KtKdODlxl62niV8dnQwlSoDSSWw==", - "subType": "06" - } - } - }, - "gcp_int_det_explicit_altname": { - "kms": "gcp", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAQE9RVV9pOuysUUEGKq0u6ztFM0gTpoOHcHsTFQstA7+L9XTvxWEgL3RgNeq5KtKdODlxl62niV8dnQwlSoDSSWw==", - "subType": "06" - } - } - }, - "gcp_timestamp_rand_auto_id": { - "kms": "gcp", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAARLnk1LpJIriKr6iiY1yBDGnfkRaHNwWcQyL+mORtYC4+AQ6oMv0qpGrJxS2QCbYY1tGmAISqZHCIExCG+TIv4bw==", - "subType": "06" - } - } - }, - "gcp_timestamp_rand_auto_altname": { - "kms": "gcp", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAARaqYXh9AVZI6gvRZrBwbprE5P3K5Qf4PIK1ca+mLRNOof0EExyAhtku7mYXusLeq0ww/tV6Zt1cA36KsT8a0Nog==", - "subType": "06" - } - } - }, - "gcp_timestamp_rand_explicit_id": { - "kms": "gcp", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAARLXzBjkCN8BpfXDIrb94kuZCD07Uo/DMBfMIWQtAb1++tTheUoY2ClQz33Luh4g8NXwuMJ7h8ufE70N2+b1yrUg==", - "subType": "06" - } - } - }, - "gcp_timestamp_rand_explicit_altname": { - "kms": "gcp", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAARe44QH9ZvTAuHsWhEMoue8eHod+cJpBm+Kl/Xtw7NI/6UTOOHC5Kkg20EvX3+GwXdAGk0bUSCFiTZb/yPox1OlA==", - "subType": "06" - } - } - }, - "gcp_timestamp_det_auto_id": { - "kms": "gcp", - "type": "timestamp", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAARzXjP6d6j/iQxiz1/TC/m+IfAGLFH9wY2ksS//i9x15QttlhcRrT3XmPvxaP5OjTHac4Gq3m2aXiJH56lETyl8A==", - "subType": "06" - } - } - }, - "gcp_timestamp_det_explicit_id": { - "kms": "gcp", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAARzXjP6d6j/iQxiz1/TC/m+IfAGLFH9wY2ksS//i9x15QttlhcRrT3XmPvxaP5OjTHac4Gq3m2aXiJH56lETyl8A==", - "subType": "06" - } - } - }, - "gcp_timestamp_det_explicit_altname": { - "kms": "gcp", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAARzXjP6d6j/iQxiz1/TC/m+IfAGLFH9wY2ksS//i9x15QttlhcRrT3XmPvxaP5OjTHac4Gq3m2aXiJH56lETyl8A==", - "subType": "06" - } - } - }, - "gcp_long_rand_auto_id": { - "kms": "gcp", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAASuGZs48eEyVBJ9vvM6cvRySfuR0WM4kL7lx52rSGXBKtkZywyP5rJwNtRn9WTBMDqc1O/4jUgYXpqHx39SLhUPA==", - "subType": "06" - } - } - }, - "gcp_long_rand_auto_altname": { - "kms": "gcp", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAS/62F71oKTX1GlvOP89uNhXpIyLZ5OdnuLeM/hvL5HWyOudSb06cG3+xnPg3QgppAYFK5X2PGgrEcrA87AykLPg==", - "subType": "06" - } - } - }, - "gcp_long_rand_explicit_id": { - "kms": "gcp", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAASSgx+p4YzTvjZ+GCZCFHEKHNXJUSloPnLRHE4iJ515Epb8Tox7h8/aIAkB3ulnDS9BiT5UKdye2TWf8OBEwkXzg==", - "subType": "06" - } - } - }, - "gcp_long_rand_explicit_altname": { - "kms": "gcp", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAAStqszyEfltpgd3aYeoyqaJX27OX861o06VhNX/N2fdSfKx0NQq/hWlWTkX6hK3hjCijiTtHmhFQR6QLkHD/6THw==", - "subType": "06" - } - } - }, - "gcp_long_det_auto_id": { - "kms": "gcp", - "type": "long", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAS0wJHtZKnxJlWnlSu0xuq7bZR25UdwcbdCRSaXBC0EXEFuqlzrZSn1lcwKPKGZQO8EQ6SdQDqK95alMLmM8eQrQ==", - "subType": "06" - } - } - }, - "gcp_long_det_explicit_id": { - "kms": "gcp", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAS0wJHtZKnxJlWnlSu0xuq7bZR25UdwcbdCRSaXBC0EXEFuqlzrZSn1lcwKPKGZQO8EQ6SdQDqK95alMLmM8eQrQ==", - "subType": "06" - } - } - }, - "gcp_long_det_explicit_altname": { - "kms": "gcp", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ARgjwAAAAAAAAAAAAAAAAAAS0wJHtZKnxJlWnlSu0xuq7bZR25UdwcbdCRSaXBC0EXEFuqlzrZSn1lcwKPKGZQO8EQ6SdQDqK95alMLmM8eQrQ==", - "subType": "06" - } - } - }, - "gcp_decimal_rand_auto_id": { - "kms": "gcp", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAATg4U3nbHBX/Az3ie2yurEIJO6cFryQWKiCpBbx1z0NF7RXd7kFC1XzaY6zcBjfl2AfRO8FFmgjTmFXb6gTRSSF0iAZJZTslfe3n6YFtwSKDI=", - "subType": "06" - } - } - }, - "gcp_decimal_rand_auto_altname": { - "kms": "gcp", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAATdSSyp0ewboV5zI3T3TV/FOrdx0UQbFHhqcH+yqpotoWPSw5dxE+BEoihYLeaPKuVU/rUIY4TUv05Egj7Ovg62Kpk3cPscxsGtE/T2Ppbt6o=", - "subType": "06" - } - } - }, - "gcp_decimal_rand_explicit_id": { - "kms": "gcp", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAATl7k20T22pf5Y9knVwIDyOIlbHyZBJqyi3Mai8APEZIYjpSKDKs8QNAH69CIjupyge8Izw4Cuch0bRrvMbp6YFfrUgk1JIQ4iLKkqqzHpBTY=", - "subType": "06" - } - } - }, - "gcp_decimal_rand_explicit_altname": { - "kms": "gcp", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AhgjwAAAAAAAAAAAAAAAAAATF7YLkhkuLhXdxrQk2fJTs128tRNYHeodkqw7ha/TxW3Czr5gE272gnkdzfNoS7uu9XwOr1yjrC6y/8gHALAWn77WvGrAlBktLQbIIinsuds=", - "subType": "06" - } - } - }, - "gcp_decimal_det_explicit_id": { - "kms": "gcp", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "gcp_decimal_det_explicit_altname": { - "kms": "gcp", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "gcp_minKey_rand_explicit_id": { - "kms": "gcp", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "gcp_minKey_rand_explicit_altname": { - "kms": "gcp", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "gcp_minKey_det_explicit_id": { - "kms": "gcp", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "gcp_minKey_det_explicit_altname": { - "kms": "gcp", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "gcp_maxKey_rand_explicit_id": { - "kms": "gcp", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "gcp_maxKey_rand_explicit_altname": { - "kms": "gcp", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "gcp_maxKey_det_explicit_id": { - "kms": "gcp", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "gcp_maxKey_det_explicit_altname": { - "kms": "gcp", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "kmip_double_rand_auto_id": { - "kms": "kmip", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAB1hL/nPkpQtqxQUANbIJr30PQ98vPvaoy4JWUoElOL+cCnrSra3o7W+12dydy0rCS2EKrVm7Fw0C8L9nf1hpWjw==", - "subType": "06" - } - } - }, - "kmip_double_rand_auto_altname": { - "kms": "kmip", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAABxlcphy2SxXlkRBvO1Z3nNUqchmeOhIhkdYBbbW7CwYeLVRDciXFsZN73Nb9Bm+W4IpUNpo6mqFEtfjevIjtFyg==", - "subType": "06" - } - } - }, - "kmip_double_rand_explicit_id": { - "kms": "kmip", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAABx5AfRSiblFc1DGwxRIaUSP2kaM76ryzPUKL9KnEgnX1kjIlFz5B15uMht2cxdrntHFe1qZZk8V9PxTBpWZhJ8Q==", - "subType": "06" - } - } - }, - "kmip_double_rand_explicit_altname": { - "kms": "kmip", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAABXUC9v9HPrmU9tINzFmr2sQM9f7GHDus+y5T4pWX28PRtfnTysN/ANCfB9RosoR/wuKsbznwwD2JfSzOvlKo3PQ==", - "subType": "06" - } - } - }, - "kmip_double_det_explicit_id": { - "kms": "kmip", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDouble": "1.2339999999999999858" - } - }, - "kmip_double_det_explicit_altname": { - "kms": "kmip", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDouble": "1.2339999999999999858" - } - }, - "kmip_string_rand_auto_id": { - "kms": "kmip", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAACGHmqW1qbfqVlfB0x0CkXCk9smhs3yXsxJ/8eypSgbDQqVLSW2nf5bbHpnoCHHNtQ7I7ZBXzPzDLH2GgMJpopeQ==", - "subType": "06" - } - } - }, - "kmip_string_rand_auto_altname": { - "kms": "kmip", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAC9BJTD1pEMbslAjbJYt7yx/jzKkcZF3axu96+NYwp8afUCjXG5TOUZzODOwkbJuWgr7DBxa2GkZTvaAEk86h+Ow==", - "subType": "06" - } - } - }, - "kmip_string_rand_explicit_id": { - "kms": "kmip", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAACQlG28ECy8KHXC7GEPdC8+raBo2RMJwl5pofcPaTGkPUEbkreguMd1mYctNb90vXxby1nNeJY4o5zJJCMiNhNXg==", - "subType": "06" - } - } - }, - "kmip_string_rand_explicit_altname": { - "kms": "kmip", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAACbWuK+3nzeKSNVjmgHb0Ii7rA+CsAd+gYubPiMiHXZwE/o6i9FYWN+t/VK3p4K0CwIi6q3cycrMb2IgcvM27Q7Q==", - "subType": "06" - } - } - }, - "kmip_string_det_auto_id": { - "kms": "kmip", - "type": "string", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAC5OZgr9keCXOIj5Fi06i4win1xt7gpsyPA4Os+HdFn1MIP9tnktvWNRb8Rqhuj2O9KO83brx74Hu3EQ4nT6uCMw==", - "subType": "06" - } - } - }, - "kmip_string_det_explicit_id": { - "kms": "kmip", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAC5OZgr9keCXOIj5Fi06i4win1xt7gpsyPA4Os+HdFn1MIP9tnktvWNRb8Rqhuj2O9KO83brx74Hu3EQ4nT6uCMw==", - "subType": "06" - } - } - }, - "kmip_string_det_explicit_altname": { - "kms": "kmip", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAC5OZgr9keCXOIj5Fi06i4win1xt7gpsyPA4Os+HdFn1MIP9tnktvWNRb8Rqhuj2O9KO83brx74Hu3EQ4nT6uCMw==", - "subType": "06" - } - } - }, - "kmip_object_rand_auto_id": { - "kms": "kmip", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAADh2nGqaAUwHDRVjqYpj8JAPH7scmiHp1Z9SGBZQ6Fapxm+zWDdTBHyitM9U69BctJ5DaaafyqFOj5yr6sJ+ebJQ==", - "subType": "06" - } - } - }, - "kmip_object_rand_auto_altname": { - "kms": "kmip", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAD1YhOKyNle4y0Qbeio1HlCULLeTCALCLgKSITd50bilD+oDyqQawixJAwphcdjhLdFzbFwst5RWqpsiWMPHx4hQ==", - "subType": "06" - } - } - }, - "kmip_object_rand_explicit_id": { - "kms": "kmip", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAADveILoWFgX7AhUWCv8UL52TUa75qHuoNadnTQydJlqd6PVmtRKj+8vS7VwxNWPaH4wB1Tk7emMyFEbZpvvzjxqQ==", - "subType": "06" - } - } - }, - "kmip_object_rand_explicit_altname": { - "kms": "kmip", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAADB/LN9V/4SROJn+ESHRLM7wwcUltQUx3+LbbYXjPDXiiV14HK76Iyy6ZxJ+M5qC9bRj3afhTKuWLBblB8WwksOg==", - "subType": "06" - } - } - }, - "kmip_object_det_explicit_id": { - "kms": "kmip", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "kmip_object_det_explicit_altname": { - "kms": "kmip", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "kmip_array_rand_auto_id": { - "kms": "kmip", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAEasWXQam8XtOkSO0nEttMCQ0iZ4V8DDmhMKyQDFDsiNHyF2h98Ya/xFv4ZSlbpGWXPBvBATEGgov/PDg2vhVi53y4Pk33RHfY60hABuksp3o=", - "subType": "06" - } - } - }, - "kmip_array_rand_auto_altname": { - "kms": "kmip", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAEj3A1DYSEHm/3SlEmusA+pewxRPUoZ2NAjs60ioEBlCw9n6yiiB+X8d/w40TKsjZcOSfh05NC0z3gnpqQvrNolkxkvi9dmFiZeiiv5vBZUPI=", - "subType": "06" - } - } - }, - "kmip_array_rand_explicit_id": { - "kms": "kmip", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAEqeJW+L6lP0bn5QcD0FMI0C8vv2n5kV7SKgqKi1o5mxaxmp3Cjlspf7yumfSiQ5js6G9yJVAvHuxlqv14UFyR9RgXS0PIA8WzsAqkL0sJSw0=", - "subType": "06" - } - } - }, - "kmip_array_rand_explicit_altname": { - "kms": "kmip", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAEnPlPwy0B1VKuNum1GzkZwQjZia5jNYL5bf/k+PbfhnToTRWGxx8+E3R7XXp6YT/rFkjPlzU8ww9+iZNo2oqNpYuHdrIC8ybhO6HZAlvcERo=", - "subType": "06" - } - } - }, - "kmip_array_det_explicit_id": { - "kms": "kmip", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "kmip_array_det_explicit_altname": { - "kms": "kmip", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "kmip_binData=00_rand_auto_id": { - "kms": "kmip", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAFliNDZ6DmjoVcYQBCKDI9njpBsDELg+TD6XLF7xbZnMaJCCHLHr7w3x2/xFfrFSN44CtGAKOniYPCMAspaxHqOA==", - "subType": "06" - } - } - }, - "kmip_binData=00_rand_auto_altname": { - "kms": "kmip", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAF/P8LPmHKGgG0l5/Xi7jdkwfxpGPxoY0417suCvN6zjM3JNdufytzkektrm9CbBb1SnZCGYF9c0FCMzFG+tN/dg==", - "subType": "06" - } - } - }, - "kmip_binData=00_rand_explicit_id": { - "kms": "kmip", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAFWI0N4RbnYdEiFrzNpbRN9p+bSLm8Lthiu4K3/CvBg6GQpLMVQFhjW01Bud0lxpT2ohRnOK+ASUhiFcUU/t/lWQ==", - "subType": "06" - } - } - }, - "kmip_binData=00_rand_explicit_altname": { - "kms": "kmip", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAFQZvAtpY4cjEr1rJWVoUGaZKmzocSJ0muHose7Tk5kRDczjFa4Jcu4hN7JLM9qz2z4g+WJC3KQTdW4ZBXStke/Q==", - "subType": "06" - } - } - }, - "kmip_binData=00_det_auto_id": { - "kms": "kmip", - "type": "binData=00", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAFohIHrvzu8xLxVHsnYEDhZmv8BpEoEtFSjMUQzvBLUInvvTuU/rOzlVL88CkAEII7M3hcvrz8FKY7b7lC1veoYg==", - "subType": "06" - } - } - }, - "kmip_binData=00_det_explicit_id": { - "kms": "kmip", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAFohIHrvzu8xLxVHsnYEDhZmv8BpEoEtFSjMUQzvBLUInvvTuU/rOzlVL88CkAEII7M3hcvrz8FKY7b7lC1veoYg==", - "subType": "06" - } - } - }, - "kmip_binData=00_det_explicit_altname": { - "kms": "kmip", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAFohIHrvzu8xLxVHsnYEDhZmv8BpEoEtFSjMUQzvBLUInvvTuU/rOzlVL88CkAEII7M3hcvrz8FKY7b7lC1veoYg==", - "subType": "06" - } - } - }, - "kmip_binData=04_rand_auto_id": { - "kms": "kmip", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAFn7rhdO8tYq77uVxcqd9Qjz84Yg7JnJMYf0ULTMTh1vJHacckkhXw+8fIMMiAKwuOVwGkMAtu5RBvrFqdfxryCg8RLTxu1YYVthufiClEIS0=", - "subType": "06" - } - } - }, - "kmip_binData=04_rand_auto_altname": { - "kms": "kmip", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAFwwXQx9dKyoyHq7GBMmHzYe9ysoJK/f/ZWzA6nErau9MtX1gqi7VRsYqkamb47/zVbsLZwPMmdgNyPxEh3kqbV2D61t5RG2A3VeqhO1pTF8c=", - "subType": "06" - } - } - }, - "kmip_binData=04_rand_explicit_id": { - "kms": "kmip", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAFALeGeinJ8DE+WZniLdCIW2gfJUj445Ukp9PvRLgBXLGedl8mIXlLF2eu3BA9vP6s5y9w6peQjhn+oEofrsUVYD2duyzeIRMKgNiNchjf6TU=", - "subType": "06" - } - } - }, - "kmip_binData=04_rand_explicit_altname": { - "kms": "kmip", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAF06Fx8CO3OSKE3fGri0VwK0e22YiG9LH2QkDTsRdFbT2lBm+bDD9FrEY8vKWS5RljMuysaxjBOzZ98d2LEs6k8LMOm83Nz/RESe4ZbbcfdQ0=", - "subType": "06" - } - } - }, - "kmip_binData=04_det_auto_id": { - "kms": "kmip", - "type": "binData=04", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAFzmZI909fJgxOykJtvOlv5LsX8z6BxUX2Xg5TsIwOxJMPSC8usm/zR7sZawoVBOuJxtNVLY/8oNP/4pFtAmQo02bUOtTo1yxNz/IZa9x+Q5E=", - "subType": "06" - } - } - }, - "kmip_binData=04_det_explicit_id": { - "kms": "kmip", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAFzmZI909fJgxOykJtvOlv5LsX8z6BxUX2Xg5TsIwOxJMPSC8usm/zR7sZawoVBOuJxtNVLY/8oNP/4pFtAmQo02bUOtTo1yxNz/IZa9x+Q5E=", - "subType": "06" - } - } - }, - "kmip_binData=04_det_explicit_altname": { - "kms": "kmip", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAFzmZI909fJgxOykJtvOlv5LsX8z6BxUX2Xg5TsIwOxJMPSC8usm/zR7sZawoVBOuJxtNVLY/8oNP/4pFtAmQo02bUOtTo1yxNz/IZa9x+Q5E=", - "subType": "06" - } - } - }, - "kmip_undefined_rand_explicit_id": { - "kms": "kmip", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "kmip_undefined_rand_explicit_altname": { - "kms": "kmip", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "kmip_undefined_det_explicit_id": { - "kms": "kmip", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "kmip_undefined_det_explicit_altname": { - "kms": "kmip", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "kmip_objectId_rand_auto_id": { - "kms": "kmip", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAHZFzE908RuO5deEt3t2QQdT12ybwqbm8D+sMJrdKt2Wp4kVPsw4ocAGGsRYN6VXe46P5fmyG5HqVWn0hkflZnQg==", - "subType": "06" - } - } - }, - "kmip_objectId_rand_auto_altname": { - "kms": "kmip", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAH3dPKyCCStvOtVGzlgIS33fsl8OAwQblt9i21pOVuLiliY1Tup9EtkSic88+nNEtXnq9gRknRzLthXv/k1ql+7Q==", - "subType": "06" - } - } - }, - "kmip_objectId_rand_explicit_id": { - "kms": "kmip", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAHcEjxVfHDSfLzFxAuK/rs/Pn/XV7jLkgKXZYeY0PNlRi1MHojN2AvQqI3J2rOvAjuYfikGcpvGPp/goqUbV9HYw==", - "subType": "06" - } - } - }, - "kmip_objectId_rand_explicit_altname": { - "kms": "kmip", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAHX65sNHnRYpx3VbWPCdQyFe7u0Y5ItabLEduqDeVsPk/iK4X3GjCSHQfw1yPi+CA+/veVpgdonwws6RiYV4ZZ5Q==", - "subType": "06" - } - } - }, - "kmip_objectId_det_auto_id": { - "kms": "kmip", - "type": "objectId", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAHKU7mcdGEq2WGrDB6TicipLQstAk6G3PkiNt5F3bMavpKLjz04UBrd8aWGVG2gJTTON1UKRztiYFgRvb8f+LK/Q==", - "subType": "06" - } - } - }, - "kmip_objectId_det_explicit_id": { - "kms": "kmip", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAHKU7mcdGEq2WGrDB6TicipLQstAk6G3PkiNt5F3bMavpKLjz04UBrd8aWGVG2gJTTON1UKRztiYFgRvb8f+LK/Q==", - "subType": "06" - } - } - }, - "kmip_objectId_det_explicit_altname": { - "kms": "kmip", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAHKU7mcdGEq2WGrDB6TicipLQstAk6G3PkiNt5F3bMavpKLjz04UBrd8aWGVG2gJTTON1UKRztiYFgRvb8f+LK/Q==", - "subType": "06" - } - } - }, - "kmip_bool_rand_auto_id": { - "kms": "kmip", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAIw/xgJlKEvErmVtue3X3RFsOI2sttAbxnzh1INc9GUQ2vok1VwYt9k88RxMPiOwMAZG7P1MlAdx7zt865onPKOw==", - "subType": "06" - } - } - }, - "kmip_bool_rand_auto_altname": { - "kms": "kmip", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAIn8IuzlNHbpTgXOd1wEp364zJOBxj2Zf7a9B5osUV1sDY0G1OVpEnuDvZeUsdiUSyRjTTxzyuD/KZlKZ3+qrnrA==", - "subType": "06" - } - } - }, - "kmip_bool_rand_explicit_id": { - "kms": "kmip", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAI3Nz9PdjUYQRGfTtvYSR8EQuUKFL0wdlEdfSCTBmMBhBPuuF9KxqCgy+ldVu1DRRgg3346DOKEEtE9BJPPInJ6Q==", - "subType": "06" - } - } - }, - "kmip_bool_rand_explicit_altname": { - "kms": "kmip", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAIEGjqoerIZBk8Rw+YTO7jFKWzagDS8mEpD+9Wm1Q0r0ZHUmV0dQZcIqRV4oUk8U8uHUn0N3t2qGLr+rhUs4GH/g==", - "subType": "06" - } - } - }, - "kmip_bool_det_explicit_id": { - "kms": "kmip", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": true - }, - "kmip_bool_det_explicit_altname": { - "kms": "kmip", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": true - }, - "kmip_date_rand_auto_id": { - "kms": "kmip", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAJgr0v4xetUXjlLcPcyKv/rzjtWOKp9CZJcm23Noglu5RR/rXJS0qKI+W9MmJ64TMf27KvaJ0UXwfTRrvOC1plCg==", - "subType": "06" - } - } - }, - "kmip_date_rand_auto_altname": { - "kms": "kmip", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAJoeysAaiPsVK+JL1P1vD/9xF92m5kKidUdn6yklPlSKN4VVEBTymDetTLujULs1u1TlrS71jVLxo3xEwpG/KQvg==", - "subType": "06" - } - } - }, - "kmip_date_rand_explicit_id": { - "kms": "kmip", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAJVwu4+Su0DktpnZvzTBHYpWbWTq5gho/SLijrcIrFJcvq4YrjjPCXv+odCl95tkH+J1RlJdQ5Cr0umEIazLa6GA==", - "subType": "06" - } - } - }, - "kmip_date_rand_explicit_altname": { - "kms": "kmip", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAJWTYpjbDkIf82QXHMGrvd0SqhP8cBIakfYJf5aNcNrs86vxRhiG3KwETWPeOOlPZ6n1WjE2bOLB+DJTAxmJvahA==", - "subType": "06" - } - } - }, - "kmip_date_det_auto_id": { - "kms": "kmip", - "type": "date", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAJ/+sQrUqQh+JADSVIKM0d68gDUhDy37M1z1uvROzQw6hUAbQeD0DWdztADKg560UTPM4uOgH4NAyhLyBLMrWWHg==", - "subType": "06" - } - } - }, - "kmip_date_det_explicit_id": { - "kms": "kmip", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAJ/+sQrUqQh+JADSVIKM0d68gDUhDy37M1z1uvROzQw6hUAbQeD0DWdztADKg560UTPM4uOgH4NAyhLyBLMrWWHg==", - "subType": "06" - } - } - }, - "kmip_date_det_explicit_altname": { - "kms": "kmip", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAJ/+sQrUqQh+JADSVIKM0d68gDUhDy37M1z1uvROzQw6hUAbQeD0DWdztADKg560UTPM4uOgH4NAyhLyBLMrWWHg==", - "subType": "06" - } - } - }, - "kmip_null_rand_explicit_id": { - "kms": "kmip", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "kmip_null_rand_explicit_altname": { - "kms": "kmip", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "kmip_null_det_explicit_id": { - "kms": "kmip", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "kmip_null_det_explicit_altname": { - "kms": "kmip", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "kmip_regex_rand_auto_id": { - "kms": "kmip", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAALi8avMfpxSlDsSTqdxO8O2B1M79gOElyUIdXySQo7mvgHlf4oHQ7r94lL9dnsA2t/jmUmBKoGypaUQUSQE+9x+A==", - "subType": "06" - } - } - }, - "kmip_regex_rand_auto_altname": { - "kms": "kmip", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAALfHerZ/KolaBrb5qi3SpeNVW+i/nh5mkcdtQg5f1pHePr68KryHucM/XDAzbMqrPlag2/41STGYdJqzYO7Mbppg==", - "subType": "06" - } - } - }, - "kmip_regex_rand_explicit_id": { - "kms": "kmip", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAALOhKDVAN5cuDyB1EuRFWgKKt0wGJ63E5pPY8Tq2TXMNgCxUUc5O+TE+Ux4ls/uMyOBA3gPzND0CZKiru0i7ACUQ==", - "subType": "06" - } - } - }, - "kmip_regex_rand_explicit_altname": { - "kms": "kmip", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAALK3Hg8xX9gX+d3vKh7aosRP9CS2CIFeG9sapZv3OAPv1eWjY62Cp/G16kJ0BQt33RYD+DzD3gWupfUSyNZR0gng==", - "subType": "06" - } - } - }, - "kmip_regex_det_auto_id": { - "kms": "kmip", - "type": "regex", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAALaQXA8rItT7ELVxO8XtAWdHuiXFFPmnMhS5PMrUy/6mRtbq4fvU9dascW7ozonKOh8ad6+MIT7B/STv9dVBF4Kw==", - "subType": "06" - } - } - }, - "kmip_regex_det_explicit_id": { - "kms": "kmip", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAALaQXA8rItT7ELVxO8XtAWdHuiXFFPmnMhS5PMrUy/6mRtbq4fvU9dascW7ozonKOh8ad6+MIT7B/STv9dVBF4Kw==", - "subType": "06" - } - } - }, - "kmip_regex_det_explicit_altname": { - "kms": "kmip", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAALaQXA8rItT7ELVxO8XtAWdHuiXFFPmnMhS5PMrUy/6mRtbq4fvU9dascW7ozonKOh8ad6+MIT7B/STv9dVBF4Kw==", - "subType": "06" - } - } - }, - "kmip_dbPointer_rand_auto_id": { - "kms": "kmip", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAMoGkfmmUWTI+0aW7jVyCJ5Dgru1SCXBUmJSRzDL0D57pNruQ+79tVVcI6Uz5j87DhZFxShHbPjj583vLOOBNM3WGzZCpqH3serhHTWvXK+NM=", - "subType": "06" - } - } - }, - "kmip_dbPointer_rand_auto_altname": { - "kms": "kmip", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAMwu1WaRhhv43xgxLNxuenbND9M6mxGtCs9o4J5+yfL95XNB9Daie3RcLlyngz0pncBie6IqjhTycXsxTLQ94Jdg6m5GD5cU541LYKvhbv5f4=", - "subType": "06" - } - } - }, - "kmip_dbPointer_rand_explicit_id": { - "kms": "kmip", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAM+CIoCAisUwhhJtWQLolxQGQWafniwYyvaJQHmJC94Uwbf1gPfhMR42v2VtrmIVP0J0BaP/xf0cco2/qWRdKGZpgkK2CK6M972NtnZ/2x03A=", - "subType": "06" - } - } - }, - "kmip_dbPointer_rand_explicit_altname": { - "kms": "kmip", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAMjbeE9+EaJYjGfeAuxsV8teOdsW8bfnlkvji/tE11Zq89UMGx+oUsZzeLjUgVZ5nxsZKCZjEAq+DPnwFVC+MgqNeqWL7fRChODFlPGH2ZC+8=", - "subType": "06" - } - } - }, - "kmip_dbPointer_det_auto_id": { - "kms": "kmip", - "type": "dbPointer", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAM5B+fjbjYCZzCYUu4N/pJI3srCCXN+OCCHweeweqmpIEmB7yw87bQRIMGtCm6HuekcZ5J5q+nY5AQb0du/wh1YIoOrC3u4w7ZcLHkDmuAJPg=", - "subType": "06" - } - } - }, - "kmip_dbPointer_det_explicit_id": { - "kms": "kmip", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAM5B+fjbjYCZzCYUu4N/pJI3srCCXN+OCCHweeweqmpIEmB7yw87bQRIMGtCm6HuekcZ5J5q+nY5AQb0du/wh1YIoOrC3u4w7ZcLHkDmuAJPg=", - "subType": "06" - } - } - }, - "kmip_dbPointer_det_explicit_altname": { - "kms": "kmip", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAM5B+fjbjYCZzCYUu4N/pJI3srCCXN+OCCHweeweqmpIEmB7yw87bQRIMGtCm6HuekcZ5J5q+nY5AQb0du/wh1YIoOrC3u4w7ZcLHkDmuAJPg=", - "subType": "06" - } - } - }, - "kmip_javascript_rand_auto_id": { - "kms": "kmip", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAANuzlkWs/c8xArrAxPgYuCeShjj1zCfIMHOTPohspcyNofo9iY3P5MlhEOprZDiS8dBFg6EB7fZDzDdczx6VCN2A==", - "subType": "06" - } - } - }, - "kmip_javascript_rand_auto_altname": { - "kms": "kmip", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAANwJ72y7UqCBJh1NwVRiE3vU1ex7FMv/X5YWCMuO9MHPMo4g1V5eaO4KfOr+K8+9NtkflgMpeDkvwP92rfR5ud5Q==", - "subType": "06" - } - } - }, - "kmip_javascript_rand_explicit_id": { - "kms": "kmip", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAANj5q+888itRnLsw9PNGsBLhgqpvem5IJBOE2292r6zwjVueoEK/2I2PesRnn0esnkwdia1ADoMkcLUegwcFRkWQ==", - "subType": "06" - } - } - }, - "kmip_javascript_rand_explicit_altname": { - "kms": "kmip", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAANnvbnmApys7OIe8LGTsZKDG1F1G1SI/rfZVmF6q1fq5U7feYPp1ejb2t2S2+v7LfcOHytsQWGcYuWCDcl+vosvQ==", - "subType": "06" - } - } - }, - "kmip_javascript_det_auto_id": { - "kms": "kmip", - "type": "javascript", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAANOR9R/Da8j5iVxllLiGFlv4U/bVn/PyN9/5WeGJkGJeE/j/osKrKx6IL1igI0YVI+pKKzsINqJGIv+bJX0s7MNw==", - "subType": "06" - } - } - }, - "kmip_javascript_det_explicit_id": { - "kms": "kmip", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAANOR9R/Da8j5iVxllLiGFlv4U/bVn/PyN9/5WeGJkGJeE/j/osKrKx6IL1igI0YVI+pKKzsINqJGIv+bJX0s7MNw==", - "subType": "06" - } - } - }, - "kmip_javascript_det_explicit_altname": { - "kms": "kmip", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAANOR9R/Da8j5iVxllLiGFlv4U/bVn/PyN9/5WeGJkGJeE/j/osKrKx6IL1igI0YVI+pKKzsINqJGIv+bJX0s7MNw==", - "subType": "06" - } - } - }, - "kmip_symbol_rand_auto_id": { - "kms": "kmip", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAOe+vXpJSkmBM3WkxZrn4ea9/C6iNyMXWUzkQIzIYlnbkyu8od8nfOdhobUhoFxcKnvdaxN1s5NhJ1FA97RN/upGYN+AI/7cTCElmFSpdSvkI=", - "subType": "06" - } - } - }, - "kmip_symbol_rand_auto_altname": { - "kms": "kmip", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAOPpCgK6Hc/M2elOJkwIU9J7PZa+h1chody2yvfDu/UlB6T5sxnEZ6aEY/ISNLhJlhsRzuApSgFOmnrcG6Eg9VnSKin2yK0ll+VFxQEDHAcSA=", - "subType": "06" - } - } - }, - "kmip_symbol_rand_explicit_id": { - "kms": "kmip", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAOVoHX9GaOn71L5D9TpZmmxkx/asr0FHCLG5ZgLLA04yIhZHsDjt2DiVGGO/Mf4KwvoBn7Cf08qMhW7rQh2LgvvSLBO3zbw5l+MZ/bSn+Jylo=", - "subType": "06" - } - } - }, - "kmip_symbol_rand_explicit_altname": { - "kms": "kmip", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAOPobmcO/I4QObtCUEmGWpSCJ6tlYyhbO59q78LZBucSNl7DSkf/13tOJ9t+WKXACcMKVMmfPoFsgHbVj1nKWULBT07n1OWWDTZkuMD6C2+Fc=", - "subType": "06" - } - } - }, - "kmip_symbol_det_auto_id": { - "kms": "kmip", - "type": "symbol", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAOPpwX4mafoQJYHuzYfbKW1JunpjpB7Nd2slTC3n8Hsas9wQYf9VkModQhe5M4wZHOIXpehaODRcjKKfKRmpnNBOURSLm/ORJvy+UxtSLsnqo=", - "subType": "06" - } - } - }, - "kmip_symbol_det_explicit_id": { - "kms": "kmip", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAOPpwX4mafoQJYHuzYfbKW1JunpjpB7Nd2slTC3n8Hsas9wQYf9VkModQhe5M4wZHOIXpehaODRcjKKfKRmpnNBOURSLm/ORJvy+UxtSLsnqo=", - "subType": "06" - } - } - }, - "kmip_symbol_det_explicit_altname": { - "kms": "kmip", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAOPpwX4mafoQJYHuzYfbKW1JunpjpB7Nd2slTC3n8Hsas9wQYf9VkModQhe5M4wZHOIXpehaODRcjKKfKRmpnNBOURSLm/ORJvy+UxtSLsnqo=", - "subType": "06" - } - } - }, - "kmip_javascriptWithScope_rand_auto_id": { - "kms": "kmip", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAPW2VMMm+EvsYpVtJQhsxgxgvV35kr9nxqKxP2qqIOAOQ58R/1oyYScFkNwB/tw0A1/zdvhoo+ERa7c0tjLIojFrosXhX2N/8Z4VnbZruz0Nk=", - "subType": "06" - } - } - }, - "kmip_javascriptWithScope_rand_auto_altname": { - "kms": "kmip", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAPjPq9BQR4EwG/CD+RthOJY04m99LCl/shY6HnaU/QL627kN1dbBAG5vs+MXfa+glg8waVTNgB94vm3j72FMV1ZOKvbl4faWF1Rl2EOpOlR9U=", - "subType": "06" - } - } - }, - "kmip_javascriptWithScope_rand_explicit_id": { - "kms": "kmip", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAPtqebrCAidKzBMvp3B5/vBeetqeCoMKS+vo+hLAYooXrnBunWxwRHpr45XYUvroG3aqOMkLtVZSgw8sO6Y/3z1viO2G0sGQW1ZMoW0/PX5Uw=", - "subType": "06" - } - } - }, - "kmip_javascriptWithScope_rand_explicit_altname": { - "kms": "kmip", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAPtkJwXKlq8Fx1f1+9HFofM4uKi6lHQRFRyiOyUFJYxxZY1LR/2WXXTqWz3MWtrcJFCB+QSVOb1N/ieC7AZUboPgIuPJISM3Hu5VU2x/Isbdc=", - "subType": "06" - } - } - }, - "kmip_javascriptWithScope_det_explicit_id": { - "kms": "kmip", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "kmip_javascriptWithScope_det_explicit_altname": { - "kms": "kmip", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "kmip_int_rand_auto_id": { - "kms": "kmip", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAQ50kE7Tby9od2OsmIGZhp9k/mj4vy/YdnmF6YsSPxihbjV1vXGMraI/nGCr+0H1riwzq3m4sCT7aPw2VgiuwKMA==", - "subType": "06" - } - } - }, - "kmip_int_rand_auto_altname": { - "kms": "kmip", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAQkNL14OSMX/bJbsLtB/UumRoat6QOY7fvwZxRrkXTS3VJVHigthI1cUX7Is/uUsY8oHOfk/ZuHklQkifmfdcklQ==", - "subType": "06" - } - } - }, - "kmip_int_rand_explicit_id": { - "kms": "kmip", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAQtN2gNVU9Itoj+vgcK/4jEB5baSUH+Qz2WqTY7m0XaA3bPWGFCiWY4Sdw+qovednrSSSbC+azWi1QYclFRraldQ==", - "subType": "06" - } - } - }, - "kmip_int_rand_explicit_altname": { - "kms": "kmip", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAQk6uBqwXXFF9zEM4bc124goI3pBy2Jdi8Cd0ycKkjXrPG7GVCUm2UMbO+zEzYODeVo35N11g2yMXcv9RVgjWtNA==", - "subType": "06" - } - } - }, - "kmip_int_det_auto_id": { - "kms": "kmip", - "type": "int", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAQgrkPEf+RBZMn/J7HZObqEfus8icYls6ecaUrlabI6v1ALgxLuv23WSIfTr6mqpQCounqdA14DWS/Wl3kSkVC0w==", - "subType": "06" - } - } - }, - "kmip_int_det_explicit_id": { - "kms": "kmip", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAQgrkPEf+RBZMn/J7HZObqEfus8icYls6ecaUrlabI6v1ALgxLuv23WSIfTr6mqpQCounqdA14DWS/Wl3kSkVC0w==", - "subType": "06" - } - } - }, - "kmip_int_det_explicit_altname": { - "kms": "kmip", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAQgrkPEf+RBZMn/J7HZObqEfus8icYls6ecaUrlabI6v1ALgxLuv23WSIfTr6mqpQCounqdA14DWS/Wl3kSkVC0w==", - "subType": "06" - } - } - }, - "kmip_timestamp_rand_auto_id": { - "kms": "kmip", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAAR2Cu3o2e/u5o69MndeZPJU5ngVA1G2MNYn00t+up/GlmaUC1ni1CVl0ZR0EVZ0gCDUrfxwPISPib8y23tNjbsog==", - "subType": "06" - } - } - }, - "kmip_timestamp_rand_auto_altname": { - "kms": "kmip", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAARgi8stgSQwqnN4Ws2ZBILOREsjreZcS1MBerL7dbGLVfzW99tqECglhGokkrE0aY69L0xMgcAUIaFRN4GanQAPg==", - "subType": "06" - } - } - }, - "kmip_timestamp_rand_explicit_id": { - "kms": "kmip", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAARPxEEI8L5Q3Jybu88BLdf31T3uYEUbijgSlKlkTt141RYrlE8nxtiYU5/5H9GXBis0Qq1s2C+MauD2h/cNijTCA==", - "subType": "06" - } - } - }, - "kmip_timestamp_rand_explicit_altname": { - "kms": "kmip", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAARh/QaU1dnGbii4LtXCpT5o6vencc8E2fzarjJFbSEd0ixW/UV1ppZdvD729d0umkaIwIEVA4q+XVvHfl/ckKPFg==", - "subType": "06" - } - } - }, - "kmip_timestamp_det_auto_id": { - "kms": "kmip", - "type": "timestamp", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAARqdpLb72mmzb75QBrE+ATMfS5LLqzAD/1g5ScT8zfgh0IHsZZBWCJlSVRNC12Sgr3zdXHMtYp8C3OZT6/tPkQGg==", - "subType": "06" - } - } - }, - "kmip_timestamp_det_explicit_id": { - "kms": "kmip", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAARqdpLb72mmzb75QBrE+ATMfS5LLqzAD/1g5ScT8zfgh0IHsZZBWCJlSVRNC12Sgr3zdXHMtYp8C3OZT6/tPkQGg==", - "subType": "06" - } - } - }, - "kmip_timestamp_det_explicit_altname": { - "kms": "kmip", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAARqdpLb72mmzb75QBrE+ATMfS5LLqzAD/1g5ScT8zfgh0IHsZZBWCJlSVRNC12Sgr3zdXHMtYp8C3OZT6/tPkQGg==", - "subType": "06" - } - } - }, - "kmip_long_rand_auto_id": { - "kms": "kmip", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAASVv+ClXkh9spIaXWJYRV/o8UZjG+WWWrNpIjZ9LQn2bXakrKJ3REvdkrzGuxASmBhBYTplEyvxVCJwXuWRAGGYw==", - "subType": "06" - } - } - }, - "kmip_long_rand_auto_altname": { - "kms": "kmip", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAASeAz/dK+Gc4/jx3W07B2rNFvQ0LoyCllFRvRVGu1Xf1NByc4cRZLOMzlr99syz/fifF6WY30bOi5Pani9QtFuGg==", - "subType": "06" - } - } - }, - "kmip_long_rand_explicit_id": { - "kms": "kmip", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAASP1HD9uoDlwTldaznKxW71JUQcLsa4/cUWzeTnelQwdpohCbZsM8fBZBqgwwTWnjpYY/LBUipC6yhwLKfUXBoBQ==", - "subType": "06" - } - } - }, - "kmip_long_rand_explicit_altname": { - "kms": "kmip", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAASnGPH77bS/ETB1hn+VTvsBrxEvIHA6EAb8Z2SEz6BHt7SVeI+I7DLERvRVpV5kNJFcKgXDrvRmD+Et0rhSmk9sw==", - "subType": "06" - } - } - }, - "kmip_long_det_auto_id": { - "kms": "kmip", - "type": "long", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAS+zKmtijSTPOEVlpwmaeMIOuzVNuZpV4Jw9zP8Yqa1xYtlItXDozqdibacRaA74KU49KNySdR1T7fxwxa2OOTrQ==", - "subType": "06" - } - } - }, - "kmip_long_det_explicit_id": { - "kms": "kmip", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAS+zKmtijSTPOEVlpwmaeMIOuzVNuZpV4Jw9zP8Yqa1xYtlItXDozqdibacRaA74KU49KNySdR1T7fxwxa2OOTrQ==", - "subType": "06" - } - } - }, - "kmip_long_det_explicit_altname": { - "kms": "kmip", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "ASjCDwAAAAAAAAAAAAAAAAAS+zKmtijSTPOEVlpwmaeMIOuzVNuZpV4Jw9zP8Yqa1xYtlItXDozqdibacRaA74KU49KNySdR1T7fxwxa2OOTrQ==", - "subType": "06" - } - } - }, - "kmip_decimal_rand_auto_id": { - "kms": "kmip", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAATu/BbCc5Ti9SBlMR2B8zj3Q1yQ16Uob+10LWaT5QKS192IcnBGy4wmmNkIsTys060xUby9KKQF80dVPnjYfqJwEXCe/pVaPQZftE0DolKv78=", - "subType": "06" - } - } - }, - "kmip_decimal_rand_auto_altname": { - "kms": "kmip", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAATpq6/dtxq2ZUZHrK10aB0YjjPalEaXYcyAyRZjfXWAYCLZdT9sIybjX3Axjxisim+VSHx0QU7oXkKUfcbLgHyjUXj8g9059FHxKFkUsNv4Z8=", - "subType": "06" - } - } - }, - "kmip_decimal_rand_explicit_id": { - "kms": "kmip", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAATS++9KcfM7uiShZYxRpFPrBJquKv7dyvFRTjnxs6aaaPo0fiqpv6bco/cMLsldEVpWDEA/Tc2HtSXYPp4UJsMfASyBjoxCloL5SaRWyD9Ye8=", - "subType": "06" - } - } - }, - "kmip_decimal_rand_explicit_altname": { - "kms": "kmip", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AijCDwAAAAAAAAAAAAAAAAATREcETS5KoAGyj/P45owPrdFfy5ng8Z1ND+F+780lLddOyPeDnIsa7yg6uvhTZ65mHfGLvKcFocclYenq/AX1dY4xdjLRg/AfT088A27ORUA=", - "subType": "06" - } - } - }, - "kmip_decimal_det_explicit_id": { - "kms": "kmip", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "kmip_decimal_det_explicit_altname": { - "kms": "kmip", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "kmip_minKey_rand_explicit_id": { - "kms": "kmip", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "kmip_minKey_rand_explicit_altname": { - "kms": "kmip", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "kmip_minKey_det_explicit_id": { - "kms": "kmip", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "kmip_minKey_det_explicit_altname": { - "kms": "kmip", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "kmip_maxKey_rand_explicit_id": { - "kms": "kmip", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "kmip_maxKey_rand_explicit_altname": { - "kms": "kmip", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "kmip_maxKey_det_explicit_id": { - "kms": "kmip", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "kmip_maxKey_det_explicit_altname": { - "kms": "kmip", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - } -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-aws.json b/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-aws.json deleted file mode 100644 index eca6cf912ef..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-aws.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "status": { - "$numberInt": "1" - }, - "_id": { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "region": "us-east-1", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "provider": "aws" - }, - "updateDate": { - "$date": { - "$numberLong": "1557827033449" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1557827033449" - } - }, - "keyAltNames": ["aws"] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-azure.json b/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-azure.json deleted file mode 100644 index 31a564edb82..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-azure.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "_id": { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "n+HWZ0ZSVOYA3cvQgP7inN4JSXfOH85IngmeQxRpQHjCCcqT3IFqEWNlrsVHiz3AELimHhX4HKqOLWMUeSIT6emUDDoQX9BAv8DR1+E1w4nGs/NyEneac78EYFkK3JysrFDOgl2ypCCTKAypkn9CkAx1if4cfgQE93LW4kczcyHdGiH36CIxrCDGv1UzAvERN5Qa47DVwsM6a+hWsF2AAAJVnF0wYLLJU07TuRHdMrrphPWXZsFgyV+lRqJ7DDpReKNO8nMPLV/mHqHBHGPGQiRdb9NoJo8CvokGz4+KE8oLwzKf6V24dtwZmRkrsDV4iOhvROAzz+Euo1ypSkL3mw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1601573901680" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1601573901680" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "azure", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - }, - "keyAltNames": ["azure"] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-gcp.json b/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-gcp.json deleted file mode 100644 index 79d6999b083..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-gcp.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "_id": { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "CiQAIgLj0WyktnB4dfYHo5SLZ41K4ASQrjJUaSzl5vvVH0G12G0SiQEAjlV8XPlbnHDEDFbdTO4QIe8ER2/172U1ouLazG0ysDtFFIlSvWX5ZnZUrRMmp/R2aJkzLXEt/zf8Mn4Lfm+itnjgo5R9K4pmPNvvPKNZX5C16lrPT+aA+rd+zXFSmlMg3i5jnxvTdLHhg3G7Q/Uv1ZIJskKt95bzLoe0tUVzRWMYXLIEcohnQg==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1601574333107" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1601574333107" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "gcp", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - }, - "keyAltNames": ["gcp"] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-kmip.json b/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-kmip.json deleted file mode 100644 index 7c7069700e1..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-kmip.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "_id": { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "eUYDyB0HuWb+lQgUwO+6qJQyTTDTY2gp9FbemL7ZFo0pvr0x6rm6Ff9OVUTGH6HyMKipaeHdiIJU1dzsLwvqKvi7Beh+U4iaIWX/K0oEg1GOsJc0+Z/in8gNHbGUYLmycHViM3LES3kdt7FdFSUl5rEBHrM71yoNEXImz17QJWMGOuT4x6yoi2pvnaRJwfrI4DjpmnnTrDMac92jgZehbg==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1634220190041" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1634220190041" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "kmip", - "keyId": "1" - }, - "keyAltNames": ["kmip"] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-local.json b/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-local.json deleted file mode 100644 index b3fe0723b06..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-key-local.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "status": { - "$numberInt": "1" - }, - "_id": { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "local" - }, - "updateDate": { - "$date": { - "$numberLong": "1557827033449" - } - }, - "keyMaterial": { - "$binary": { - "base64": "Ce9HSz/HKKGkIt4uyy+jDuKGA+rLC2cycykMo6vc8jXxqa1UVDYHWq1r+vZKbnnSRBfB981akzRKZCFpC05CTyFqDhXv6OnMjpG97OZEREGIsHEYiJkBW0jJJvfLLgeLsEpBzsro9FztGGXASxyxFRZFhXvHxyiLOKrdWfs7X1O/iK3pEoHMx6uSNSfUOgbebLfIqW7TO++iQS5g1xovXA==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1557827033449" - } - }, - "keyAltNames": [ "local" ] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-schema.json b/driver-core/src/test/resources/client-side-encryption-corpus/corpus-schema.json deleted file mode 100644 index e74bc914f51..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-corpus/corpus-schema.json +++ /dev/null @@ -1,6335 +0,0 @@ -{ - "bsonType": "object", - "properties": { - "aws_double_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "double" - } - } - } - }, - "aws_double_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "double" - } - } - } - }, - "aws_double_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_double_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_string_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "string" - } - } - } - }, - "aws_string_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "string" - } - } - } - }, - "aws_string_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_string_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_string_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "string" - } - } - } - }, - "aws_string_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_string_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_object_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "object" - } - } - } - }, - "aws_object_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "object" - } - } - } - }, - "aws_object_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_object_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_array_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "array" - } - } - } - }, - "aws_array_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "array" - } - } - } - }, - "aws_array_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_array_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_binData=00_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "aws_binData=00_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "aws_binData=00_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_binData=00_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_binData=00_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "binData" - } - } - } - }, - "aws_binData=00_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_binData=00_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_binData=04_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "aws_binData=04_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "aws_binData=04_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_binData=04_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_binData=04_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "binData" - } - } - } - }, - "aws_binData=04_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_binData=04_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_objectId_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "objectId" - } - } - } - }, - "aws_objectId_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "objectId" - } - } - } - }, - "aws_objectId_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_objectId_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_objectId_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "objectId" - } - } - } - }, - "aws_objectId_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_objectId_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_bool_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "bool" - } - } - } - }, - "aws_bool_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "bool" - } - } - } - }, - "aws_bool_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_bool_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_date_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "date" - } - } - } - }, - "aws_date_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "date" - } - } - } - }, - "aws_date_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_date_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_date_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "date" - } - } - } - }, - "aws_date_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_date_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_regex_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "regex" - } - } - } - }, - "aws_regex_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "regex" - } - } - } - }, - "aws_regex_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_regex_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_regex_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "regex" - } - } - } - }, - "aws_regex_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_regex_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_dbPointer_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "dbPointer" - } - } - } - }, - "aws_dbPointer_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "dbPointer" - } - } - } - }, - "aws_dbPointer_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_dbPointer_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_dbPointer_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "dbPointer" - } - } - } - }, - "aws_dbPointer_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_dbPointer_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_javascript_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascript" - } - } - } - }, - "aws_javascript_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascript" - } - } - } - }, - "aws_javascript_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_javascript_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_javascript_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "javascript" - } - } - } - }, - "aws_javascript_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_javascript_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_symbol_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "symbol" - } - } - } - }, - "aws_symbol_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "symbol" - } - } - } - }, - "aws_symbol_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_symbol_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_symbol_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "symbol" - } - } - } - }, - "aws_symbol_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_symbol_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_javascriptWithScope_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascriptWithScope" - } - } - } - }, - "aws_javascriptWithScope_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascriptWithScope" - } - } - } - }, - "aws_javascriptWithScope_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_javascriptWithScope_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_int_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "int" - } - } - } - }, - "aws_int_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "int" - } - } - } - }, - "aws_int_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_int_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_int_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "int" - } - } - } - }, - "aws_int_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_int_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_timestamp_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "timestamp" - } - } - } - }, - "aws_timestamp_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "timestamp" - } - } - } - }, - "aws_timestamp_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_timestamp_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_timestamp_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "timestamp" - } - } - } - }, - "aws_timestamp_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_timestamp_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_long_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "long" - } - } - } - }, - "aws_long_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "long" - } - } - } - }, - "aws_long_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_long_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_long_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "long" - } - } - } - }, - "aws_long_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_long_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_decimal_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AWSAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "decimal" - } - } - } - }, - "aws_decimal_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_aws", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "decimal" - } - } - } - }, - "aws_decimal_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "aws_decimal_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_double_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "double" - } - } - } - }, - "local_double_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "double" - } - } - } - }, - "local_double_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_double_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_string_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "string" - } - } - } - }, - "local_string_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "string" - } - } - } - }, - "local_string_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_string_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_string_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "string" - } - } - } - }, - "local_string_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_string_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_object_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "object" - } - } - } - }, - "local_object_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "object" - } - } - } - }, - "local_object_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_object_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_array_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "array" - } - } - } - }, - "local_array_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "array" - } - } - } - }, - "local_array_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_array_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_binData=00_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "local_binData=00_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "local_binData=00_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_binData=00_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_binData=00_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "binData" - } - } - } - }, - "local_binData=00_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_binData=00_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_binData=04_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "local_binData=04_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "local_binData=04_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_binData=04_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_binData=04_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "binData" - } - } - } - }, - "local_binData=04_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_binData=04_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_objectId_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "objectId" - } - } - } - }, - "local_objectId_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "objectId" - } - } - } - }, - "local_objectId_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_objectId_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_objectId_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "objectId" - } - } - } - }, - "local_objectId_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_objectId_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_bool_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "bool" - } - } - } - }, - "local_bool_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "bool" - } - } - } - }, - "local_bool_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_bool_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_date_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "date" - } - } - } - }, - "local_date_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "date" - } - } - } - }, - "local_date_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_date_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_date_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "date" - } - } - } - }, - "local_date_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_date_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_regex_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "regex" - } - } - } - }, - "local_regex_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "regex" - } - } - } - }, - "local_regex_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_regex_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_regex_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "regex" - } - } - } - }, - "local_regex_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_regex_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_dbPointer_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "dbPointer" - } - } - } - }, - "local_dbPointer_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "dbPointer" - } - } - } - }, - "local_dbPointer_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_dbPointer_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_dbPointer_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "dbPointer" - } - } - } - }, - "local_dbPointer_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_dbPointer_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_javascript_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascript" - } - } - } - }, - "local_javascript_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascript" - } - } - } - }, - "local_javascript_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_javascript_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_javascript_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "javascript" - } - } - } - }, - "local_javascript_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_javascript_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_symbol_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "symbol" - } - } - } - }, - "local_symbol_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "symbol" - } - } - } - }, - "local_symbol_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_symbol_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_symbol_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "symbol" - } - } - } - }, - "local_symbol_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_symbol_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_javascriptWithScope_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascriptWithScope" - } - } - } - }, - "local_javascriptWithScope_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascriptWithScope" - } - } - } - }, - "local_javascriptWithScope_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_javascriptWithScope_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_int_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "int" - } - } - } - }, - "local_int_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "int" - } - } - } - }, - "local_int_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_int_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_int_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "int" - } - } - } - }, - "local_int_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_int_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_timestamp_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "timestamp" - } - } - } - }, - "local_timestamp_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "timestamp" - } - } - } - }, - "local_timestamp_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_timestamp_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_timestamp_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "timestamp" - } - } - } - }, - "local_timestamp_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_timestamp_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_long_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "long" - } - } - } - }, - "local_long_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "long" - } - } - } - }, - "local_long_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_long_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_long_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "long" - } - } - } - }, - "local_long_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_long_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_decimal_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "decimal" - } - } - } - }, - "local_decimal_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_local", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "decimal" - } - } - } - }, - "local_decimal_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "local_decimal_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_double_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "double" - } - } - } - }, - "azure_double_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "double" - } - } - } - }, - "azure_double_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_double_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_string_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "string" - } - } - } - }, - "azure_string_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "string" - } - } - } - }, - "azure_string_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_string_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_string_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "string" - } - } - } - }, - "azure_string_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_string_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_object_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "object" - } - } - } - }, - "azure_object_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "object" - } - } - } - }, - "azure_object_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_object_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_array_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "array" - } - } - } - }, - "azure_array_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "array" - } - } - } - }, - "azure_array_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_array_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_binData=00_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "azure_binData=00_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "azure_binData=00_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_binData=00_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_binData=00_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "binData" - } - } - } - }, - "azure_binData=00_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_binData=00_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_binData=04_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "azure_binData=04_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "azure_binData=04_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_binData=04_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_binData=04_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "binData" - } - } - } - }, - "azure_binData=04_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_binData=04_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_objectId_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "objectId" - } - } - } - }, - "azure_objectId_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "objectId" - } - } - } - }, - "azure_objectId_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_objectId_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_objectId_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "objectId" - } - } - } - }, - "azure_objectId_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_objectId_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_bool_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "bool" - } - } - } - }, - "azure_bool_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "bool" - } - } - } - }, - "azure_bool_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_bool_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_date_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "date" - } - } - } - }, - "azure_date_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "date" - } - } - } - }, - "azure_date_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_date_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_date_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "date" - } - } - } - }, - "azure_date_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_date_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_regex_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "regex" - } - } - } - }, - "azure_regex_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "regex" - } - } - } - }, - "azure_regex_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_regex_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_regex_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "regex" - } - } - } - }, - "azure_regex_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_regex_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_dbPointer_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "dbPointer" - } - } - } - }, - "azure_dbPointer_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "dbPointer" - } - } - } - }, - "azure_dbPointer_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_dbPointer_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_dbPointer_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "dbPointer" - } - } - } - }, - "azure_dbPointer_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_dbPointer_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_javascript_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascript" - } - } - } - }, - "azure_javascript_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascript" - } - } - } - }, - "azure_javascript_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_javascript_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_javascript_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "javascript" - } - } - } - }, - "azure_javascript_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_javascript_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_symbol_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "symbol" - } - } - } - }, - "azure_symbol_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "symbol" - } - } - } - }, - "azure_symbol_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_symbol_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_symbol_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "symbol" - } - } - } - }, - "azure_symbol_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_symbol_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_javascriptWithScope_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascriptWithScope" - } - } - } - }, - "azure_javascriptWithScope_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascriptWithScope" - } - } - } - }, - "azure_javascriptWithScope_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_javascriptWithScope_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_int_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "int" - } - } - } - }, - "azure_int_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "int" - } - } - } - }, - "azure_int_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_int_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_int_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "int" - } - } - } - }, - "azure_int_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_int_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_timestamp_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "timestamp" - } - } - } - }, - "azure_timestamp_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "timestamp" - } - } - } - }, - "azure_timestamp_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_timestamp_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_timestamp_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "timestamp" - } - } - } - }, - "azure_timestamp_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_timestamp_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_long_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "long" - } - } - } - }, - "azure_long_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "long" - } - } - } - }, - "azure_long_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_long_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_long_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "long" - } - } - } - }, - "azure_long_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_long_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_decimal_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZUREAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "decimal" - } - } - } - }, - "azure_decimal_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_azure", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "decimal" - } - } - } - }, - "azure_decimal_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "azure_decimal_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_double_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "double" - } - } - } - }, - "gcp_double_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "double" - } - } - } - }, - "gcp_double_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_double_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_string_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "string" - } - } - } - }, - "gcp_string_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "string" - } - } - } - }, - "gcp_string_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_string_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_string_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "string" - } - } - } - }, - "gcp_string_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_string_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_object_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "object" - } - } - } - }, - "gcp_object_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "object" - } - } - } - }, - "gcp_object_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_object_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_array_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "array" - } - } - } - }, - "gcp_array_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "array" - } - } - } - }, - "gcp_array_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_array_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_binData=00_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "gcp_binData=00_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "gcp_binData=00_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_binData=00_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_binData=00_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "binData" - } - } - } - }, - "gcp_binData=00_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_binData=00_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_binData=04_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "gcp_binData=04_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "gcp_binData=04_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_binData=04_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_binData=04_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "binData" - } - } - } - }, - "gcp_binData=04_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_binData=04_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_objectId_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "objectId" - } - } - } - }, - "gcp_objectId_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "objectId" - } - } - } - }, - "gcp_objectId_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_objectId_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_objectId_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "objectId" - } - } - } - }, - "gcp_objectId_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_objectId_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_bool_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "bool" - } - } - } - }, - "gcp_bool_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "bool" - } - } - } - }, - "gcp_bool_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_bool_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_date_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "date" - } - } - } - }, - "gcp_date_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "date" - } - } - } - }, - "gcp_date_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_date_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_date_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "date" - } - } - } - }, - "gcp_date_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_date_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_regex_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "regex" - } - } - } - }, - "gcp_regex_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "regex" - } - } - } - }, - "gcp_regex_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_regex_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_regex_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "regex" - } - } - } - }, - "gcp_regex_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_regex_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_dbPointer_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "dbPointer" - } - } - } - }, - "gcp_dbPointer_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "dbPointer" - } - } - } - }, - "gcp_dbPointer_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_dbPointer_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_dbPointer_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "dbPointer" - } - } - } - }, - "gcp_dbPointer_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_dbPointer_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_javascript_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascript" - } - } - } - }, - "gcp_javascript_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascript" - } - } - } - }, - "gcp_javascript_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_javascript_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_javascript_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "javascript" - } - } - } - }, - "gcp_javascript_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_javascript_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_symbol_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "symbol" - } - } - } - }, - "gcp_symbol_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "symbol" - } - } - } - }, - "gcp_symbol_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_symbol_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_symbol_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "symbol" - } - } - } - }, - "gcp_symbol_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_symbol_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_javascriptWithScope_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascriptWithScope" - } - } - } - }, - "gcp_javascriptWithScope_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascriptWithScope" - } - } - } - }, - "gcp_javascriptWithScope_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_javascriptWithScope_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_int_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "int" - } - } - } - }, - "gcp_int_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "int" - } - } - } - }, - "gcp_int_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_int_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_int_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "int" - } - } - } - }, - "gcp_int_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_int_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_timestamp_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "timestamp" - } - } - } - }, - "gcp_timestamp_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "timestamp" - } - } - } - }, - "gcp_timestamp_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_timestamp_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_timestamp_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "timestamp" - } - } - } - }, - "gcp_timestamp_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_timestamp_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_long_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "long" - } - } - } - }, - "gcp_long_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "long" - } - } - } - }, - "gcp_long_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_long_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_long_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "long" - } - } - } - }, - "gcp_long_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_long_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_decimal_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCPAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "decimal" - } - } - } - }, - "gcp_decimal_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_gcp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "decimal" - } - } - } - }, - "gcp_decimal_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "gcp_decimal_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_double_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "double" - } - } - } - }, - "kmip_double_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "double" - } - } - } - }, - "kmip_double_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_double_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_string_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "string" - } - } - } - }, - "kmip_string_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "string" - } - } - } - }, - "kmip_string_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_string_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_string_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "string" - } - } - } - }, - "kmip_string_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_string_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_object_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "object" - } - } - } - }, - "kmip_object_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "object" - } - } - } - }, - "kmip_object_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_object_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_array_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "array" - } - } - } - }, - "kmip_array_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "array" - } - } - } - }, - "kmip_array_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_array_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_binData=00_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "kmip_binData=00_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "kmip_binData=00_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_binData=00_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_binData=00_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "binData" - } - } - } - }, - "kmip_binData=00_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_binData=00_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_binData=04_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "kmip_binData=04_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "binData" - } - } - } - }, - "kmip_binData=04_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_binData=04_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_binData=04_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "binData" - } - } - } - }, - "kmip_binData=04_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_binData=04_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_objectId_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "objectId" - } - } - } - }, - "kmip_objectId_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "objectId" - } - } - } - }, - "kmip_objectId_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_objectId_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_objectId_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "objectId" - } - } - } - }, - "kmip_objectId_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_objectId_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_bool_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "bool" - } - } - } - }, - "kmip_bool_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "bool" - } - } - } - }, - "kmip_bool_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_bool_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_date_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "date" - } - } - } - }, - "kmip_date_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "date" - } - } - } - }, - "kmip_date_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_date_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_date_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "date" - } - } - } - }, - "kmip_date_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_date_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_regex_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "regex" - } - } - } - }, - "kmip_regex_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "regex" - } - } - } - }, - "kmip_regex_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_regex_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_regex_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "regex" - } - } - } - }, - "kmip_regex_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_regex_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_dbPointer_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "dbPointer" - } - } - } - }, - "kmip_dbPointer_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "dbPointer" - } - } - } - }, - "kmip_dbPointer_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_dbPointer_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_dbPointer_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "dbPointer" - } - } - } - }, - "kmip_dbPointer_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_dbPointer_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_javascript_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascript" - } - } - } - }, - "kmip_javascript_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascript" - } - } - } - }, - "kmip_javascript_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_javascript_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_javascript_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "javascript" - } - } - } - }, - "kmip_javascript_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_javascript_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_symbol_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "symbol" - } - } - } - }, - "kmip_symbol_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "symbol" - } - } - } - }, - "kmip_symbol_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_symbol_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_symbol_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "symbol" - } - } - } - }, - "kmip_symbol_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_symbol_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_javascriptWithScope_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascriptWithScope" - } - } - } - }, - "kmip_javascriptWithScope_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "javascriptWithScope" - } - } - } - }, - "kmip_javascriptWithScope_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_javascriptWithScope_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_int_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "int" - } - } - } - }, - "kmip_int_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "int" - } - } - } - }, - "kmip_int_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_int_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_int_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "int" - } - } - } - }, - "kmip_int_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_int_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_timestamp_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "timestamp" - } - } - } - }, - "kmip_timestamp_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "timestamp" - } - } - } - }, - "kmip_timestamp_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_timestamp_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_timestamp_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "timestamp" - } - } - } - }, - "kmip_timestamp_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_timestamp_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_long_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "long" - } - } - } - }, - "kmip_long_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "long" - } - } - } - }, - "kmip_long_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_long_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_long_det_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic", - "bsonType": "long" - } - } - } - }, - "kmip_long_det_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_long_det_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_decimal_rand_auto_id": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "KMIPAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "decimal" - } - } - } - }, - "kmip_decimal_rand_auto_altname": { - "bsonType": "object", - "properties": { - "value": { - "encrypt": { - "keyId": "/altname_kmip", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random", - "bsonType": "decimal" - } - } - } - }, - "kmip_decimal_rand_explicit_id": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - }, - "kmip_decimal_rand_explicit_altname": { - "bsonType": "object", - "properties": { - "value": { - "bsonType": "binData" - } - } - } - } -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-corpus/corpus.json b/driver-core/src/test/resources/client-side-encryption-corpus/corpus.json deleted file mode 100644 index 559711b347e..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-corpus/corpus.json +++ /dev/null @@ -1,8619 +0,0 @@ -{ - "_id": "client_side_encryption_corpus", - "altname_aws": "aws", - "altname_local": "local", - "altname_azure": "azure", - "altname_gcp": "gcp", - "altname_kmip": "kmip", - "aws_double_rand_auto_id": { - "kms": "aws", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "aws_double_rand_auto_altname": { - "kms": "aws", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "aws_double_rand_explicit_id": { - "kms": "aws", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "aws_double_rand_explicit_altname": { - "kms": "aws", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "aws_double_det_explicit_id": { - "kms": "aws", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDouble": "1.234" - } - }, - "aws_double_det_explicit_altname": { - "kms": "aws", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDouble": "1.234" - } - }, - "aws_string_rand_auto_id": { - "kms": "aws", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "aws_string_rand_auto_altname": { - "kms": "aws", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "aws_string_rand_explicit_id": { - "kms": "aws", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "aws_string_rand_explicit_altname": { - "kms": "aws", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "aws_string_det_auto_id": { - "kms": "aws", - "type": "string", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "aws_string_det_explicit_id": { - "kms": "aws", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "aws_string_det_explicit_altname": { - "kms": "aws", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "aws_object_rand_auto_id": { - "kms": "aws", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "aws_object_rand_auto_altname": { - "kms": "aws", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "aws_object_rand_explicit_id": { - "kms": "aws", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "aws_object_rand_explicit_altname": { - "kms": "aws", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "aws_object_det_explicit_id": { - "kms": "aws", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "aws_object_det_explicit_altname": { - "kms": "aws", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "aws_array_rand_auto_id": { - "kms": "aws", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "aws_array_rand_auto_altname": { - "kms": "aws", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "aws_array_rand_explicit_id": { - "kms": "aws", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "aws_array_rand_explicit_altname": { - "kms": "aws", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "aws_array_det_explicit_id": { - "kms": "aws", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "aws_array_det_explicit_altname": { - "kms": "aws", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "aws_binData=00_rand_auto_id": { - "kms": "aws", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "aws_binData=00_rand_auto_altname": { - "kms": "aws", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "aws_binData=00_rand_explicit_id": { - "kms": "aws", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "aws_binData=00_rand_explicit_altname": { - "kms": "aws", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "aws_binData=00_det_auto_id": { - "kms": "aws", - "type": "binData=00", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "aws_binData=00_det_explicit_id": { - "kms": "aws", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "aws_binData=00_det_explicit_altname": { - "kms": "aws", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "aws_binData=04_rand_auto_id": { - "kms": "aws", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "aws_binData=04_rand_auto_altname": { - "kms": "aws", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "aws_binData=04_rand_explicit_id": { - "kms": "aws", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "aws_binData=04_rand_explicit_altname": { - "kms": "aws", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "aws_binData=04_det_auto_id": { - "kms": "aws", - "type": "binData=04", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "aws_binData=04_det_explicit_id": { - "kms": "aws", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "aws_binData=04_det_explicit_altname": { - "kms": "aws", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "aws_undefined_rand_explicit_id": { - "kms": "aws", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "aws_undefined_rand_explicit_altname": { - "kms": "aws", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "aws_undefined_det_explicit_id": { - "kms": "aws", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "aws_undefined_det_explicit_altname": { - "kms": "aws", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "aws_objectId_rand_auto_id": { - "kms": "aws", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "aws_objectId_rand_auto_altname": { - "kms": "aws", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "aws_objectId_rand_explicit_id": { - "kms": "aws", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "aws_objectId_rand_explicit_altname": { - "kms": "aws", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "aws_objectId_det_auto_id": { - "kms": "aws", - "type": "objectId", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "aws_objectId_det_explicit_id": { - "kms": "aws", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "aws_objectId_det_explicit_altname": { - "kms": "aws", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "aws_bool_rand_auto_id": { - "kms": "aws", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": true - }, - "aws_bool_rand_auto_altname": { - "kms": "aws", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": true - }, - "aws_bool_rand_explicit_id": { - "kms": "aws", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": true - }, - "aws_bool_rand_explicit_altname": { - "kms": "aws", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": true - }, - "aws_bool_det_explicit_id": { - "kms": "aws", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": true - }, - "aws_bool_det_explicit_altname": { - "kms": "aws", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": true - }, - "aws_date_rand_auto_id": { - "kms": "aws", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "aws_date_rand_auto_altname": { - "kms": "aws", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "aws_date_rand_explicit_id": { - "kms": "aws", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "aws_date_rand_explicit_altname": { - "kms": "aws", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "aws_date_det_auto_id": { - "kms": "aws", - "type": "date", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "aws_date_det_explicit_id": { - "kms": "aws", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "aws_date_det_explicit_altname": { - "kms": "aws", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "aws_null_rand_explicit_id": { - "kms": "aws", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "aws_null_rand_explicit_altname": { - "kms": "aws", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "aws_null_det_explicit_id": { - "kms": "aws", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "aws_null_det_explicit_altname": { - "kms": "aws", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "aws_regex_rand_auto_id": { - "kms": "aws", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "aws_regex_rand_auto_altname": { - "kms": "aws", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "aws_regex_rand_explicit_id": { - "kms": "aws", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "aws_regex_rand_explicit_altname": { - "kms": "aws", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "aws_regex_det_auto_id": { - "kms": "aws", - "type": "regex", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "aws_regex_det_explicit_id": { - "kms": "aws", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "aws_regex_det_explicit_altname": { - "kms": "aws", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "aws_dbPointer_rand_auto_id": { - "kms": "aws", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "aws_dbPointer_rand_auto_altname": { - "kms": "aws", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "aws_dbPointer_rand_explicit_id": { - "kms": "aws", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "aws_dbPointer_rand_explicit_altname": { - "kms": "aws", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "aws_dbPointer_det_auto_id": { - "kms": "aws", - "type": "dbPointer", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "aws_dbPointer_det_explicit_id": { - "kms": "aws", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "aws_dbPointer_det_explicit_altname": { - "kms": "aws", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "aws_javascript_rand_auto_id": { - "kms": "aws", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "aws_javascript_rand_auto_altname": { - "kms": "aws", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "aws_javascript_rand_explicit_id": { - "kms": "aws", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "aws_javascript_rand_explicit_altname": { - "kms": "aws", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "aws_javascript_det_auto_id": { - "kms": "aws", - "type": "javascript", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "aws_javascript_det_explicit_id": { - "kms": "aws", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "aws_javascript_det_explicit_altname": { - "kms": "aws", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "aws_symbol_rand_auto_id": { - "kms": "aws", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "aws_symbol_rand_auto_altname": { - "kms": "aws", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "aws_symbol_rand_explicit_id": { - "kms": "aws", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "aws_symbol_rand_explicit_altname": { - "kms": "aws", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "aws_symbol_det_auto_id": { - "kms": "aws", - "type": "symbol", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "aws_symbol_det_explicit_id": { - "kms": "aws", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "aws_symbol_det_explicit_altname": { - "kms": "aws", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "aws_javascriptWithScope_rand_auto_id": { - "kms": "aws", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "aws_javascriptWithScope_rand_auto_altname": { - "kms": "aws", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "aws_javascriptWithScope_rand_explicit_id": { - "kms": "aws", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "aws_javascriptWithScope_rand_explicit_altname": { - "kms": "aws", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "aws_javascriptWithScope_det_explicit_id": { - "kms": "aws", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "aws_javascriptWithScope_det_explicit_altname": { - "kms": "aws", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "aws_int_rand_auto_id": { - "kms": "aws", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "aws_int_rand_auto_altname": { - "kms": "aws", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "aws_int_rand_explicit_id": { - "kms": "aws", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "aws_int_rand_explicit_altname": { - "kms": "aws", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "aws_int_det_auto_id": { - "kms": "aws", - "type": "int", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "aws_int_det_explicit_id": { - "kms": "aws", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "aws_int_det_explicit_altname": { - "kms": "aws", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "aws_timestamp_rand_auto_id": { - "kms": "aws", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "aws_timestamp_rand_auto_altname": { - "kms": "aws", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "aws_timestamp_rand_explicit_id": { - "kms": "aws", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "aws_timestamp_rand_explicit_altname": { - "kms": "aws", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "aws_timestamp_det_auto_id": { - "kms": "aws", - "type": "timestamp", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "aws_timestamp_det_explicit_id": { - "kms": "aws", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "aws_timestamp_det_explicit_altname": { - "kms": "aws", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "aws_long_rand_auto_id": { - "kms": "aws", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "aws_long_rand_auto_altname": { - "kms": "aws", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "aws_long_rand_explicit_id": { - "kms": "aws", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "aws_long_rand_explicit_altname": { - "kms": "aws", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "aws_long_det_auto_id": { - "kms": "aws", - "type": "long", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "aws_long_det_explicit_id": { - "kms": "aws", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "aws_long_det_explicit_altname": { - "kms": "aws", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "aws_decimal_rand_auto_id": { - "kms": "aws", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "aws_decimal_rand_auto_altname": { - "kms": "aws", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "aws_decimal_rand_explicit_id": { - "kms": "aws", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "aws_decimal_rand_explicit_altname": { - "kms": "aws", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "aws_decimal_det_explicit_id": { - "kms": "aws", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "aws_decimal_det_explicit_altname": { - "kms": "aws", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "aws_minKey_rand_explicit_id": { - "kms": "aws", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "aws_minKey_rand_explicit_altname": { - "kms": "aws", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "aws_minKey_det_explicit_id": { - "kms": "aws", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "aws_minKey_det_explicit_altname": { - "kms": "aws", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "aws_maxKey_rand_explicit_id": { - "kms": "aws", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "aws_maxKey_rand_explicit_altname": { - "kms": "aws", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "aws_maxKey_det_explicit_id": { - "kms": "aws", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "aws_maxKey_det_explicit_altname": { - "kms": "aws", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "local_double_rand_auto_id": { - "kms": "local", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "local_double_rand_auto_altname": { - "kms": "local", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "local_double_rand_explicit_id": { - "kms": "local", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "local_double_rand_explicit_altname": { - "kms": "local", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "local_double_det_explicit_id": { - "kms": "local", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDouble": "1.234" - } - }, - "local_double_det_explicit_altname": { - "kms": "local", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDouble": "1.234" - } - }, - "local_string_rand_auto_id": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "local_string_rand_auto_altname": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "local_string_rand_explicit_id": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "local_string_rand_explicit_altname": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "local_string_det_auto_id": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "local_string_det_explicit_id": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "local_string_det_explicit_altname": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "local_object_rand_auto_id": { - "kms": "local", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "local_object_rand_auto_altname": { - "kms": "local", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "local_object_rand_explicit_id": { - "kms": "local", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "local_object_rand_explicit_altname": { - "kms": "local", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "local_object_det_explicit_id": { - "kms": "local", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "local_object_det_explicit_altname": { - "kms": "local", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "local_array_rand_auto_id": { - "kms": "local", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "local_array_rand_auto_altname": { - "kms": "local", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "local_array_rand_explicit_id": { - "kms": "local", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "local_array_rand_explicit_altname": { - "kms": "local", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "local_array_det_explicit_id": { - "kms": "local", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "local_array_det_explicit_altname": { - "kms": "local", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "local_binData=00_rand_auto_id": { - "kms": "local", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "local_binData=00_rand_auto_altname": { - "kms": "local", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "local_binData=00_rand_explicit_id": { - "kms": "local", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "local_binData=00_rand_explicit_altname": { - "kms": "local", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "local_binData=00_det_auto_id": { - "kms": "local", - "type": "binData=00", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "local_binData=00_det_explicit_id": { - "kms": "local", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "local_binData=00_det_explicit_altname": { - "kms": "local", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "local_binData=04_rand_auto_id": { - "kms": "local", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "local_binData=04_rand_auto_altname": { - "kms": "local", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "local_binData=04_rand_explicit_id": { - "kms": "local", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "local_binData=04_rand_explicit_altname": { - "kms": "local", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "local_binData=04_det_auto_id": { - "kms": "local", - "type": "binData=04", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "local_binData=04_det_explicit_id": { - "kms": "local", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "local_binData=04_det_explicit_altname": { - "kms": "local", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "local_undefined_rand_explicit_id": { - "kms": "local", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "local_undefined_rand_explicit_altname": { - "kms": "local", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "local_undefined_det_explicit_id": { - "kms": "local", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "local_undefined_det_explicit_altname": { - "kms": "local", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "local_objectId_rand_auto_id": { - "kms": "local", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "local_objectId_rand_auto_altname": { - "kms": "local", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "local_objectId_rand_explicit_id": { - "kms": "local", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "local_objectId_rand_explicit_altname": { - "kms": "local", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "local_objectId_det_auto_id": { - "kms": "local", - "type": "objectId", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "local_objectId_det_explicit_id": { - "kms": "local", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "local_objectId_det_explicit_altname": { - "kms": "local", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "local_bool_rand_auto_id": { - "kms": "local", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": true - }, - "local_bool_rand_auto_altname": { - "kms": "local", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": true - }, - "local_bool_rand_explicit_id": { - "kms": "local", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": true - }, - "local_bool_rand_explicit_altname": { - "kms": "local", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": true - }, - "local_bool_det_explicit_id": { - "kms": "local", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": true - }, - "local_bool_det_explicit_altname": { - "kms": "local", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": true - }, - "local_date_rand_auto_id": { - "kms": "local", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "local_date_rand_auto_altname": { - "kms": "local", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "local_date_rand_explicit_id": { - "kms": "local", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "local_date_rand_explicit_altname": { - "kms": "local", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "local_date_det_auto_id": { - "kms": "local", - "type": "date", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "local_date_det_explicit_id": { - "kms": "local", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "local_date_det_explicit_altname": { - "kms": "local", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "local_null_rand_explicit_id": { - "kms": "local", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "local_null_rand_explicit_altname": { - "kms": "local", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "local_null_det_explicit_id": { - "kms": "local", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "local_null_det_explicit_altname": { - "kms": "local", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "local_regex_rand_auto_id": { - "kms": "local", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "local_regex_rand_auto_altname": { - "kms": "local", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "local_regex_rand_explicit_id": { - "kms": "local", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "local_regex_rand_explicit_altname": { - "kms": "local", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "local_regex_det_auto_id": { - "kms": "local", - "type": "regex", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "local_regex_det_explicit_id": { - "kms": "local", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "local_regex_det_explicit_altname": { - "kms": "local", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "local_dbPointer_rand_auto_id": { - "kms": "local", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "local_dbPointer_rand_auto_altname": { - "kms": "local", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "local_dbPointer_rand_explicit_id": { - "kms": "local", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "local_dbPointer_rand_explicit_altname": { - "kms": "local", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "local_dbPointer_det_auto_id": { - "kms": "local", - "type": "dbPointer", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "local_dbPointer_det_explicit_id": { - "kms": "local", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "local_dbPointer_det_explicit_altname": { - "kms": "local", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "local_javascript_rand_auto_id": { - "kms": "local", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "local_javascript_rand_auto_altname": { - "kms": "local", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "local_javascript_rand_explicit_id": { - "kms": "local", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "local_javascript_rand_explicit_altname": { - "kms": "local", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "local_javascript_det_auto_id": { - "kms": "local", - "type": "javascript", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "local_javascript_det_explicit_id": { - "kms": "local", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "local_javascript_det_explicit_altname": { - "kms": "local", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "local_symbol_rand_auto_id": { - "kms": "local", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "local_symbol_rand_auto_altname": { - "kms": "local", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "local_symbol_rand_explicit_id": { - "kms": "local", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "local_symbol_rand_explicit_altname": { - "kms": "local", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "local_symbol_det_auto_id": { - "kms": "local", - "type": "symbol", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "local_symbol_det_explicit_id": { - "kms": "local", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "local_symbol_det_explicit_altname": { - "kms": "local", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "local_javascriptWithScope_rand_auto_id": { - "kms": "local", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "local_javascriptWithScope_rand_auto_altname": { - "kms": "local", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "local_javascriptWithScope_rand_explicit_id": { - "kms": "local", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "local_javascriptWithScope_rand_explicit_altname": { - "kms": "local", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "local_javascriptWithScope_det_explicit_id": { - "kms": "local", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "local_javascriptWithScope_det_explicit_altname": { - "kms": "local", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "local_int_rand_auto_id": { - "kms": "local", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "local_int_rand_auto_altname": { - "kms": "local", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "local_int_rand_explicit_id": { - "kms": "local", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "local_int_rand_explicit_altname": { - "kms": "local", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "local_int_det_auto_id": { - "kms": "local", - "type": "int", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "local_int_det_explicit_id": { - "kms": "local", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "local_int_det_explicit_altname": { - "kms": "local", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "local_timestamp_rand_auto_id": { - "kms": "local", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "local_timestamp_rand_auto_altname": { - "kms": "local", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "local_timestamp_rand_explicit_id": { - "kms": "local", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "local_timestamp_rand_explicit_altname": { - "kms": "local", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "local_timestamp_det_auto_id": { - "kms": "local", - "type": "timestamp", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "local_timestamp_det_explicit_id": { - "kms": "local", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "local_timestamp_det_explicit_altname": { - "kms": "local", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "local_long_rand_auto_id": { - "kms": "local", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "local_long_rand_auto_altname": { - "kms": "local", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "local_long_rand_explicit_id": { - "kms": "local", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "local_long_rand_explicit_altname": { - "kms": "local", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "local_long_det_auto_id": { - "kms": "local", - "type": "long", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "local_long_det_explicit_id": { - "kms": "local", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "local_long_det_explicit_altname": { - "kms": "local", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "local_decimal_rand_auto_id": { - "kms": "local", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "local_decimal_rand_auto_altname": { - "kms": "local", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "local_decimal_rand_explicit_id": { - "kms": "local", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "local_decimal_rand_explicit_altname": { - "kms": "local", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "local_decimal_det_explicit_id": { - "kms": "local", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "local_decimal_det_explicit_altname": { - "kms": "local", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "local_minKey_rand_explicit_id": { - "kms": "local", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "local_minKey_rand_explicit_altname": { - "kms": "local", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "local_minKey_det_explicit_id": { - "kms": "local", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "local_minKey_det_explicit_altname": { - "kms": "local", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "local_maxKey_rand_explicit_id": { - "kms": "local", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "local_maxKey_rand_explicit_altname": { - "kms": "local", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "local_maxKey_det_explicit_id": { - "kms": "local", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "local_maxKey_det_explicit_altname": { - "kms": "local", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "azure_double_rand_auto_id": { - "kms": "azure", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "azure_double_rand_auto_altname": { - "kms": "azure", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "azure_double_rand_explicit_id": { - "kms": "azure", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "azure_double_rand_explicit_altname": { - "kms": "azure", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "azure_double_det_explicit_id": { - "kms": "azure", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDouble": "1.234" - } - }, - "azure_double_det_explicit_altname": { - "kms": "azure", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDouble": "1.234" - } - }, - "azure_string_rand_auto_id": { - "kms": "azure", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "azure_string_rand_auto_altname": { - "kms": "azure", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "azure_string_rand_explicit_id": { - "kms": "azure", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "azure_string_rand_explicit_altname": { - "kms": "azure", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "azure_string_det_auto_id": { - "kms": "azure", - "type": "string", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "azure_string_det_explicit_id": { - "kms": "azure", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "azure_string_det_explicit_altname": { - "kms": "azure", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "azure_object_rand_auto_id": { - "kms": "azure", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "azure_object_rand_auto_altname": { - "kms": "azure", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "azure_object_rand_explicit_id": { - "kms": "azure", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "azure_object_rand_explicit_altname": { - "kms": "azure", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "azure_object_det_explicit_id": { - "kms": "azure", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "azure_object_det_explicit_altname": { - "kms": "azure", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "azure_array_rand_auto_id": { - "kms": "azure", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "azure_array_rand_auto_altname": { - "kms": "azure", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "azure_array_rand_explicit_id": { - "kms": "azure", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "azure_array_rand_explicit_altname": { - "kms": "azure", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "azure_array_det_explicit_id": { - "kms": "azure", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "azure_array_det_explicit_altname": { - "kms": "azure", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "azure_binData=00_rand_auto_id": { - "kms": "azure", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "azure_binData=00_rand_auto_altname": { - "kms": "azure", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "azure_binData=00_rand_explicit_id": { - "kms": "azure", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "azure_binData=00_rand_explicit_altname": { - "kms": "azure", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "azure_binData=00_det_auto_id": { - "kms": "azure", - "type": "binData=00", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "azure_binData=00_det_explicit_id": { - "kms": "azure", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "azure_binData=00_det_explicit_altname": { - "kms": "azure", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "azure_binData=04_rand_auto_id": { - "kms": "azure", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "azure_binData=04_rand_auto_altname": { - "kms": "azure", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "azure_binData=04_rand_explicit_id": { - "kms": "azure", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "azure_binData=04_rand_explicit_altname": { - "kms": "azure", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "azure_binData=04_det_auto_id": { - "kms": "azure", - "type": "binData=04", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "azure_binData=04_det_explicit_id": { - "kms": "azure", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "azure_binData=04_det_explicit_altname": { - "kms": "azure", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "azure_undefined_rand_explicit_id": { - "kms": "azure", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "azure_undefined_rand_explicit_altname": { - "kms": "azure", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "azure_undefined_det_explicit_id": { - "kms": "azure", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "azure_undefined_det_explicit_altname": { - "kms": "azure", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "azure_objectId_rand_auto_id": { - "kms": "azure", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "azure_objectId_rand_auto_altname": { - "kms": "azure", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "azure_objectId_rand_explicit_id": { - "kms": "azure", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "azure_objectId_rand_explicit_altname": { - "kms": "azure", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "azure_objectId_det_auto_id": { - "kms": "azure", - "type": "objectId", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "azure_objectId_det_explicit_id": { - "kms": "azure", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "azure_objectId_det_explicit_altname": { - "kms": "azure", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "azure_bool_rand_auto_id": { - "kms": "azure", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": true - }, - "azure_bool_rand_auto_altname": { - "kms": "azure", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": true - }, - "azure_bool_rand_explicit_id": { - "kms": "azure", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": true - }, - "azure_bool_rand_explicit_altname": { - "kms": "azure", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": true - }, - "azure_bool_det_explicit_id": { - "kms": "azure", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": true - }, - "azure_bool_det_explicit_altname": { - "kms": "azure", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": true - }, - "azure_date_rand_auto_id": { - "kms": "azure", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "azure_date_rand_auto_altname": { - "kms": "azure", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "azure_date_rand_explicit_id": { - "kms": "azure", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "azure_date_rand_explicit_altname": { - "kms": "azure", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "azure_date_det_auto_id": { - "kms": "azure", - "type": "date", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "azure_date_det_explicit_id": { - "kms": "azure", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "azure_date_det_explicit_altname": { - "kms": "azure", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "azure_null_rand_explicit_id": { - "kms": "azure", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "azure_null_rand_explicit_altname": { - "kms": "azure", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "azure_null_det_explicit_id": { - "kms": "azure", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "azure_null_det_explicit_altname": { - "kms": "azure", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "azure_regex_rand_auto_id": { - "kms": "azure", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "azure_regex_rand_auto_altname": { - "kms": "azure", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "azure_regex_rand_explicit_id": { - "kms": "azure", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "azure_regex_rand_explicit_altname": { - "kms": "azure", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "azure_regex_det_auto_id": { - "kms": "azure", - "type": "regex", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "azure_regex_det_explicit_id": { - "kms": "azure", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "azure_regex_det_explicit_altname": { - "kms": "azure", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "azure_dbPointer_rand_auto_id": { - "kms": "azure", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "azure_dbPointer_rand_auto_altname": { - "kms": "azure", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "azure_dbPointer_rand_explicit_id": { - "kms": "azure", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "azure_dbPointer_rand_explicit_altname": { - "kms": "azure", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "azure_dbPointer_det_auto_id": { - "kms": "azure", - "type": "dbPointer", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "azure_dbPointer_det_explicit_id": { - "kms": "azure", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "azure_dbPointer_det_explicit_altname": { - "kms": "azure", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "azure_javascript_rand_auto_id": { - "kms": "azure", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "azure_javascript_rand_auto_altname": { - "kms": "azure", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "azure_javascript_rand_explicit_id": { - "kms": "azure", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "azure_javascript_rand_explicit_altname": { - "kms": "azure", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "azure_javascript_det_auto_id": { - "kms": "azure", - "type": "javascript", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "azure_javascript_det_explicit_id": { - "kms": "azure", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "azure_javascript_det_explicit_altname": { - "kms": "azure", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "azure_symbol_rand_auto_id": { - "kms": "azure", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "azure_symbol_rand_auto_altname": { - "kms": "azure", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "azure_symbol_rand_explicit_id": { - "kms": "azure", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "azure_symbol_rand_explicit_altname": { - "kms": "azure", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "azure_symbol_det_auto_id": { - "kms": "azure", - "type": "symbol", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "azure_symbol_det_explicit_id": { - "kms": "azure", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "azure_symbol_det_explicit_altname": { - "kms": "azure", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "azure_javascriptWithScope_rand_auto_id": { - "kms": "azure", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "azure_javascriptWithScope_rand_auto_altname": { - "kms": "azure", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "azure_javascriptWithScope_rand_explicit_id": { - "kms": "azure", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "azure_javascriptWithScope_rand_explicit_altname": { - "kms": "azure", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "azure_javascriptWithScope_det_explicit_id": { - "kms": "azure", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "azure_javascriptWithScope_det_explicit_altname": { - "kms": "azure", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "azure_int_rand_auto_id": { - "kms": "azure", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "azure_int_rand_auto_altname": { - "kms": "azure", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "azure_int_rand_explicit_id": { - "kms": "azure", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "azure_int_rand_explicit_altname": { - "kms": "azure", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "azure_int_det_auto_id": { - "kms": "azure", - "type": "int", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "azure_int_det_explicit_id": { - "kms": "azure", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "azure_int_det_explicit_altname": { - "kms": "azure", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "azure_timestamp_rand_auto_id": { - "kms": "azure", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "azure_timestamp_rand_auto_altname": { - "kms": "azure", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "azure_timestamp_rand_explicit_id": { - "kms": "azure", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "azure_timestamp_rand_explicit_altname": { - "kms": "azure", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "azure_timestamp_det_auto_id": { - "kms": "azure", - "type": "timestamp", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "azure_timestamp_det_explicit_id": { - "kms": "azure", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "azure_timestamp_det_explicit_altname": { - "kms": "azure", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "azure_long_rand_auto_id": { - "kms": "azure", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "azure_long_rand_auto_altname": { - "kms": "azure", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "azure_long_rand_explicit_id": { - "kms": "azure", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "azure_long_rand_explicit_altname": { - "kms": "azure", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "azure_long_det_auto_id": { - "kms": "azure", - "type": "long", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "azure_long_det_explicit_id": { - "kms": "azure", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "azure_long_det_explicit_altname": { - "kms": "azure", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "azure_decimal_rand_auto_id": { - "kms": "azure", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "azure_decimal_rand_auto_altname": { - "kms": "azure", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "azure_decimal_rand_explicit_id": { - "kms": "azure", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "azure_decimal_rand_explicit_altname": { - "kms": "azure", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "azure_decimal_det_explicit_id": { - "kms": "azure", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "azure_decimal_det_explicit_altname": { - "kms": "azure", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "azure_minKey_rand_explicit_id": { - "kms": "azure", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "azure_minKey_rand_explicit_altname": { - "kms": "azure", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "azure_minKey_det_explicit_id": { - "kms": "azure", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "azure_minKey_det_explicit_altname": { - "kms": "azure", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "azure_maxKey_rand_explicit_id": { - "kms": "azure", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "azure_maxKey_rand_explicit_altname": { - "kms": "azure", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "azure_maxKey_det_explicit_id": { - "kms": "azure", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "azure_maxKey_det_explicit_altname": { - "kms": "azure", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "gcp_double_rand_auto_id": { - "kms": "gcp", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "gcp_double_rand_auto_altname": { - "kms": "gcp", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "gcp_double_rand_explicit_id": { - "kms": "gcp", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "gcp_double_rand_explicit_altname": { - "kms": "gcp", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "gcp_double_det_explicit_id": { - "kms": "gcp", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDouble": "1.234" - } - }, - "gcp_double_det_explicit_altname": { - "kms": "gcp", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDouble": "1.234" - } - }, - "gcp_string_rand_auto_id": { - "kms": "gcp", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "gcp_string_rand_auto_altname": { - "kms": "gcp", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "gcp_string_rand_explicit_id": { - "kms": "gcp", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "gcp_string_rand_explicit_altname": { - "kms": "gcp", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "gcp_string_det_auto_id": { - "kms": "gcp", - "type": "string", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "gcp_string_det_explicit_id": { - "kms": "gcp", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "gcp_string_det_explicit_altname": { - "kms": "gcp", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "gcp_object_rand_auto_id": { - "kms": "gcp", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "gcp_object_rand_auto_altname": { - "kms": "gcp", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "gcp_object_rand_explicit_id": { - "kms": "gcp", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "gcp_object_rand_explicit_altname": { - "kms": "gcp", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "gcp_object_det_explicit_id": { - "kms": "gcp", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "gcp_object_det_explicit_altname": { - "kms": "gcp", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "gcp_array_rand_auto_id": { - "kms": "gcp", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "gcp_array_rand_auto_altname": { - "kms": "gcp", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "gcp_array_rand_explicit_id": { - "kms": "gcp", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "gcp_array_rand_explicit_altname": { - "kms": "gcp", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "gcp_array_det_explicit_id": { - "kms": "gcp", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "gcp_array_det_explicit_altname": { - "kms": "gcp", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "gcp_binData=00_rand_auto_id": { - "kms": "gcp", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "gcp_binData=00_rand_auto_altname": { - "kms": "gcp", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "gcp_binData=00_rand_explicit_id": { - "kms": "gcp", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "gcp_binData=00_rand_explicit_altname": { - "kms": "gcp", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "gcp_binData=00_det_auto_id": { - "kms": "gcp", - "type": "binData=00", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "gcp_binData=00_det_explicit_id": { - "kms": "gcp", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "gcp_binData=00_det_explicit_altname": { - "kms": "gcp", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "gcp_binData=04_rand_auto_id": { - "kms": "gcp", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "gcp_binData=04_rand_auto_altname": { - "kms": "gcp", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "gcp_binData=04_rand_explicit_id": { - "kms": "gcp", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "gcp_binData=04_rand_explicit_altname": { - "kms": "gcp", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "gcp_binData=04_det_auto_id": { - "kms": "gcp", - "type": "binData=04", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "gcp_binData=04_det_explicit_id": { - "kms": "gcp", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "gcp_binData=04_det_explicit_altname": { - "kms": "gcp", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "gcp_undefined_rand_explicit_id": { - "kms": "gcp", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "gcp_undefined_rand_explicit_altname": { - "kms": "gcp", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "gcp_undefined_det_explicit_id": { - "kms": "gcp", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "gcp_undefined_det_explicit_altname": { - "kms": "gcp", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "gcp_objectId_rand_auto_id": { - "kms": "gcp", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "gcp_objectId_rand_auto_altname": { - "kms": "gcp", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "gcp_objectId_rand_explicit_id": { - "kms": "gcp", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "gcp_objectId_rand_explicit_altname": { - "kms": "gcp", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "gcp_objectId_det_auto_id": { - "kms": "gcp", - "type": "objectId", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "gcp_objectId_det_explicit_id": { - "kms": "gcp", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "gcp_objectId_det_explicit_altname": { - "kms": "gcp", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "gcp_bool_rand_auto_id": { - "kms": "gcp", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": true - }, - "gcp_bool_rand_auto_altname": { - "kms": "gcp", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": true - }, - "gcp_bool_rand_explicit_id": { - "kms": "gcp", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": true - }, - "gcp_bool_rand_explicit_altname": { - "kms": "gcp", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": true - }, - "gcp_bool_det_explicit_id": { - "kms": "gcp", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": true - }, - "gcp_bool_det_explicit_altname": { - "kms": "gcp", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": true - }, - "gcp_date_rand_auto_id": { - "kms": "gcp", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "gcp_date_rand_auto_altname": { - "kms": "gcp", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "gcp_date_rand_explicit_id": { - "kms": "gcp", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "gcp_date_rand_explicit_altname": { - "kms": "gcp", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "gcp_date_det_auto_id": { - "kms": "gcp", - "type": "date", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "gcp_date_det_explicit_id": { - "kms": "gcp", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "gcp_date_det_explicit_altname": { - "kms": "gcp", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "gcp_null_rand_explicit_id": { - "kms": "gcp", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "gcp_null_rand_explicit_altname": { - "kms": "gcp", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "gcp_null_det_explicit_id": { - "kms": "gcp", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "gcp_null_det_explicit_altname": { - "kms": "gcp", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "gcp_regex_rand_auto_id": { - "kms": "gcp", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "gcp_regex_rand_auto_altname": { - "kms": "gcp", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "gcp_regex_rand_explicit_id": { - "kms": "gcp", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "gcp_regex_rand_explicit_altname": { - "kms": "gcp", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "gcp_regex_det_auto_id": { - "kms": "gcp", - "type": "regex", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "gcp_regex_det_explicit_id": { - "kms": "gcp", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "gcp_regex_det_explicit_altname": { - "kms": "gcp", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "gcp_dbPointer_rand_auto_id": { - "kms": "gcp", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "gcp_dbPointer_rand_auto_altname": { - "kms": "gcp", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "gcp_dbPointer_rand_explicit_id": { - "kms": "gcp", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "gcp_dbPointer_rand_explicit_altname": { - "kms": "gcp", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "gcp_dbPointer_det_auto_id": { - "kms": "gcp", - "type": "dbPointer", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "gcp_dbPointer_det_explicit_id": { - "kms": "gcp", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "gcp_dbPointer_det_explicit_altname": { - "kms": "gcp", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "gcp_javascript_rand_auto_id": { - "kms": "gcp", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "gcp_javascript_rand_auto_altname": { - "kms": "gcp", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "gcp_javascript_rand_explicit_id": { - "kms": "gcp", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "gcp_javascript_rand_explicit_altname": { - "kms": "gcp", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "gcp_javascript_det_auto_id": { - "kms": "gcp", - "type": "javascript", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "gcp_javascript_det_explicit_id": { - "kms": "gcp", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "gcp_javascript_det_explicit_altname": { - "kms": "gcp", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "gcp_symbol_rand_auto_id": { - "kms": "gcp", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "gcp_symbol_rand_auto_altname": { - "kms": "gcp", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "gcp_symbol_rand_explicit_id": { - "kms": "gcp", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "gcp_symbol_rand_explicit_altname": { - "kms": "gcp", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "gcp_symbol_det_auto_id": { - "kms": "gcp", - "type": "symbol", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "gcp_symbol_det_explicit_id": { - "kms": "gcp", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "gcp_symbol_det_explicit_altname": { - "kms": "gcp", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "gcp_javascriptWithScope_rand_auto_id": { - "kms": "gcp", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "gcp_javascriptWithScope_rand_auto_altname": { - "kms": "gcp", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "gcp_javascriptWithScope_rand_explicit_id": { - "kms": "gcp", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "gcp_javascriptWithScope_rand_explicit_altname": { - "kms": "gcp", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "gcp_javascriptWithScope_det_explicit_id": { - "kms": "gcp", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "gcp_javascriptWithScope_det_explicit_altname": { - "kms": "gcp", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "gcp_int_rand_auto_id": { - "kms": "gcp", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "gcp_int_rand_auto_altname": { - "kms": "gcp", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "gcp_int_rand_explicit_id": { - "kms": "gcp", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "gcp_int_rand_explicit_altname": { - "kms": "gcp", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "gcp_int_det_auto_id": { - "kms": "gcp", - "type": "int", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "gcp_int_det_explicit_id": { - "kms": "gcp", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "gcp_int_det_explicit_altname": { - "kms": "gcp", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "gcp_timestamp_rand_auto_id": { - "kms": "gcp", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "gcp_timestamp_rand_auto_altname": { - "kms": "gcp", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "gcp_timestamp_rand_explicit_id": { - "kms": "gcp", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "gcp_timestamp_rand_explicit_altname": { - "kms": "gcp", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "gcp_timestamp_det_auto_id": { - "kms": "gcp", - "type": "timestamp", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "gcp_timestamp_det_explicit_id": { - "kms": "gcp", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "gcp_timestamp_det_explicit_altname": { - "kms": "gcp", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "gcp_long_rand_auto_id": { - "kms": "gcp", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "gcp_long_rand_auto_altname": { - "kms": "gcp", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "gcp_long_rand_explicit_id": { - "kms": "gcp", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "gcp_long_rand_explicit_altname": { - "kms": "gcp", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "gcp_long_det_auto_id": { - "kms": "gcp", - "type": "long", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "gcp_long_det_explicit_id": { - "kms": "gcp", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "gcp_long_det_explicit_altname": { - "kms": "gcp", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "gcp_decimal_rand_auto_id": { - "kms": "gcp", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "gcp_decimal_rand_auto_altname": { - "kms": "gcp", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "gcp_decimal_rand_explicit_id": { - "kms": "gcp", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "gcp_decimal_rand_explicit_altname": { - "kms": "gcp", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "gcp_decimal_det_explicit_id": { - "kms": "gcp", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "gcp_decimal_det_explicit_altname": { - "kms": "gcp", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "gcp_minKey_rand_explicit_id": { - "kms": "gcp", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "gcp_minKey_rand_explicit_altname": { - "kms": "gcp", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "gcp_minKey_det_explicit_id": { - "kms": "gcp", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "gcp_minKey_det_explicit_altname": { - "kms": "gcp", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "gcp_maxKey_rand_explicit_id": { - "kms": "gcp", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "gcp_maxKey_rand_explicit_altname": { - "kms": "gcp", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "gcp_maxKey_det_explicit_id": { - "kms": "gcp", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "gcp_maxKey_det_explicit_altname": { - "kms": "gcp", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "kmip_double_rand_auto_id": { - "kms": "kmip", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "kmip_double_rand_auto_altname": { - "kms": "kmip", - "type": "double", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "kmip_double_rand_explicit_id": { - "kms": "kmip", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "kmip_double_rand_explicit_altname": { - "kms": "kmip", - "type": "double", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDouble": "1.234" - } - }, - "kmip_double_det_explicit_id": { - "kms": "kmip", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDouble": "1.234" - } - }, - "kmip_double_det_explicit_altname": { - "kms": "kmip", - "type": "double", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDouble": "1.234" - } - }, - "kmip_string_rand_auto_id": { - "kms": "kmip", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "kmip_string_rand_auto_altname": { - "kms": "kmip", - "type": "string", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "kmip_string_rand_explicit_id": { - "kms": "kmip", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "kmip_string_rand_explicit_altname": { - "kms": "kmip", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "kmip_string_det_auto_id": { - "kms": "kmip", - "type": "string", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "kmip_string_det_explicit_id": { - "kms": "kmip", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "mongodb" - }, - "kmip_string_det_explicit_altname": { - "kms": "kmip", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": "mongodb" - }, - "kmip_object_rand_auto_id": { - "kms": "kmip", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "kmip_object_rand_auto_altname": { - "kms": "kmip", - "type": "object", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "kmip_object_rand_explicit_id": { - "kms": "kmip", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "kmip_object_rand_explicit_altname": { - "kms": "kmip", - "type": "object", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "kmip_object_det_explicit_id": { - "kms": "kmip", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "kmip_object_det_explicit_altname": { - "kms": "kmip", - "type": "object", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "x": { - "$numberInt": "1" - } - } - }, - "kmip_array_rand_auto_id": { - "kms": "kmip", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "kmip_array_rand_auto_altname": { - "kms": "kmip", - "type": "array", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "kmip_array_rand_explicit_id": { - "kms": "kmip", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "kmip_array_rand_explicit_altname": { - "kms": "kmip", - "type": "array", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "kmip_array_det_explicit_id": { - "kms": "kmip", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "kmip_array_det_explicit_altname": { - "kms": "kmip", - "type": "array", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": [ - { - "$numberInt": "1" - }, - { - "$numberInt": "2" - }, - { - "$numberInt": "3" - } - ] - }, - "kmip_binData=00_rand_auto_id": { - "kms": "kmip", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "kmip_binData=00_rand_auto_altname": { - "kms": "kmip", - "type": "binData=00", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "kmip_binData=00_rand_explicit_id": { - "kms": "kmip", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "kmip_binData=00_rand_explicit_altname": { - "kms": "kmip", - "type": "binData=00", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "kmip_binData=00_det_auto_id": { - "kms": "kmip", - "type": "binData=00", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "kmip_binData=00_det_explicit_id": { - "kms": "kmip", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "kmip_binData=00_det_explicit_altname": { - "kms": "kmip", - "type": "binData=00", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AQIDBA==", - "subType": "00" - } - } - }, - "kmip_binData=04_rand_auto_id": { - "kms": "kmip", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "kmip_binData=04_rand_auto_altname": { - "kms": "kmip", - "type": "binData=04", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "kmip_binData=04_rand_explicit_id": { - "kms": "kmip", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "kmip_binData=04_rand_explicit_altname": { - "kms": "kmip", - "type": "binData=04", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "kmip_binData=04_det_auto_id": { - "kms": "kmip", - "type": "binData=04", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "kmip_binData=04_det_explicit_id": { - "kms": "kmip", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "kmip_binData=04_det_explicit_altname": { - "kms": "kmip", - "type": "binData=04", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$binary": { - "base64": "AAECAwQFBgcICQoLDA0ODw==", - "subType": "04" - } - } - }, - "kmip_undefined_rand_explicit_id": { - "kms": "kmip", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "kmip_undefined_rand_explicit_altname": { - "kms": "kmip", - "type": "undefined", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "kmip_undefined_det_explicit_id": { - "kms": "kmip", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$undefined": true - } - }, - "kmip_undefined_det_explicit_altname": { - "kms": "kmip", - "type": "undefined", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$undefined": true - } - }, - "kmip_objectId_rand_auto_id": { - "kms": "kmip", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "kmip_objectId_rand_auto_altname": { - "kms": "kmip", - "type": "objectId", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "kmip_objectId_rand_explicit_id": { - "kms": "kmip", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "kmip_objectId_rand_explicit_altname": { - "kms": "kmip", - "type": "objectId", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "kmip_objectId_det_auto_id": { - "kms": "kmip", - "type": "objectId", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "kmip_objectId_det_explicit_id": { - "kms": "kmip", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "kmip_objectId_det_explicit_altname": { - "kms": "kmip", - "type": "objectId", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$oid": "01234567890abcdef0123456" - } - }, - "kmip_bool_rand_auto_id": { - "kms": "kmip", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": true - }, - "kmip_bool_rand_auto_altname": { - "kms": "kmip", - "type": "bool", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": true - }, - "kmip_bool_rand_explicit_id": { - "kms": "kmip", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": true - }, - "kmip_bool_rand_explicit_altname": { - "kms": "kmip", - "type": "bool", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": true - }, - "kmip_bool_det_explicit_id": { - "kms": "kmip", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": true - }, - "kmip_bool_det_explicit_altname": { - "kms": "kmip", - "type": "bool", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": true - }, - "kmip_date_rand_auto_id": { - "kms": "kmip", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "kmip_date_rand_auto_altname": { - "kms": "kmip", - "type": "date", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "kmip_date_rand_explicit_id": { - "kms": "kmip", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "kmip_date_rand_explicit_altname": { - "kms": "kmip", - "type": "date", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "kmip_date_det_auto_id": { - "kms": "kmip", - "type": "date", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "kmip_date_det_explicit_id": { - "kms": "kmip", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "kmip_date_det_explicit_altname": { - "kms": "kmip", - "type": "date", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$date": { - "$numberLong": "12345" - } - } - }, - "kmip_null_rand_explicit_id": { - "kms": "kmip", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "kmip_null_rand_explicit_altname": { - "kms": "kmip", - "type": "null", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "kmip_null_det_explicit_id": { - "kms": "kmip", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": null - }, - "kmip_null_det_explicit_altname": { - "kms": "kmip", - "type": "null", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": null - }, - "kmip_regex_rand_auto_id": { - "kms": "kmip", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "kmip_regex_rand_auto_altname": { - "kms": "kmip", - "type": "regex", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "kmip_regex_rand_explicit_id": { - "kms": "kmip", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "kmip_regex_rand_explicit_altname": { - "kms": "kmip", - "type": "regex", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "kmip_regex_det_auto_id": { - "kms": "kmip", - "type": "regex", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "kmip_regex_det_explicit_id": { - "kms": "kmip", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "kmip_regex_det_explicit_altname": { - "kms": "kmip", - "type": "regex", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$regularExpression": { - "pattern": ".*", - "options": "" - } - } - }, - "kmip_dbPointer_rand_auto_id": { - "kms": "kmip", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "kmip_dbPointer_rand_auto_altname": { - "kms": "kmip", - "type": "dbPointer", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "kmip_dbPointer_rand_explicit_id": { - "kms": "kmip", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "kmip_dbPointer_rand_explicit_altname": { - "kms": "kmip", - "type": "dbPointer", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "kmip_dbPointer_det_auto_id": { - "kms": "kmip", - "type": "dbPointer", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "kmip_dbPointer_det_explicit_id": { - "kms": "kmip", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "kmip_dbPointer_det_explicit_altname": { - "kms": "kmip", - "type": "dbPointer", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$dbPointer": { - "$ref": "db.example", - "$id": { - "$oid": "01234567890abcdef0123456" - } - } - } - }, - "kmip_javascript_rand_auto_id": { - "kms": "kmip", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "kmip_javascript_rand_auto_altname": { - "kms": "kmip", - "type": "javascript", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "kmip_javascript_rand_explicit_id": { - "kms": "kmip", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "kmip_javascript_rand_explicit_altname": { - "kms": "kmip", - "type": "javascript", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "kmip_javascript_det_auto_id": { - "kms": "kmip", - "type": "javascript", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "kmip_javascript_det_explicit_id": { - "kms": "kmip", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "kmip_javascript_det_explicit_altname": { - "kms": "kmip", - "type": "javascript", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1" - } - }, - "kmip_symbol_rand_auto_id": { - "kms": "kmip", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "kmip_symbol_rand_auto_altname": { - "kms": "kmip", - "type": "symbol", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "kmip_symbol_rand_explicit_id": { - "kms": "kmip", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "kmip_symbol_rand_explicit_altname": { - "kms": "kmip", - "type": "symbol", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "kmip_symbol_det_auto_id": { - "kms": "kmip", - "type": "symbol", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "kmip_symbol_det_explicit_id": { - "kms": "kmip", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "kmip_symbol_det_explicit_altname": { - "kms": "kmip", - "type": "symbol", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$symbol": "mongodb-symbol" - } - }, - "kmip_javascriptWithScope_rand_auto_id": { - "kms": "kmip", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "kmip_javascriptWithScope_rand_auto_altname": { - "kms": "kmip", - "type": "javascriptWithScope", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "kmip_javascriptWithScope_rand_explicit_id": { - "kms": "kmip", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "kmip_javascriptWithScope_rand_explicit_altname": { - "kms": "kmip", - "type": "javascriptWithScope", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "kmip_javascriptWithScope_det_explicit_id": { - "kms": "kmip", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "kmip_javascriptWithScope_det_explicit_altname": { - "kms": "kmip", - "type": "javascriptWithScope", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$code": "x=1", - "$scope": {} - } - }, - "kmip_int_rand_auto_id": { - "kms": "kmip", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "kmip_int_rand_auto_altname": { - "kms": "kmip", - "type": "int", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "kmip_int_rand_explicit_id": { - "kms": "kmip", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "kmip_int_rand_explicit_altname": { - "kms": "kmip", - "type": "int", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "kmip_int_det_auto_id": { - "kms": "kmip", - "type": "int", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "kmip_int_det_explicit_id": { - "kms": "kmip", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "kmip_int_det_explicit_altname": { - "kms": "kmip", - "type": "int", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberInt": "123" - } - }, - "kmip_timestamp_rand_auto_id": { - "kms": "kmip", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "kmip_timestamp_rand_auto_altname": { - "kms": "kmip", - "type": "timestamp", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "kmip_timestamp_rand_explicit_id": { - "kms": "kmip", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "kmip_timestamp_rand_explicit_altname": { - "kms": "kmip", - "type": "timestamp", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "kmip_timestamp_det_auto_id": { - "kms": "kmip", - "type": "timestamp", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "kmip_timestamp_det_explicit_id": { - "kms": "kmip", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "kmip_timestamp_det_explicit_altname": { - "kms": "kmip", - "type": "timestamp", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$timestamp": { - "t": 0, - "i": 12345 - } - } - }, - "kmip_long_rand_auto_id": { - "kms": "kmip", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "kmip_long_rand_auto_altname": { - "kms": "kmip", - "type": "long", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "kmip_long_rand_explicit_id": { - "kms": "kmip", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "kmip_long_rand_explicit_altname": { - "kms": "kmip", - "type": "long", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "kmip_long_det_auto_id": { - "kms": "kmip", - "type": "long", - "algo": "det", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "kmip_long_det_explicit_id": { - "kms": "kmip", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "kmip_long_det_explicit_altname": { - "kms": "kmip", - "type": "long", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberLong": "456" - } - }, - "kmip_decimal_rand_auto_id": { - "kms": "kmip", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "id", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "kmip_decimal_rand_auto_altname": { - "kms": "kmip", - "type": "decimal", - "algo": "rand", - "method": "auto", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "kmip_decimal_rand_explicit_id": { - "kms": "kmip", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "kmip_decimal_rand_explicit_altname": { - "kms": "kmip", - "type": "decimal", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": true, - "value": { - "$numberDecimal": "1.234" - } - }, - "kmip_decimal_det_explicit_id": { - "kms": "kmip", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "kmip_decimal_det_explicit_altname": { - "kms": "kmip", - "type": "decimal", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$numberDecimal": "1.234" - } - }, - "kmip_minKey_rand_explicit_id": { - "kms": "kmip", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "kmip_minKey_rand_explicit_altname": { - "kms": "kmip", - "type": "minKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "kmip_minKey_det_explicit_id": { - "kms": "kmip", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "kmip_minKey_det_explicit_altname": { - "kms": "kmip", - "type": "minKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$minKey": 1 - } - }, - "kmip_maxKey_rand_explicit_id": { - "kms": "kmip", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "kmip_maxKey_rand_explicit_altname": { - "kms": "kmip", - "type": "maxKey", - "algo": "rand", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "kmip_maxKey_det_explicit_id": { - "kms": "kmip", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "kmip_maxKey_det_explicit_altname": { - "kms": "kmip", - "type": "maxKey", - "algo": "det", - "method": "explicit", - "identifier": "altname", - "allowed": false, - "value": { - "$maxKey": 1 - } - }, - "payload=0,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "" - }, - "payload=1,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "a" - }, - "payload=2,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aa" - }, - "payload=3,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaa" - }, - "payload=4,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaa" - }, - "payload=5,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaa" - }, - "payload=6,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaa" - }, - "payload=7,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaa" - }, - "payload=8,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaa" - }, - "payload=9,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaa" - }, - "payload=10,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaa" - }, - "payload=11,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaaa" - }, - "payload=12,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaaaa" - }, - "payload=13,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaaaaa" - }, - "payload=14,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaaaaaa" - }, - "payload=15,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaaaaaaa" - }, - "payload=16,algo=rand": { - "kms": "local", - "type": "string", - "algo": "rand", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaaaaaaaa" - }, - "payload=0,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "" - }, - "payload=1,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "a" - }, - "payload=2,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aa" - }, - "payload=3,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaa" - }, - "payload=4,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaa" - }, - "payload=5,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaa" - }, - "payload=6,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaa" - }, - "payload=7,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaa" - }, - "payload=8,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaa" - }, - "payload=9,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaa" - }, - "payload=10,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaa" - }, - "payload=11,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaaa" - }, - "payload=12,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaaaa" - }, - "payload=13,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaaaaa" - }, - "payload=14,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaaaaaa" - }, - "payload=15,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaaaaaaa" - }, - "payload=16,algo=det": { - "kms": "local", - "type": "string", - "algo": "det", - "method": "explicit", - "identifier": "id", - "allowed": true, - "value": "aaaaaaaaaaaaaaaa" - } -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-data/encryptedFields.json b/driver-core/src/test/resources/client-side-encryption-data/encryptedFields.json deleted file mode 100644 index 88abe5a604b..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/encryptedFields.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-data/keys/key1-document.json b/driver-core/src/test/resources/client-side-encryption-data/keys/key1-document.json deleted file mode 100644 index 566b56c354f..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/keys/key1-document.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } -} diff --git a/driver-core/src/test/resources/client-side-encryption-data/keys/key1-id.json b/driver-core/src/test/resources/client-side-encryption-data/keys/key1-id.json deleted file mode 100644 index 7d18f52ebbc..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/keys/key1-id.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } -} diff --git a/driver-core/src/test/resources/client-side-encryption-data/keys/key2-document.json b/driver-core/src/test/resources/client-side-encryption-data/keys/key2-document.json deleted file mode 100644 index a654d980ba9..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/keys/key2-document.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "_id": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "HBk9BWihXExNDvTp1lUxOuxuZK2Pe2ZdVdlsxPEBkiO1bS4mG5NNDsQ7zVxJAH8BtdOYp72Ku4Y3nwc0BUpIKsvAKX4eYXtlhv5zUQxWdeNFhg9qK7qb8nqhnnLeT0f25jFSqzWJoT379hfwDeu0bebJHr35QrJ8myZdPMTEDYF08QYQ48ShRBli0S+QzBHHAQiM2iJNr4svg2WR8JSeWQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } -} diff --git a/driver-core/src/test/resources/client-side-encryption-data/keys/key2-id.json b/driver-core/src/test/resources/client-side-encryption-data/keys/key2-id.json deleted file mode 100644 index 6e9b87bbc24..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/keys/key2-id.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } -} diff --git a/driver-core/src/test/resources/client-side-encryption-data/lookup/key-doc.json b/driver-core/src/test/resources/client-side-encryption-data/lookup/key-doc.json deleted file mode 100644 index 566b56c354f..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/lookup/key-doc.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } -} diff --git a/driver-core/src/test/resources/client-side-encryption-data/lookup/schema-csfle.json b/driver-core/src/test/resources/client-side-encryption-data/lookup/schema-csfle.json deleted file mode 100644 index 29ac9ad5da4..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/lookup/schema-csfle.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "properties": { - "csfle": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" -} diff --git a/driver-core/src/test/resources/client-side-encryption-data/lookup/schema-csfle2.json b/driver-core/src/test/resources/client-side-encryption-data/lookup/schema-csfle2.json deleted file mode 100644 index 3f1c02781c5..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/lookup/schema-csfle2.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "properties": { - "csfle2": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" -} diff --git a/driver-core/src/test/resources/client-side-encryption-data/lookup/schema-qe.json b/driver-core/src/test/resources/client-side-encryption-data/lookup/schema-qe.json deleted file mode 100644 index 9428ea1b458..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/lookup/schema-qe.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "escCollection": "enxcol_.qe.esc", - "ecocCollection": "enxcol_.qe.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "qe", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": 0 - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption-data/lookup/schema-qe2.json b/driver-core/src/test/resources/client-side-encryption-data/lookup/schema-qe2.json deleted file mode 100644 index 77d5bd37cbb..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/lookup/schema-qe2.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "escCollection": "enxcol_.qe2.esc", - "ecocCollection": "enxcol_.qe2.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "qe2", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": 0 - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-Date.json b/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-Date.json deleted file mode 100644 index defa6e37ff1..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-Date.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-DecimalNoPrecision.json b/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-DecimalNoPrecision.json deleted file mode 100644 index dbe28e9c105..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-DecimalNoPrecision.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-DecimalPrecision.json b/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-DecimalPrecision.json deleted file mode 100644 index 538ab20f0ed..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-DecimalPrecision.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-DoubleNoPrecision.json b/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-DoubleNoPrecision.json deleted file mode 100644 index fb4f46d3753..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-DoubleNoPrecision.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-DoublePrecision.json b/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-DoublePrecision.json deleted file mode 100644 index 07d1c84d6f0..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-DoublePrecision.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-Int.json b/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-Int.json deleted file mode 100644 index 4f0b4854e42..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-Int.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-Long.json b/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-Long.json deleted file mode 100644 index 32fe1ea15db..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-data/range-encryptedFields-Long.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-external/external-key.json b/driver-core/src/test/resources/client-side-encryption-external/external-key.json deleted file mode 100644 index b3fe0723b06..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-external/external-key.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "status": { - "$numberInt": "1" - }, - "_id": { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "local" - }, - "updateDate": { - "$date": { - "$numberLong": "1557827033449" - } - }, - "keyMaterial": { - "$binary": { - "base64": "Ce9HSz/HKKGkIt4uyy+jDuKGA+rLC2cycykMo6vc8jXxqa1UVDYHWq1r+vZKbnnSRBfB981akzRKZCFpC05CTyFqDhXv6OnMjpG97OZEREGIsHEYiJkBW0jJJvfLLgeLsEpBzsro9FztGGXASxyxFRZFhXvHxyiLOKrdWfs7X1O/iK3pEoHMx6uSNSfUOgbebLfIqW7TO++iQS5g1xovXA==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1557827033449" - } - }, - "keyAltNames": [ "local" ] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-external/external-schema.json b/driver-core/src/test/resources/client-side-encryption-external/external-schema.json deleted file mode 100644 index 7d8cad8c33d..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-external/external-schema.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "properties": { - "encrypted": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" -} diff --git a/driver-core/src/test/resources/client-side-encryption-limits/limits-doc.json b/driver-core/src/test/resources/client-side-encryption-limits/limits-doc.json deleted file mode 100644 index 53de52326c6..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-limits/limits-doc.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "00": "a", - "01": "a", - "02": "a", - "03": "a", - "04": "a", - "05": "a", - "06": "a", - "07": "a", - "08": "a", - "09": "a", - "10": "a", - "11": "a", - "12": "a", - "13": "a", - "14": "a", - "15": "a", - "16": "a", - "17": "a", - "18": "a", - "19": "a", - "20": "a", - "21": "a", - "22": "a", - "23": "a", - "24": "a", - "25": "a", - "26": "a", - "27": "a", - "28": "a", - "29": "a", - "30": "a", - "31": "a", - "32": "a", - "33": "a", - "34": "a", - "35": "a", - "36": "a", - "37": "a", - "38": "a", - "39": "a", - "40": "a", - "41": "a", - "42": "a", - "43": "a", - "44": "a", - "45": "a", - "46": "a", - "47": "a", - "48": "a", - "49": "a", - "50": "a", - "51": "a", - "52": "a", - "53": "a", - "54": "a", - "55": "a", - "56": "a", - "57": "a", - "58": "a", - "59": "a", - "60": "a", - "61": "a", - "62": "a", - "63": "a", - "64": "a", - "65": "a", - "66": "a", - "67": "a", - "68": "a", - "69": "a", - "70": "a", - "71": "a", - "72": "a", - "73": "a", - "74": "a", - "75": "a", - "76": "a", - "77": "a", - "78": "a", - "79": "a", - "80": "a", - "81": "a", - "82": "a", - "83": "a", - "84": "a", - "85": "a", - "86": "a", - "87": "a", - "88": "a", - "89": "a", - "90": "a", - "91": "a", - "92": "a", - "93": "a", - "94": "a", - "95": "a", - "96": "a", - "97": "a", - "98": "a", - "99": "a" -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-limits/limits-key.json b/driver-core/src/test/resources/client-side-encryption-limits/limits-key.json deleted file mode 100644 index b3fe0723b06..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-limits/limits-key.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "status": { - "$numberInt": "1" - }, - "_id": { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "local" - }, - "updateDate": { - "$date": { - "$numberLong": "1557827033449" - } - }, - "keyMaterial": { - "$binary": { - "base64": "Ce9HSz/HKKGkIt4uyy+jDuKGA+rLC2cycykMo6vc8jXxqa1UVDYHWq1r+vZKbnnSRBfB981akzRKZCFpC05CTyFqDhXv6OnMjpG97OZEREGIsHEYiJkBW0jJJvfLLgeLsEpBzsro9FztGGXASxyxFRZFhXvHxyiLOKrdWfs7X1O/iK3pEoHMx6uSNSfUOgbebLfIqW7TO++iQS5g1xovXA==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1557827033449" - } - }, - "keyAltNames": [ "local" ] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption-limits/limits-schema.json b/driver-core/src/test/resources/client-side-encryption-limits/limits-schema.json deleted file mode 100644 index c06908d9ce7..00000000000 --- a/driver-core/src/test/resources/client-side-encryption-limits/limits-schema.json +++ /dev/null @@ -1,1405 +0,0 @@ -{ - "properties": { - "00": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "01": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "02": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "03": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "04": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "05": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "06": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "07": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "08": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "09": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "10": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "11": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "12": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "13": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "14": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "15": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "16": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "17": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "18": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "19": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "20": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "21": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "22": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "23": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "24": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "25": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "26": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "27": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "28": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "29": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "30": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "31": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "32": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "33": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "34": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "35": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "36": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "37": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "38": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "39": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "40": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "41": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "42": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "43": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "44": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "45": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "46": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "47": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "48": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "49": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "50": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "51": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "52": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "53": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "54": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "55": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "56": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "57": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "58": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "59": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "60": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "61": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "62": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "63": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "64": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "65": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "66": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "67": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "68": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "69": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "70": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "71": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "72": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "73": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "74": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "75": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "76": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "77": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "78": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "79": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "80": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "81": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "82": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "83": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "84": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "85": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "86": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "87": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "88": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "89": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "90": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "91": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "92": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "93": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "94": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "95": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "96": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "97": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "98": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "99": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "LOCALAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" -} \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption/README.rst b/driver-core/src/test/resources/client-side-encryption/README.rst deleted file mode 100644 index 6bf35a5ae4e..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/README.rst +++ /dev/null @@ -1,2514 +0,0 @@ -============================ -Client Side Encryption Tests -============================ - -.. contents:: - ----- - -Introduction -============ - -This document describes the format of the driver spec tests included in the -JSON and YAML files included in the ``legacy`` sub-directory. Tests in the -``unified`` directory are written using the `Unified Test Format -<../../unified-test-format/unified-test-format.rst>`_. - -The ``timeoutMS.yml``/``timeoutMS.json`` files in this directory contain tests -for the ``timeoutMS`` option and its application to the client-side encryption -feature. Drivers MUST only run these tests after implementing the -`Client Side Operations Timeout -<../client-side-operations-timeout/client-side-operations-timeout.rst>`__ -specification. - -Additional prose tests, that are not represented in the spec tests, are described -and MUST be implemented by all drivers. - -Spec Test Format -================ - -The spec tests format is an extension of `transactions spec tests `_ with some additions: - -- A ``json_schema`` to set on the collection used for operations. - -- An ``encrypted_fields`` to set on the collection used for operations. - -- A ``key_vault_data`` of data that should be inserted in the key vault collection before each test. - -- Introduction ``autoEncryptOpts`` to `clientOptions` - -- Addition of `$db` to command in `command_started_event` - -- Addition of `$$type` to command_started_event and outcome. - -The semantics of `$$type` is that any actual value matching one of the types indicated by either a BSON type string -or an array of BSON type strings is considered a match. - -For example, the following matches a command_started_event for an insert of a document where `random` must be of type ``binData``:: - - - command_started_event: - command: - insert: *collection_name - documents: - - { random: { $$type: "binData" } } - ordered: true - command_name: insert - -The following matches a command_started_event for an insert of a document where ``random`` must be of type -``binData`` or ``string``:: - - - command_started_event: - command: - insert: *collection_name - documents: - - { random: { $$type: ["binData", "string"] } } - ordered: true - command_name: insert - -The values of `$$type` correspond to `these documented string representations of BSON types `_. - - -Each YAML file has the following keys: - -.. |txn| replace:: Unchanged from Transactions spec tests. - -- ``runOn`` |txn| - -- ``database_name`` |txn| - -- ``collection_name`` |txn| - -- ``data`` |txn| - -- ``json_schema`` A JSON Schema that should be set on the collection (using ``createCollection``) before each test run. - -- ``encrypted_fields`` An encryptedFields option that should be set on the collection (using ``createCollection``) before each test run. - -- ``key_vault_data`` The data that should exist in the key vault collection under test before each test run. - -- ``tests``: An array of tests that are to be run independently of each other. - Each test will have some or all of the following fields: - - - ``description``: |txn| - - - ``skipReason``: |txn| - - - ``useMultipleMongoses``: |txn| - - - ``failPoint``: |txn| - - - ``clientOptions``: Optional, parameters to pass to MongoClient(). - - - ``autoEncryptOpts``: Optional - - - ``kmsProviders`` A dictionary of KMS providers to set on the key vault ("aws" or "local") - - - ``aws`` The AWS KMS provider. An empty object. Drivers MUST fill in AWS credentials (`accessKeyId`, `secretAccessKey`) from the environment. - - - ``azure`` The Azure KMS provider credentials. An empty object. Drivers MUST fill in Azure credentials (`tenantId`, `clientId`, and `clientSecret`) from the environment. - - - ``gcp`` The GCP KMS provider credentials. An empty object. Drivers MUST fill in GCP credentials (`email`, `privateKey`) from the environment. - - - ``local`` The local KMS provider. - - - ``key`` A 96 byte local key. - - - ``kmip`` The KMIP KMS provider credentials. An empty object. Drivers MUST fill in KMIP credentials (`endpoint`, and TLS options). - - - ``schemaMap``: Optional, a map from namespaces to local JSON schemas. - - - ``keyVaultNamespace``: Optional, a namespace to the key vault collection. Defaults to "keyvault.datakeys". - - - ``bypassAutoEncryption``: Optional, a boolean to indicate whether or not auto encryption should be bypassed. Defaults to ``false``. - - - ``encryptedFieldsMap`` An optional document. The document maps collection namespace to ``EncryptedFields`` documents. - - - ``operations``: Array of documents, each describing an operation to be - executed. Each document has the following fields: - - - ``name``: |txn| - - - ``object``: |txn|. Defaults to "collection" if omitted. - - - ``collectionOptions``: |txn| - - - ``command_name``: |txn| - - - ``arguments``: |txn| - - - ``result``: Same as the Transactions spec test format with one addition: if the operation is expected to return - an error, the ``result`` document may contain an ``isTimeoutError`` boolean field. If ``true``, the test runner - MUST assert that the error represents a timeout due to the use of the ``timeoutMS`` option. If ``false``, the - test runner MUST assert that the error does not represent a timeout. - - - ``expectations``: |txn| - - - ``outcome``: |txn| - - - -Use as integration tests -======================== - -Do the following before running spec tests: - -- If available for the platform under test, obtain a crypt_shared_ binary and place it - in a location accessible to the tests. Refer to: `Using crypt_shared`_ -- Start the mongocryptd process. -- Start a mongod process with **server version 4.1.9 or later**. -- Place credentials to an AWS IAM user (access key ID + secret access key) somewhere in the environment outside of tracked code. (If testing on evergreen, project variables are a good place). -- Start a KMIP test server on port 5698 by running `drivers-evergreen-tools/.evergreen/csfle/kms_kmip_server.py `_. - -.. _crypt_shared: ../client-side-encryption.rst#crypt_shared - -Load each YAML (or JSON) file using a Canonical Extended JSON parser. - -Then for each element in ``tests``: - -#. If the ``skipReason`` field is present, skip this test completely. -#. If the ``key_vault_data`` field is present: - - #. Drop the ``keyvault.datakeys`` collection using writeConcern "majority". - #. Insert the data specified into the ``keyvault.datakeys`` with write concern "majority". - -#. Create a MongoClient. - -#. Create a collection object from the MongoClient, using the ``database_name`` - and ``collection_name`` fields from the YAML file. Drop the collection - with writeConcern "majority". If a ``json_schema`` is defined in the test, - use the ``createCollection`` command to explicitly create the collection: - - .. code:: typescript - - {"create": , "validator": {"$jsonSchema": }} - - If ``encrypted_fields`` is defined in the test, the required collections and index described in `Create and Drop Collection Helpers `_ must be created: - - - Use the ``dropCollection`` helper with ``encrypted_fields`` as an option and writeConcern "majority". - - Use the ``createCollection`` helper with ``encrypted_fields`` as an option. - -#. If the YAML file contains a ``data`` array, insert the documents in ``data`` - into the test collection, using writeConcern "majority". - -#. Create a **new** MongoClient using ``clientOptions``. - - #. If ``autoEncryptOpts`` includes ``aws``, ``awsTemporary``, ``awsTemporaryNoSessionToken``, - ``azure``, ``gcp``, and/or ``kmip`` as a KMS provider, pass in credentials from the environment. - - - ``awsTemporary``, and ``awsTemporaryNoSessionToken`` require temporary - AWS credentials. These can be retrieved using the csfle `set-temp-creds.sh - `_ - script. - - - ``aws``, ``awsTemporary``, and ``awsTemporaryNoSessionToken`` are - mutually exclusive. - - ``aws`` should be substituted with: - - .. code:: javascript - - "aws": { - "accessKeyId": , - "secretAccessKey": - } - - ``awsTemporary`` should be substituted with: - - .. code:: javascript - - "aws": { - "accessKeyId": , - "secretAccessKey": - "sessionToken": - } - - ``awsTemporaryNoSessionToken`` should be substituted with: - - .. code:: javascript - - "aws": { - "accessKeyId": , - "secretAccessKey": - } - - ``gcp`` should be substituted with: - - .. code:: javascript - - "gcp": { - "email": , - "privateKey": , - } - - ``azure`` should be substituted with: - - .. code:: javascript - - "azure": { - "tenantId": , - "clientId": , - "clientSecret": , - } - - ``local`` should be substituted with: - - .. code:: javascript - - "local": { "key": } - - ``kmip`` should be substituted with: - - .. code:: javascript - - "kmip": { "endpoint": "localhost:5698" } - - Configure KMIP TLS connections to use the following options: - - - ``tlsCAFile`` (or equivalent) set to `drivers-evergreen-tools/.evergreen/x509gen/ca.pem `_. This MAY be configured system-wide. - - ``tlsCertificateKeyFile`` (or equivalent) set to `drivers-evergreen-tools/.evergreen/x509gen/client.pem `_. - - The method of passing TLS options for KMIP TLS connections is driver dependent. - - #. If ``autoEncryptOpts`` does not include ``keyVaultNamespace``, default it - to ``keyvault.datakeys``. - -#. For each element in ``operations``: - - - Enter a "try" block or your programming language's closest equivalent. - - Create a Database object from the MongoClient, using the ``database_name`` - field at the top level of the test file. - - Create a Collection object from the Database, using the - ``collection_name`` field at the top level of the test file. - If ``collectionOptions`` is present create the Collection object with the - provided options. Otherwise create the object with the default options. - - Execute the named method on the provided ``object``, passing the - arguments listed. - - If the driver throws an exception / returns an error while executing this - series of operations, store the error message and server error code. - - If the result document has an "errorContains" field, verify that the - method threw an exception or returned an error, and that the value of the - "errorContains" field matches the error string. "errorContains" is a - substring (case-insensitive) of the actual error message. - - If the result document has an "errorCodeName" field, verify that the - method threw a command failed exception or returned an error, and that - the value of the "errorCodeName" field matches the "codeName" in the - server error response. - - If the result document has an "errorLabelsContain" field, verify that the - method threw an exception or returned an error. Verify that all of the - error labels in "errorLabelsContain" are present in the error or exception - using the ``hasErrorLabel`` method. - - If the result document has an "errorLabelsOmit" field, verify that the - method threw an exception or returned an error. Verify that none of the - error labels in "errorLabelsOmit" are present in the error or exception - using the ``hasErrorLabel`` method. - - If the operation returns a raw command response, eg from ``runCommand``, - then compare only the fields present in the expected result document. - Otherwise, compare the method's return value to ``result`` using the same - logic as the CRUD Spec Tests runner. - -#. If the test includes a list of command-started events in ``expectations``, - compare them to the actual command-started events using the - same logic as the Command Monitoring Spec Tests runner. - -#. For each element in ``outcome``: - - - If ``name`` is "collection", create a new MongoClient *without encryption* - and verify that the test collection contains exactly the documents in the - ``data`` array. Ensure this find reads the latest data by using - **primary read preference** with **local read concern** even when the - MongoClient is configured with another read preference or read concern. - -The spec test MUST be run with *and* without auth. - - -Using ``crypt_shared`` -====================== - -On platforms where crypt_shared_ is available, drivers should prefer to test -with the ``crypt_shared`` library instead of spawning mongocryptd. - -crypt_shared_ is released alongside the server. -crypt_shared_ is only available in versions 6.0 and above. -Drivers SHOULD prefer testing a version of crypt_shared_ that matches the server version being tested. -Driver tests on server versions less than 6.0 SHOULD use mongocryptd. - -Drivers MUST continue to run all tests with mongocryptd on at least one -platform for all tested server versions. - -Note that some tests assert on mongocryptd-related behaviors (e.g. the -``mongocryptdBypassSpawn`` test). - -Drivers under test should load the crypt_shared_ library using either the -``cryptSharedLibPath`` public API option (as part of the AutoEncryption -``extraOptions``), or by setting a special search path instead. - -Some tests will require *not* using crypt_shared_. For such tests, one should -ensure that ``crypt_shared`` will not be loaded. Refer to the -client-side-encryption documentation for information on "disabling" -``crypt_shared`` and setting library search paths. - -.. note:: - - The crypt_shared_ dynamic library can be obtained using the mongodl_ Python - script from drivers-evergreen-tools_: - - .. code-block:: shell - - $ python3 mongodl.py --component=crypt_shared --version= --out=./crypt_shared/ - - Other versions of ``crypt_shared`` are also available. Please use the - ``--list`` option to see versions. - -.. _mongodl: https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/mongodl.py -.. _drivers-evergreen-tools: https://github.com/mongodb-labs/drivers-evergreen-tools/ - - - -Prose Tests -=========== - -Tests for the ClientEncryption type are not included as part of the YAML tests. - -In the prose tests LOCAL_MASTERKEY refers to the following base64: - -.. code:: javascript - - Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk - -Perform all applicable operations on key vault collections (e.g. inserting an example data key, or running a find command) with readConcern/writeConcern "majority". - -1. Custom Key Material Test -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -#. Create a ``MongoClient`` object (referred to as ``client``). - -#. Using ``client``, drop the collection ``keyvault.datakeys``. - -#. Create a ``ClientEncryption`` object (referred to as ``client_encryption``) with ``client`` set as the ``keyVaultClient``. - -#. Using ``client_encryption``, create a data key with a ``local`` KMS provider and the following custom key material (given as base64): - -.. code:: javascript - - xPTAjBRG5JiPm+d3fj6XLi2q5DMXUS/f1f+SMAlhhwkhDRL0kr8r9GDLIGTAGlvC+HVjSIgdL+RKwZCvpXSyxTICWSXTUYsWYPyu3IoHbuBZdmw2faM3WhcRIgbMReU5 - -#. Find the resulting key document in ``keyvault.datakeys``, save a copy of the key document, then remove the key document from the collection. - -#. Replace the ``_id`` field in the copied key document with a UUID with base64 value ``AAAAAAAAAAAAAAAAAAAAAA==`` (16 bytes all equal to ``0x00``) and insert the modified key document into ``keyvault.datakeys`` with majority write concern. - -#. Using ``client_encryption``, encrypt the string ``"test"`` with the modified data key using the ``AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic`` algorithm and assert the resulting value is equal to the following (given as base64): - -.. code:: javascript - - AQAAAAAAAAAAAAAAAAAAAAACz0ZOLuuhEYi807ZXTdhbqhLaS2/t9wLifJnnNYwiw79d75QYIZ6M/aYC1h9nCzCjZ7pGUpAuNnkUhnIXM3PjrA== - -2. Data Key and Double Encryption -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -First, perform the setup. - -#. Create a MongoClient without encryption enabled (referred to as ``client``). Enable command monitoring to listen for command_started events. - -#. Using ``client``, drop the collections ``keyvault.datakeys`` and ``db.coll``. - -#. Create the following: - - - A MongoClient configured with auto encryption (referred to as ``client_encrypted``) - - A ``ClientEncryption`` object (referred to as ``client_encryption``) - - Configure both objects with the following KMS providers: - - .. code:: javascript - - { - "aws": { - "accessKeyId": , - "secretAccessKey": - }, - "azure": { - "tenantId": , - "clientId": , - "clientSecret": , - }, - "gcp": { - "email": , - "privateKey": , - } - "local": { "key": }, - "kmip": { "endpoint": "localhost:5698" } - } - - Configure KMIP TLS connections to use the following options: - - - ``tlsCAFile`` (or equivalent) set to `drivers-evergreen-tools/.evergreen/x509gen/ca.pem `_. This MAY be configured system-wide. - - ``tlsCertificateKeyFile`` (or equivalent) set to `drivers-evergreen-tools/.evergreen/x509gen/client.pem `_. - - The method of passing TLS options for KMIP TLS connections is driver dependent. - - Configure both objects with ``keyVaultNamespace`` set to ``keyvault.datakeys``. - - Configure the ``MongoClient`` with the following ``schema_map``: - - .. code:: javascript - - { - "db.coll": { - "bsonType": "object", - "properties": { - "encrypted_placeholder": { - "encrypt": { - "keyId": "/placeholder", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - } - } - } - } - - Configure ``client_encryption`` with the ``keyVaultClient`` of the previously created ``client``. - -For each KMS provider (``aws``, ``azure``, ``gcp``, ``local``, and ``kmip``), referred to as ``provider_name``, run the following test. - -#. Call ``client_encryption.createDataKey()``. - - - Set keyAltNames to ``["_altname"]``. - - Set the masterKey document based on ``provider_name``. - - For "aws": - - .. code:: javascript - - { - region: "us-east-1", - key: "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0" - } - - For "azure": - - .. code:: javascript - - { - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - } - - For "gcp": - - .. code:: javascript - - { - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - - For "kmip": - - .. code:: javascript - - {} - - For "local", do not set a masterKey document. - - Expect a BSON binary with subtype 4 to be returned, referred to as ``datakey_id``. - - Use ``client`` to run a ``find`` on ``keyvault.datakeys`` by querying with the ``_id`` set to the ``datakey_id``. - - Expect that exactly one document is returned with the "masterKey.provider" equal to ``provider_name``. - - Check that ``client`` captured a command_started event for the ``insert`` command containing a majority writeConcern. - -#. Call ``client_encryption.encrypt()`` with the value "hello ", the algorithm ``AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic``, and the ``key_id`` of ``datakey_id``. - - - Expect the return value to be a BSON binary subtype 6, referred to as ``encrypted``. - - Use ``client_encrypted`` to insert ``{ _id: "", "value": }`` into ``db.coll``. - - Use ``client_encrypted`` to run a find querying with ``_id`` of "" and expect ``value`` to be "hello ". - -#. Call ``client_encryption.encrypt()`` with the value "hello ", the algorithm ``AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic``, and the ``key_alt_name`` of ``_altname``. - - - Expect the return value to be a BSON binary subtype 6. Expect the value to exactly match the value of ``encrypted``. - -#. Test explicit encrypting an auto encrypted field. - - - Use ``client_encrypted`` to attempt to insert ``{ "encrypted_placeholder": }`` - - Expect an exception to be thrown, since this is an attempt to auto encrypt an already encrypted value. - - - -3. External Key Vault Test -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Run the following tests twice, parameterized by a boolean ``withExternalKeyVault``. - -#. Create a MongoClient without encryption enabled (referred to as ``client``). - -#. Using ``client``, drop the collections ``keyvault.datakeys`` and ``db.coll``. - Insert the document `external/external-key.json <../external/external-key.json>`_ into ``keyvault.datakeys``. - -#. Create the following: - - - A MongoClient configured with auto encryption (referred to as ``client_encrypted``) - - A ``ClientEncryption`` object (referred to as ``client_encryption``) - - Configure both objects with the ``local`` KMS providers as follows: - - .. code:: javascript - - { "local": { "key": } } - - Configure both objects with ``keyVaultNamespace`` set to ``keyvault.datakeys``. - - Configure ``client_encrypted`` to use the schema `external/external-schema.json <../external/external-schema.json>`_ for ``db.coll`` by setting a schema map like: ``{ "db.coll": }`` - - If ``withExternalKeyVault == true``, configure both objects with an external key vault client. The external client MUST connect to the same - MongoDB cluster that is being tested against, except it MUST use the username ``fake-user`` and password ``fake-pwd``. - -#. Use ``client_encrypted`` to insert the document ``{"encrypted": "test"}`` into ``db.coll``. - If ``withExternalKeyVault == true``, expect an authentication exception to be thrown. Otherwise, expect the insert to succeed. - -#. Use ``client_encryption`` to explicitly encrypt the string ``"test"`` with key ID ``LOCALAAAAAAAAAAAAAAAAA==`` and deterministic algorithm. - If ``withExternalKeyVault == true``, expect an authentication exception to be thrown. Otherwise, expect the insert to succeed. - - -4. BSON Size Limits and Batch Splitting -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -First, perform the setup. - -#. Create a MongoClient without encryption enabled (referred to as ``client``). - -#. Using ``client``, drop and create the collection ``db.coll`` configured with the included JSON schema `limits/limits-schema.json <../limits/limits-schema.json>`_. - -#. Using ``client``, drop the collection ``keyvault.datakeys``. Insert the document `limits/limits-key.json <../limits/limits-key.json>`_ - -#. Create a MongoClient configured with auto encryption (referred to as ``client_encrypted``) - - Configure with the ``local`` KMS provider as follows: - - .. code:: javascript - - { "local": { "key": } } - - Configure with the ``keyVaultNamespace`` set to ``keyvault.datakeys``. - -Using ``client_encrypted`` perform the following operations: - -#. Insert ``{ "_id": "over_2mib_under_16mib", "unencrypted": }``. - - Expect this to succeed since this is still under the ``maxBsonObjectSize`` limit. - -#. Insert the document `limits/limits-doc.json <../limits/limits-doc.json>`_ concatenated with ``{ "_id": "encryption_exceeds_2mib", "unencrypted": < the string "a" repeated (2097152 - 2000) times > }`` - Note: limits-doc.json is a 1005 byte BSON document that encrypts to a ~10,000 byte document. - - Expect this to succeed since after encryption this still is below the normal maximum BSON document size. - Note, before auto encryption this document is under the 2 MiB limit. After encryption it exceeds the 2 MiB limit, but does NOT exceed the 16 MiB limit. - -#. Bulk insert the following: - - - ``{ "_id": "over_2mib_1", "unencrypted": }`` - - - ``{ "_id": "over_2mib_2", "unencrypted": }`` - - Expect the bulk write to succeed and split after first doc (i.e. two inserts occur). This may be verified using `command monitoring `_. - -#. Bulk insert the following: - - - The document `limits/limits-doc.json <../limits/limits-doc.json>`_ concatenated with ``{ "_id": "encryption_exceeds_2mib_1", "unencrypted": < the string "a" repeated (2097152 - 2000) times > }`` - - - The document `limits/limits-doc.json <../limits/limits-doc.json>`_ concatenated with ``{ "_id": "encryption_exceeds_2mib_2", "unencrypted": < the string "a" repeated (2097152 - 2000) times > }`` - - Expect the bulk write to succeed and split after first doc (i.e. two inserts occur). This may be verified using `command logging and monitoring `_. - -#. Insert ``{ "_id": "under_16mib", "unencrypted": ``. - - Expect this to succeed since this is still (just) under the ``maxBsonObjectSize`` limit. - -#. Insert the document `limits/limits-doc.json <../limits/limits-doc.json>`_ concatenated with ``{ "_id": "encryption_exceeds_16mib", "unencrypted": < the string "a" repeated (16777216 - 2000) times > }`` - - Expect this to fail since encryption results in a document exceeding the ``maxBsonObjectSize`` limit. - -Optionally, if it is possible to mock the maxWriteBatchSize (i.e. the maximum number of documents in a batch) test that setting maxWriteBatchSize=1 and inserting the two documents ``{ "_id": "a" }, { "_id": "b" }`` with ``client_encrypted`` splits the operation into two inserts. - - -5. Views Are Prohibited -~~~~~~~~~~~~~~~~~~~~~~~ - -#. Create a MongoClient without encryption enabled (referred to as ``client``). - -#. Using ``client``, drop and create a view named ``db.view`` with an empty pipeline. E.g. using the command ``{ "create": "view", "viewOn": "coll" }``. - -#. Create a MongoClient configured with auto encryption (referred to as ``client_encrypted``) - - Configure with the ``local`` KMS provider as follows: - - .. code:: javascript - - { "local": { "key": } } - - Configure with the ``keyVaultNamespace`` set to ``keyvault.datakeys``. - -#. Using ``client_encrypted``, attempt to insert a document into ``db.view``. Expect an exception to be thrown containing the message: "cannot auto encrypt a view". - - -6. Corpus Test -~~~~~~~~~~~~~~ - -The corpus test exhaustively enumerates all ways to encrypt all BSON value types. Note, the test data includes BSON binary subtype 4 (or standard UUID), which MUST be decoded and encoded as subtype 4. Run the test as follows. - -1. Create a MongoClient without encryption enabled (referred to as ``client``). - -2. Using ``client``, drop and create the collection ``db.coll`` configured with the included JSON schema `corpus/corpus-schema.json <../corpus/corpus-schema.json>`_. - -3. Using ``client``, drop the collection ``keyvault.datakeys``. Insert the documents `corpus/corpus-key-local.json <../corpus/corpus-key-local.json>`_, `corpus/corpus-key-aws.json <../corpus/corpus-key-aws.json>`_, `corpus/corpus-key-azure.json <../corpus/corpus-key-azure.json>`_, `corpus/corpus-key-gcp.json <../corpus/corpus-key-gcp.json>`_, and `corpus/corpus-key-kmip.json <../corpus/corpus-key-kmip.json>`_. - -4. Create the following: - - - A MongoClient configured with auto encryption (referred to as ``client_encrypted``) - - A ``ClientEncryption`` object (referred to as ``client_encryption``) - - Configure both objects with ``aws``, ``azure``, ``gcp``, ``local``, and ``kmip`` KMS providers as follows: - - .. code:: javascript - - { - "aws": { }, - "azure": { }, - "gcp": { }, - "local": { "key": }, - "kmip": { "endpoint": "localhost:5698" } } - } - - Configure KMIP TLS connections to use the following options: - - - ``tlsCAFile`` (or equivalent) set to `drivers-evergreen-tools/.evergreen/x509gen/ca.pem `_. This MAY be configured system-wide. - - ``tlsCertificateKeyFile`` (or equivalent) set to `drivers-evergreen-tools/.evergreen/x509gen/client.pem `_. - - The method of passing TLS options for KMIP TLS connections is driver dependent. - - Where LOCAL_MASTERKEY is the following base64: - - .. code:: javascript - - Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk - - Configure both objects with ``keyVaultNamespace`` set to ``keyvault.datakeys``. - -5. Load `corpus/corpus.json <../corpus/corpus.json>`_ to a variable named ``corpus``. The corpus contains subdocuments with the following fields: - - - ``kms`` is ``aws``, ``azure``, ``gcp``, ``local``, or ``kmip`` - - ``type`` is a BSON type string `names coming from here `_) - - ``algo`` is either ``rand`` or ``det`` for random or deterministic encryption - - ``method`` is either ``auto``, for automatic encryption or ``explicit`` for explicit encryption - - ``identifier`` is either ``id`` or ``altname`` for the key identifier - - ``allowed`` is a boolean indicating whether the encryption for the given parameters is permitted. - - ``value`` is the value to be tested. - - Create a new BSON document, named ``corpus_copied``. - Iterate over each field of ``corpus``. - - - If the field name is ``_id``, ``altname_aws``, ``altname_local``, ``altname_azure``, ``altname_gcp``, or ``altname_kmip`` copy the field to ``corpus_copied``. - - If ``method`` is ``auto``, copy the field to ``corpus_copied``. - - If ``method`` is ``explicit``, use ``client_encryption`` to explicitly encrypt the value. - - - Encrypt with the algorithm described by ``algo``. - - If ``identifier`` is ``id`` - - - If ``kms`` is ``local`` set the key_id to the UUID with base64 value ``LOCALAAAAAAAAAAAAAAAAA==``. - - If ``kms`` is ``aws`` set the key_id to the UUID with base64 value ``AWSAAAAAAAAAAAAAAAAAAA==``. - - If ``kms`` is ``azure`` set the key_id to the UUID with base64 value ``AZUREAAAAAAAAAAAAAAAAA==``. - - If ``kms`` is ``gcp`` set the key_id to the UUID with base64 value ``GCPAAAAAAAAAAAAAAAAAAA==``. - - If ``kms`` is ``kmip`` set the key_id to the UUID with base64 value ``KMIPAAAAAAAAAAAAAAAAAA==``. - - - If ``identifier`` is ``altname`` - - - If ``kms`` is ``local`` set the key_alt_name to "local". - - If ``kms`` is ``aws`` set the key_alt_name to "aws". - - If ``kms`` is ``azure`` set the key_alt_name to "azure". - - If ``kms`` is ``gcp`` set the key_alt_name to "gcp". - - If ``kms`` is ``kmip`` set the key_alt_name to "kmip". - - If ``allowed`` is true, copy the field and encrypted value to ``corpus_copied``. - If ``allowed`` is false. verify that an exception is thrown. Copy the unencrypted value to to ``corpus_copied``. - - -6. Using ``client_encrypted``, insert ``corpus_copied`` into ``db.coll``. - -7. Using ``client_encrypted``, find the inserted document from ``db.coll`` to a variable named ``corpus_decrypted``. Since it should have been automatically decrypted, assert the document exactly matches ``corpus``. - -8. Load `corpus/corpus_encrypted.json <../corpus/corpus-encrypted.json>`_ to a variable named ``corpus_encrypted_expected``. - Using ``client`` find the inserted document from ``db.coll`` to a variable named ``corpus_encrypted_actual``. - - Iterate over each field of ``corpus_encrypted_expected`` and check the following: - - - If the ``algo`` is ``det``, that the value equals the value of the corresponding field in ``corpus_encrypted_actual``. - - If the ``algo`` is ``rand`` and ``allowed`` is true, that the value does not equal the value of the corresponding field in ``corpus_encrypted_actual``. - - If ``allowed`` is true, decrypt the value with ``client_encryption``. Decrypt the value of the corresponding field of ``corpus_encrypted`` and validate that they are both equal. - - If ``allowed`` is false, validate the value exactly equals the value of the corresponding field of ``corpus`` (neither was encrypted). - -9. Repeat steps 1-8 with a local JSON schema. I.e. amend step 4 to configure the schema on ``client_encrypted`` with the ``schema_map`` option. - -7. Custom Endpoint Test -~~~~~~~~~~~~~~~~~~~~~~~ - -Setup -````` - -For each test cases, start by creating two ``ClientEncryption`` objects. Recreate the ``ClientEncryption`` objects for each test case. - -Create a ``ClientEncryption`` object (referred to as ``client_encryption``) - -Configure with ``keyVaultNamespace`` set to ``keyvault.datakeys``, and a default MongoClient as the ``keyVaultClient``. - -Configure with KMS providers as follows: - -.. code:: javascript - - { - "aws": { - "accessKeyId": , - "secretAccessKey": - }, - "azure": { - "tenantId": , - "clientId": , - "clientSecret": , - "identityPlatformEndpoint": "login.microsoftonline.com:443" - }, - "gcp": { - "email": , - "privateKey": , - "endpoint": "oauth2.googleapis.com:443" - }, - "kmip" { - "endpoint": "localhost:5698" - } - } - -Create a ``ClientEncryption`` object (referred to as ``client_encryption_invalid``) - -Configure with ``keyVaultNamespace`` set to ``keyvault.datakeys``, and a default MongoClient as the ``keyVaultClient``. - -Configure with KMS providers as follows: - -.. code:: javascript - - { - "azure": { - "tenantId": , - "clientId": , - "clientSecret": , - "identityPlatformEndpoint": "doesnotexist.invalid:443" - }, - "gcp": { - "email": , - "privateKey": , - "endpoint": "doesnotexist.invalid:443" - }, - "kmip": { - "endpoint": "doesnotexist.local:5698" - } - } - -Configure KMIP TLS connections to use the following options: - -- ``tlsCAFile`` (or equivalent) set to `drivers-evergreen-tools/.evergreen/x509gen/ca.pem `_. This MAY be configured system-wide. -- ``tlsCertificateKeyFile`` (or equivalent) set to `drivers-evergreen-tools/.evergreen/x509gen/client.pem `_. - -The method of passing TLS options for KMIP TLS connections is driver dependent. - -Test cases -`````````` - -1. Call `client_encryption.createDataKey()` with "aws" as the provider and the following masterKey: - - .. code:: javascript - - { - region: "us-east-1", - key: "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0" - } - - Expect this to succeed. Use the returned UUID of the key to explicitly encrypt and decrypt the string "test" to validate it works. - -2. Call `client_encryption.createDataKey()` with "aws" as the provider and the following masterKey: - - .. code:: javascript - - { - region: "us-east-1", - key: "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - endpoint: "kms.us-east-1.amazonaws.com" - } - - Expect this to succeed. Use the returned UUID of the key to explicitly encrypt and decrypt the string "test" to validate it works. - -3. Call `client_encryption.createDataKey()` with "aws" as the provider and the following masterKey: - - .. code:: javascript - - { - region: "us-east-1", - key: "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - endpoint: "kms.us-east-1.amazonaws.com:443" - } - - Expect this to succeed. Use the returned UUID of the key to explicitly encrypt and decrypt the string "test" to validate it works. - -4. Call `client_encryption.createDataKey()` with "aws" as the provider and the following masterKey: - - .. code:: javascript - - { - region: "us-east-1", - key: "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - endpoint: "kms.us-east-1.amazonaws.com:12345" - } - - Expect this to fail with a socket connection error. - -5. Call `client_encryption.createDataKey()` with "aws" as the provider and the following masterKey: - - .. code:: javascript - - { - region: "us-east-1", - key: "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - endpoint: "kms.us-east-2.amazonaws.com" - } - - Expect this to fail with an exception. - -6. Call `client_encryption.createDataKey()` with "aws" as the provider and the following masterKey: - - .. code:: javascript - - { - region: "us-east-1", - key: "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - endpoint: "doesnotexist.invalid" - } - - Expect this to fail with a network exception indicating failure to resolve "doesnotexist.invalid". - -7. Call `client_encryption.createDataKey()` with "azure" as the provider and the following masterKey: - - .. code:: javascript - - { - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - } - - Expect this to succeed. Use the returned UUID of the key to explicitly encrypt and decrypt the string "test" to validate it works. - - Call ``client_encryption_invalid.createDataKey()`` with the same masterKey. Expect this to fail with a network exception indicating failure to resolve "doesnotexist.invalid". - -8. Call `client_encryption.createDataKey()` with "gcp" as the provider and the following masterKey: - - .. code:: javascript - - { - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle", - "endpoint": "cloudkms.googleapis.com:443" - } - - Expect this to succeed. Use the returned UUID of the key to explicitly encrypt and decrypt the string "test" to validate it works. - - Call ``client_encryption_invalid.createDataKey()`` with the same masterKey. Expect this to fail with a network exception indicating failure to resolve "doesnotexist.invalid". - -9. Call `client_encryption.createDataKey()` with "gcp" as the provider and the following masterKey: - - .. code:: javascript - - { - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle", - "endpoint": "doesnotexist.invalid:443" - } - - Expect this to fail with an exception with a message containing the string: "Invalid KMS response". - -10. Call `client_encryption.createDataKey()` with "kmip" as the provider and the following masterKey: - - .. code:: javascript - - { - "keyId": "1" - } - - Expect this to succeed. Use the returned UUID of the key to explicitly encrypt and decrypt the string "test" to validate it works. - - Call ``client_encryption_invalid.createDataKey()`` with the same masterKey. Expect this to fail with a network exception indicating failure to resolve "doesnotexist.local". - -11. Call ``client_encryption.createDataKey()`` with "kmip" as the provider and the following masterKey: - - .. code:: javascript - - { - "keyId": "1", - "endpoint": "localhost:5698" - } - - Expect this to succeed. Use the returned UUID of the key to explicitly encrypt and decrypt the string "test" to validate it works. - -12. Call ``client_encryption.createDataKey()`` with "kmip" as the provider and the following masterKey: - - .. code:: javascript - - { - "keyId": "1", - "endpoint": "doesnotexist.local:5698" - } - - Expect this to fail with a network exception indicating failure to resolve "doesnotexist.local". - -8. Bypass Spawning mongocryptd -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Via loading shared library -`````````````````````````` - -The following tests that loading crypt_shared_ bypasses spawning mongocryptd. - -.. note:: - - IMPORTANT: This test requires the crypt_shared_ library be loaded. If the crypt_shared_ library is - not available, skip the test. - -#. Create a MongoClient configured with auto encryption (referred to as ``client_encrypted``) - - Configure the required options. Use the ``local`` KMS provider as follows: - - .. code:: javascript - - { "local": { "key": } } - - Configure with the ``keyVaultNamespace`` set to ``keyvault.datakeys``. - - Configure ``client_encrypted`` to use the schema `external/external-schema.json <../external/external-schema.json>`_ for ``db.coll`` by setting a schema map like: ``{ "db.coll": }`` - - Configure the following ``extraOptions``: - - .. code:: javascript - - { - "mongocryptdURI": "mongodb://localhost:27021/db?serverSelectionTimeoutMS=1000", - "mongocryptdSpawnArgs": [ "--pidfilepath=bypass-spawning-mongocryptd.pid", "--port=27021"], - "cryptSharedLibPath": "", - "cryptSharedRequired": true - } - - Drivers MAY pass a different port if they expect their testing infrastructure to be using port 27021. Pass a port that should be free. - -#. Use ``client_encrypted`` to insert the document ``{"unencrypted": "test"}`` into ``db.coll``. Expect this to succeed. - -#. Validate that mongocryptd was not spawned. Create a MongoClient to localhost:27021 (or whatever was passed via ``--port``) with serverSelectionTimeoutMS=1000. Run a handshake command and ensure it fails with a server selection timeout. - -.. note:: - - IMPORTANT: If crypt_shared_ is visible to the operating system's library - search mechanism, the expected server error generated by these - ``mongocryptdBypassSpawn`` tests will not appear because libmongocrypt will - load the ``crypt_shared`` library instead of consulting mongocryptd. For - the following tests, it is required that libmongocrypt *not* load ``crypt_shared``. - Refer to the client-side-encryption document for more information on - "disabling" ``crypt_shared``. - - -Via mongocryptdBypassSpawn -`````````````````````````` - -The following tests that setting ``mongocryptdBypassSpawn=true`` really does bypass spawning mongocryptd. - -#. Create a MongoClient configured with auto encryption (referred to as ``client_encrypted``) - - Configure the required options. Use the ``local`` KMS provider as follows: - - .. code:: javascript - - { "local": { "key": } } - - Configure with the ``keyVaultNamespace`` set to ``keyvault.datakeys``. - - Configure ``client_encrypted`` to use the schema `external/external-schema.json <../external/external-schema.json>`_ for ``db.coll`` by setting a schema map like: ``{ "db.coll": }`` - - Configure the following ``extraOptions``: - - .. code:: javascript - - { - "mongocryptdBypassSpawn": true - "mongocryptdURI": "mongodb://localhost:27021/db?serverSelectionTimeoutMS=1000", - "mongocryptdSpawnArgs": [ "--pidfilepath=bypass-spawning-mongocryptd.pid", "--port=27021"] - } - - Drivers MAY pass a different port if they expect their testing infrastructure to be using port 27021. Pass a port that should be free. - -#. Use ``client_encrypted`` to insert the document ``{"encrypted": "test"}`` into ``db.coll``. Expect a server selection error propagated from the internal MongoClient failing to connect to mongocryptd on port 27021. - -Via bypassAutoEncryption -```````````````````````` - -The following tests that setting ``bypassAutoEncryption=true`` really does bypass spawning mongocryptd. - -#. Create a MongoClient configured with auto encryption (referred to as ``client_encrypted``) - - Configure the required options. Use the ``local`` KMS provider as follows: - - .. code:: javascript - - { "local": { "key": } } - - Configure with the ``keyVaultNamespace`` set to ``keyvault.datakeys``. - - Configure with ``bypassAutoEncryption=true``. - - Configure the following ``extraOptions``: - - .. code:: javascript - - { - "mongocryptdSpawnArgs": [ "--pidfilepath=bypass-spawning-mongocryptd.pid", "--port=27021"] - } - - Drivers MAY pass a different value to ``--port`` if they expect their testing infrastructure to be using port 27021. Pass a port that should be free. - -#. Use ``client_encrypted`` to insert the document ``{"unencrypted": "test"}`` into ``db.coll``. Expect this to succeed. - -#. Validate that mongocryptd was not spawned. Create a MongoClient to localhost:27021 (or whatever was passed via ``--port``) with serverSelectionTimeoutMS=1000. Run a handshake command and ensure it fails with a server selection timeout. - -Via bypassQueryAnalysis -``````````````````````` - -Repeat the steps from the "Via bypassAutoEncryption" test, replacing "bypassAutoEncryption=true" with "bypassQueryAnalysis=true". - -9. Deadlock Tests -~~~~~~~~~~~~~~~~~ - -.. _Connection Monitoring and Pooling: /source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst - -The following tests only apply to drivers that have implemented a connection pool (see the `Connection Monitoring and Pooling`_ specification). - -There are multiple parameterized test cases. Before each test case, perform the setup. - -Setup -````` - -Create a ``MongoClient`` for setup operations named ``client_test``. - -Create a ``MongoClient`` for key vault operations with ``maxPoolSize=1`` named ``client_keyvault``. Capture command started events. - -Using ``client_test``, drop the collections ``keyvault.datakeys`` and ``db.coll``. - -Insert the document `external/external-key.json <../external/external-key.json>`_ into ``keyvault.datakeys`` with majority write concern. - -Create a collection ``db.coll`` configured with a JSON schema `external/external-schema.json <../external/external-schema.json>`_ as the validator, like so: - -.. code:: typescript - - {"create": "coll", "validator": {"$jsonSchema": }} - -Create a ``ClientEncryption`` object, named ``client_encryption`` configured with: -- ``keyVaultClient``=``client_test`` -- ``keyVaultNamespace``="keyvault.datakeys" -- ``kmsProviders``=``{ "local": { "key": } }`` - -Use ``client_encryption`` to encrypt the value "string0" with ``algorithm``="AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" and ``keyAltName``="local". Store the result in a variable named ``ciphertext``. - -Proceed to run the test case. - -Each test case configures a ``MongoClient`` with automatic encryption (named ``client_encrypted``). - -Each test must assert the number of unique ``MongoClient``s created. This can be accomplished by capturing ``TopologyOpeningEvent``, or by checking command started events for a client identifier (not possible in all drivers). - -Running a test case -``````````````````` -- Create a ``MongoClient`` named ``client_encrypted`` configured as follows: - - Set ``AutoEncryptionOpts``: - - ``keyVaultNamespace="keyvault.datakeys"`` - - ``kmsProviders``=``{ "local": { "key": } }`` - - Append ``TestCase.AutoEncryptionOpts`` (defined below) - - Capture command started events. - - Set ``maxPoolSize=TestCase.MaxPoolSize`` -- If the testcase sets ``AutoEncryptionOpts.bypassAutoEncryption=true``: - - Use ``client_test`` to insert ``{ "_id": 0, "encrypted": }`` into ``db.coll``. -- Otherwise: - - Use ``client_encrypted`` to insert ``{ "_id": 0, "encrypted": "string0" }``. -- Use ``client_encrypted`` to run a ``findOne`` operation on ``db.coll``, with the filter ``{ "_id": 0 }``. -- Expect the result to be ``{ "_id": 0, "encrypted": "string0" }``. -- Check captured events against ``TestCase.Expectations``. -- Check the number of unique ``MongoClient``s created is equal to ``TestCase.ExpectedNumberOfClients``. - -Case 1 -`````` -- MaxPoolSize: 1 -- AutoEncryptionOpts: - - bypassAutoEncryption=false - - keyVaultClient=unset -- Expectations: - - Expect ``client_encrypted`` to have captured four ``CommandStartedEvent``: - - a listCollections to "db". - - a find on "keyvault". - - an insert on "db". - - a find on "db" -- ExpectedNumberOfClients: 2 - -Case 2 -`````` -- MaxPoolSize: 1 -- AutoEncryptionOpts: - - bypassAutoEncryption=false - - keyVaultClient=client_keyvault -- Expectations: - - Expect ``client_encrypted`` to have captured three ``CommandStartedEvent``: - - a listCollections to "db". - - an insert on "db". - - a find on "db" - - Expect ``client_keyvault`` to have captured one ``CommandStartedEvent``: - - a find on "keyvault". -- ExpectedNumberOfClients: 2 - -Case 3 -`````` -- MaxPoolSize: 1 -- AutoEncryptionOpts: - - bypassAutoEncryption=true - - keyVaultClient=unset -- Expectations: - - Expect ``client_encrypted`` to have captured three ``CommandStartedEvent``: - - a find on "db" - - a find on "keyvault". -- ExpectedNumberOfClients: 2 - -Case 4 -`````` -- MaxPoolSize: 1 -- AutoEncryptionOpts: - - bypassAutoEncryption=true - - keyVaultClient=client_keyvault -- Expectations: - - Expect ``client_encrypted`` to have captured two ``CommandStartedEvent``: - - a find on "db" - - Expect ``client_keyvault`` to have captured one ``CommandStartedEvent``: - - a find on "keyvault". -- ExpectedNumberOfClients: 1 - -Case 5 -`````` -Drivers that do not support an unlimited maximum pool size MUST skip this test. - -- MaxPoolSize: 0 -- AutoEncryptionOpts: - - bypassAutoEncryption=false - - keyVaultClient=unset -- Expectations: - - Expect ``client_encrypted`` to have captured five ``CommandStartedEvent``: - - a listCollections to "db". - - a listCollections to "keyvault". - - a find on "keyvault". - - an insert on "db". - - a find on "db" -- ExpectedNumberOfClients: 1 - -Case 6 -`````` -Drivers that do not support an unlimited maximum pool size MUST skip this test. - -- MaxPoolSize: 0 -- AutoEncryptionOpts: - - bypassAutoEncryption=false - - keyVaultClient=client_keyvault -- Expectations: - - Expect ``client_encrypted`` to have captured three ``CommandStartedEvent``: - - a listCollections to "db". - - an insert on "db". - - a find on "db" - - Expect ``client_keyvault`` to have captured one ``CommandStartedEvent``: - - a find on "keyvault". -- ExpectedNumberOfClients: 1 - -Case 7 -`````` -Drivers that do not support an unlimited maximum pool size MUST skip this test. - -- MaxPoolSize: 0 -- AutoEncryptionOpts: - - bypassAutoEncryption=true - - keyVaultClient=unset -- Expectations: - - Expect ``client_encrypted`` to have captured three ``CommandStartedEvent``: - - a find on "db" - - a find on "keyvault". -- ExpectedNumberOfClients: 1 - -Case 8 -`````` -Drivers that do not support an unlimited maximum pool size MUST skip this test. - -- MaxPoolSize: 0 -- AutoEncryptionOpts: - - bypassAutoEncryption=true - - keyVaultClient=client_keyvault -- Expectations: - - Expect ``client_encrypted`` to have captured two ``CommandStartedEvent``: - - a find on "db" - - Expect ``client_keyvault`` to have captured one ``CommandStartedEvent``: - - a find on "keyvault". -- ExpectedNumberOfClients: 1 - -10. KMS TLS Tests -~~~~~~~~~~~~~~~~~ - -.. _ca.pem: https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/x509gen/ca.pem -.. _expired.pem: https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/x509gen/expired.pem -.. _wrong-host.pem: https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/x509gen/wrong-host.pem -.. _server.pem: https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/x509gen/server.pem -.. _client.pem: https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/x509gen/client.pem - -The following tests that connections to KMS servers with TLS verify peer certificates. - -The two tests below make use of mock KMS servers which can be run on Evergreen using `the mock KMS server script `_. -Drivers can set up their local Python enviroment for the mock KMS server by running `the virtualenv activation script `_. - -To start two mock KMS servers, one on port 9000 with `ca.pem`_ as a CA file and `expired.pem`_ as a cert file, and one on port 9001 with `ca.pem`_ as a CA file and `wrong-host.pem`_ as a cert file, -run the following commands from the ``.evergreen/csfle`` directory: - -.. code:: - - . ./activate_venv.sh - python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 9000 & - python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 9001 & - -Setup -````` - -For both tests, do the following: - -#. Start a ``mongod`` process with **server version 4.1.9 or later**. - -#. Create a ``MongoClient`` for key vault operations. - -#. Create a ``ClientEncryption`` object (referred to as ``client_encryption``) with ``keyVaultNamespace`` set to ``keyvault.datakeys``. - -Invalid KMS Certificate -``````````````````````` - -#. Start a mock KMS server on port 9000 with `ca.pem`_ as a CA file and `expired.pem`_ as a cert file. - -#. Call ``client_encryption.createDataKey()`` with "aws" as the provider and the following masterKey: - - .. code:: javascript - - { - "region": "us-east-1", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "endpoint": "127.0.0.1:9000", - } - - Expect this to fail with an exception with a message referencing an expired certificate. This message will be language dependent. - In Python, this message is "certificate verify failed: certificate has expired". In Go, this message is - "certificate has expired or is not yet valid". If the language of implementation has a single, generic error message for - all certificate validation errors, drivers may inspect other fields of the error to verify its meaning. - -Invalid Hostname in KMS Certificate -``````````````````````````````````` - -#. Start a mock KMS server on port 9001 with `ca.pem`_ as a CA file and `wrong-host.pem`_ as a cert file. - -#. Call ``client_encryption.createDataKey()`` with "aws" as the provider and the following masterKey: - - .. code:: javascript - - { - "region": "us-east-1", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "endpoint": "127.0.0.1:9001", - } - - Expect this to fail with an exception with a message referencing an incorrect or unexpected host. This message will be language dependent. - In Python, this message is "certificate verify failed: IP address mismatch, certificate is not valid for '127.0.0.1'". In Go, this message - is "cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs". If the language of implementation has a single, generic - error message for all certificate validation errors, drivers may inspect other fields of the error to verify its meaning. - -11. KMS TLS Options Tests -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Setup -````` - -Start a ``mongod`` process with **server version 4.1.9 or later**. - -Four mock KMS server processes must be running: - -1. The mock `KMS HTTP server `_. - - Run on port 9000 with `ca.pem`_ as a CA file and `expired.pem`_ as a cert file. - - Example: - - .. code:: - - python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 9000 - -2. The mock `KMS HTTP server `_. - - Run on port 9001 with `ca.pem`_ as a CA file and `wrong-host.pem`_ as a cert file. - - Example: - - .. code:: - - python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 9001 - -3. The mock `KMS HTTP server `_. - - Run on port 9002 with `ca.pem`_ as a CA file and `server.pem`_ as a cert file. - - Run with the ``--require_client_cert`` option. - - Example: - - .. code:: - - python -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 9002 --require_client_cert - - -4. The mock `KMS KMIP server `_. - -Create the following four ``ClientEncryption`` objects. - -Configure each with ``keyVaultNamespace`` set to ``keyvault.datakeys``, and a default MongoClient as the ``keyVaultClient``. - -1. Create a ``ClientEncryption`` object named ``client_encryption_no_client_cert`` with the following KMS providers: - - .. code:: javascript - - { - "aws": { - "accessKeyId": , - "secretAccessKey": - }, - "azure": { - "tenantId": , - "clientId": , - "clientSecret": , - "identityPlatformEndpoint": "127.0.0.1:9002" - }, - "gcp": { - "email": , - "privateKey": , - "endpoint": "127.0.0.1:9002" - }, - "kmip" { - "endpoint": "127.0.0.1:5698" - } - } - - Add TLS options for the ``aws``, ``azure``, ``gcp``, and - ``kmip`` providers to use the following options: - - - ``tlsCAFile`` (or equivalent) set to `ca.pem`_. This MAY be configured system-wide. - -2. Create a ``ClientEncryption`` object named ``client_encryption_with_tls`` with the following KMS providers: - - .. code:: javascript - - { - "aws": { - "accessKeyId": , - "secretAccessKey": - }, - "azure": { - "tenantId": , - "clientId": , - "clientSecret": , - "identityPlatformEndpoint": "127.0.0.1:9002" - }, - "gcp": { - "email": , - "privateKey": , - "endpoint": "127.0.0.1:9002" - }, - "kmip" { - "endpoint": "127.0.0.1:5698" - } - } - - Add TLS options for the ``aws``, ``azure``, ``gcp``, and - ``kmip`` providers to use the following options: - - - ``tlsCAFile`` (or equivalent) set to `ca.pem`_. This MAY be configured system-wide. - - ``tlsCertificateKeyFile`` (or equivalent) set to `client.pem`_ - -3. Create a ``ClientEncryption`` object named ``client_encryption_expired`` with the following KMS providers: - - .. code:: javascript - - { - "aws": { - "accessKeyId": , - "secretAccessKey": - }, - "azure": { - "tenantId": , - "clientId": , - "clientSecret": , - "identityPlatformEndpoint": "127.0.0.1:9000" - }, - "gcp": { - "email": , - "privateKey": , - "endpoint": "127.0.0.1:9000" - }, - "kmip" { - "endpoint": "127.0.0.1:9000" - } - } - - Add TLS options for the ``aws``, ``azure``, ``gcp``, and - ``kmip`` providers to use the following options: - - - ``tlsCAFile`` (or equivalent) set to `ca.pem`_. This MAY be configured system-wide. - -4. Create a ``ClientEncryption`` object named ``client_encryption_invalid_hostname`` with the following KMS providers: - - .. code:: javascript - - { - "aws": { - "accessKeyId": , - "secretAccessKey": - }, - "azure": { - "tenantId": , - "clientId": , - "clientSecret": , - "identityPlatformEndpoint": "127.0.0.1:9001" - }, - "gcp": { - "email": , - "privateKey": , - "endpoint": "127.0.0.1:9001" - }, - "kmip" { - "endpoint": "127.0.0.1:9001" - } - } - - Add TLS options for the ``aws``, ``azure``, ``gcp``, and - ``kmip`` providers to use the following options: - - - ``tlsCAFile`` (or equivalent) set to `ca.pem`_. This MAY be configured system-wide. - -Case 1: AWS -``````````` - -Call `client_encryption_no_client_cert.createDataKey()` with "aws" as the provider and the -following masterKey: - -.. code:: javascript - - { - region: "us-east-1", - key: "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0" - endpoint: "127.0.0.1:9002" - } - -Expect an error indicating TLS handshake failed. - -Call `client_encryption_with_tls.createDataKey()` with "aws" as the provider and the -following masterKey: - -.. code:: javascript - - { - region: "us-east-1", - key: "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0" - endpoint: "127.0.0.1:9002" - } - -Expect an error from libmongocrypt with a message containing the string: "parse -error". This implies TLS handshake succeeded. - -Call `client_encryption_expired.createDataKey()` with "aws" as the provider and the -following masterKey: - -.. code:: javascript - - { - region: "us-east-1", - key: "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0" - endpoint: "127.0.0.1:9000" - } - -Expect an error indicating TLS handshake failed due to an expired certificate. - -Call `client_encryption_invalid_hostname.createDataKey()` with "aws" as the provider and the -following masterKey: - -.. code:: javascript - - { - region: "us-east-1", - key: "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0" - endpoint: "127.0.0.1:9001" - } - -Expect an error indicating TLS handshake failed due to an invalid hostname. - -Case 2: Azure -````````````` - -Call `client_encryption_no_client_cert.createDataKey()` with "azure" as the provider and the -following masterKey: - -.. code:: javascript - - { 'keyVaultEndpoint': 'doesnotexist.local', 'keyName': 'foo' } - -Expect an error indicating TLS handshake failed. - -Call `client_encryption_with_tls.createDataKey()` with "azure" as the provider -and the same masterKey. - -Expect an error from libmongocrypt with a message containing the string: "HTTP -status=404". This implies TLS handshake succeeded. - -Call `client_encryption_expired.createDataKey()` with "azure" as the provider and -the same masterKey. - -Expect an error indicating TLS handshake failed due to an expired certificate. - -Call `client_encryption_invalid_hostname.createDataKey()` with "azure" as the provider and -the same masterKey. - -Expect an error indicating TLS handshake failed due to an invalid hostname. - -Case 3: GCP -``````````` - -Call `client_encryption_no_client_cert.createDataKey()` with "gcp" as the provider and the -following masterKey: - -.. code:: javascript - - { 'projectId': 'foo', 'location': 'bar', 'keyRing': 'baz', 'keyName': 'foo' } - -Expect an error indicating TLS handshake failed. - -Call `client_encryption_with_tls.createDataKey()` with "gcp" as the provider and -the same masterKey. - -Expect an error from libmongocrypt with a message containing the string: "HTTP -status=404". This implies TLS handshake succeeded. - -Call `client_encryption_expired.createDataKey()` with "gcp" as the provider and -the same masterKey. - -Expect an error indicating TLS handshake failed due to an expired certificate. - -Call `client_encryption_invalid_hostname.createDataKey()` with "gcp" as the provider and -the same masterKey. - -Expect an error indicating TLS handshake failed due to an invalid hostname. - -Case 4: KMIP -```````````` - -Call `client_encryption_no_client_cert.createDataKey()` with "kmip" as the provider and the -following masterKey: - -.. code:: javascript - - { } - -Expect an error indicating TLS handshake failed. - -Call `client_encryption_with_tls.createDataKey()` with "kmip" as the provider -and the same masterKey. - -Expect success. - -Call `client_encryption_expired.createDataKey()` with "kmip" as the provider and -the same masterKey. - -Expect an error indicating TLS handshake failed due to an expired certificate. - -Call `client_encryption_invalid_hostname.createDataKey()` with "kmip" as the provider and -the same masterKey. - -Expect an error indicating TLS handshake failed due to an invalid hostname. - -12. Explicit Encryption -~~~~~~~~~~~~~~~~~~~~~~~ - -The Explicit Encryption tests require MongoDB server 6.0+. The tests must not run against a standalone. - -Before running each of the following test cases, perform the following Test Setup. - -Test Setup -`````````` - -Load the file `encryptedFields.json `_ as ``encryptedFields``. - -Load the file `key1-document.json `_ as ``key1Document``. - -Read the ``"_id"`` field of ``key1Document`` as ``key1ID``. - -Drop and create the collection ``db.explicit_encryption`` using ``encryptedFields`` as an option. See `FLE 2 CreateCollection() and Collection.Drop() `_. - -Drop and create the collection ``keyvault.datakeys``. - -Insert ``key1Document`` in ``keyvault.datakeys`` with majority write concern. - -Create a MongoClient named ``keyVaultClient``. - -Create a ClientEncryption object named ``clientEncryption`` with these options: - -.. code:: typescript - - ClientEncryptionOpts { - keyVaultClient: ; - keyVaultNamespace: "keyvault.datakeys"; - kmsProviders: { "local": { "key": } } - } - -Create a MongoClient named ``encryptedClient`` with these ``AutoEncryptionOpts``: - -.. code:: typescript - - AutoEncryptionOpts { - keyVaultNamespace: "keyvault.datakeys"; - kmsProviders: { "local": { "key": } } - bypassQueryAnalysis: true - } - - -Case 1: can insert encrypted indexed and find -````````````````````````````````````````````` - -Use ``clientEncryption`` to encrypt the value "encrypted indexed value" with these ``EncryptOpts``: - -.. code:: typescript - - class EncryptOpts { - keyId : - algorithm: "Indexed", - contentionFactor: 0 - } - -Store the result in ``insertPayload``. - -Use ``encryptedClient`` to insert the document ``{ "encryptedIndexed": }`` into ``db.explicit_encryption``. - -Use ``clientEncryption`` to encrypt the value "encrypted indexed value" with these ``EncryptOpts``: - -.. code:: typescript - - class EncryptOpts { - keyId : - algorithm: "Indexed", - queryType: "equality", - contentionFactor: 0 - } - -Store the result in ``findPayload``. - -Use ``encryptedClient`` to run a "find" operation on the ``db.explicit_encryption`` collection with the filter ``{ "encryptedIndexed": }``. - -Assert one document is returned containing the field ``{ "encryptedIndexed": "encrypted indexed value" }``. - -Case 2: can insert encrypted indexed and find with non-zero contention -``````````````````````````````````````````````````````````````````````` - -Use ``clientEncryption`` to encrypt the value "encrypted indexed value" with these ``EncryptOpts``: - -.. code:: typescript - - class EncryptOpts { - keyId : - algorithm: "Indexed", - contentionFactor: 10 - } - -Store the result in ``insertPayload``. - -Use ``encryptedClient`` to insert the document ``{ "encryptedIndexed": }`` into ``db.explicit_encryption``. - -Repeat the above steps 10 times to insert 10 total documents. The ``insertPayload`` must be regenerated each iteration. - -Use ``clientEncryption`` to encrypt the value "encrypted indexed value" with these ``EncryptOpts``: - -.. code:: typescript - - class EncryptOpts { - keyId : - algorithm: "Indexed", - queryType: "equality", - contentionFactor: 0 - } - -Store the result in ``findPayload``. - -Use ``encryptedClient`` to run a "find" operation on the ``db.explicit_encryption`` collection with the filter ``{ "encryptedIndexed": }``. - -Assert less than 10 documents are returned. 0 documents may be returned. Assert each returned document contains the field ``{ "encryptedIndexed": "encrypted indexed value" }``. - -Use ``clientEncryption`` to encrypt the value "encrypted indexed value" with these ``EncryptOpts``: - -.. code:: typescript - - class EncryptOpts { - keyId : - algorithm: "Indexed", - queryType: "equality", - contentionFactor: 10 - } - -Store the result in ``findPayload2``. - -Use ``encryptedClient`` to run a "find" operation on the ``db.explicit_encryption`` collection with the filter ``{ "encryptedIndexed": }``. - -Assert 10 documents are returned. Assert each returned document contains the field ``{ "encryptedIndexed": "encrypted indexed value" }``. - -Case 3: can insert encrypted unindexed -`````````````````````````````````````` - -Use ``clientEncryption`` to encrypt the value "encrypted unindexed value" with these ``EncryptOpts``: - -.. code:: typescript - - class EncryptOpts { - keyId : - algorithm: "Unindexed" - } - -Store the result in ``insertPayload``. - -Use ``encryptedClient`` to insert the document ``{ "_id": 1, "encryptedUnindexed": }`` into ``db.explicit_encryption``. - -Use ``encryptedClient`` to run a "find" operation on the ``db.explicit_encryption`` collection with the filter ``{ "_id": 1 }``. - -Assert one document is returned containing the field ``{ "encryptedUnindexed": "encrypted unindexed value" }``. - -Case 4: can roundtrip encrypted indexed -``````````````````````````````````````` - -Use ``clientEncryption`` to encrypt the value "encrypted indexed value" with these ``EncryptOpts``: - -.. code:: typescript - - class EncryptOpts { - keyId : - algorithm: "Indexed", - contentionFactor: 0 - } - -Store the result in ``payload``. - -Use ``clientEncryption`` to decrypt ``payload``. Assert the returned value equals "encrypted indexed value". - -Case 5: can roundtrip encrypted unindexed -````````````````````````````````````````` - -Use ``clientEncryption`` to encrypt the value "encrypted unindexed value" with these ``EncryptOpts``: - -.. code:: typescript - - class EncryptOpts { - keyId : - algorithm: "Unindexed", - } - -Store the result in ``payload``. - -Use ``clientEncryption`` to decrypt ``payload``. Assert the returned value equals "encrypted unindexed value". - -13. Unique Index on keyAltNames -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The following setup must occur before running each of the following test cases. - -Setup -````` - -1. Create a ``MongoClient`` object (referred to as ``client``). - -2. Using ``client``, drop the collection ``keyvault.datakeys``. - -3. Using ``client``, create a unique index on ``keyAltNames`` with a partial index filter for only documents where ``keyAltNames`` exists using writeConcern "majority". - -The command should be equivalent to: - -.. code:: typescript - - db.runCommand( - { - createIndexes: "datakeys", - indexes: [ - { - name: "keyAltNames_1", - key: { "keyAltNames": 1 }, - unique: true, - partialFilterExpression: { keyAltNames: { $exists: true } } - } - ], - writeConcern: { w: "majority" } - } - ) - -4. Create a ``ClientEncryption`` object (referred to as ``client_encryption``) with ``client`` set as the ``keyVaultClient``. - -5. Using ``client_encryption``, create a data key with a ``local`` KMS provider and the keyAltName "def". - -Case 1: createDataKey() -``````````````````````` - -1. Use ``client_encryption`` to create a new local data key with a keyAltName "abc" and assert the operation does not fail. - -2. Repeat Step 1 and assert the operation fails due to a duplicate key server error (error code 11000). - -3. Use ``client_encryption`` to create a new local data key with a keyAltName "def" and assert the operation fails due to a duplicate key server error (error code 11000). - -Case 2: addKeyAltName() -``````````````````````` - -1. Use ``client_encryption`` to create a new local data key and assert the operation does not fail. - -2. Use ``client_encryption`` to add a keyAltName "abc" to the key created in Step 1 and assert the operation does not fail. - -3. Repeat Step 2, assert the operation does not fail, and assert the returned key document contains the keyAltName "abc" added in Step 2. - -4. Use ``client_encryption`` to add a keyAltName "def" to the key created in Step 1 and assert the operation fails due to a duplicate key server error (error code 11000). - -5. Use ``client_encryption`` to add a keyAltName "def" to the existing key, assert the operation does not fail, and assert the returned key document contains the keyAltName "def" added during Setup. - -14. Decryption Events -~~~~~~~~~~~~~~~~~~~~~ - -Before running each of the following test cases, perform the following Test Setup. - -Test Setup -`````````` - -Create a MongoClient named ``setupClient``. - -Drop and create the collection ``db.decryption_events``. - -Create a ClientEncryption object named ``clientEncryption`` with these options: - -.. code:: typescript - - ClientEncryptionOpts { - keyVaultClient: , - keyVaultNamespace: "keyvault.datakeys", - kmsProviders: { "local": { "key": } } - } - -Create a data key with the "local" KMS provider. Storing the result in a variable named ``keyID``. - -Use ``clientEncryption`` to encrypt the string "hello" with the following ``EncryptOpts``: - -.. code:: typescript - - EncryptOpts { - keyId: , - algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - -Store the result in a variable named ``ciphertext``. - -Copy ``ciphertext`` into a variable named ``malformedCiphertext``. Change the -last byte to a different value. This will produce an invalid HMAC tag. - -Create a MongoClient named ``encryptedClient`` with these ``AutoEncryptionOpts``: - -.. code:: typescript - - AutoEncryptionOpts { - keyVaultNamespace: "keyvault.datakeys"; - kmsProviders: { "local": { "key": } } - } - -Configure ``encryptedClient`` with "retryReads=false". -Register a listener for CommandSucceeded events on ``encryptedClient``. -The listener must store the most recent ``CommandSucceededEvent`` reply for the "aggregate" command. -The listener must store the most recent ``CommandFailedEvent`` error for the "aggregate" command. - -Case 1: Command Error -````````````````````` - -Use ``setupClient`` to configure the following failpoint: - -.. code:: typescript - - { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 123, - "failCommands": [ - "aggregate" - ] - } - } - -Use ``encryptedClient`` to run an aggregate on ``db.decryption_events``. - -Expect an exception to be thrown from the command error. Expect a ``CommandFailedEvent``. - -Case 2: Network Error -````````````````````` - -Use ``setupClient`` to configure the following failpoint: - -.. code:: typescript - - { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 123, - "closeConnection": true, - "failCommands": [ - "aggregate" - ] - } - } - -Use ``encryptedClient`` to run an aggregate on ``db.decryption_events``. - -Expect an exception to be thrown from the network error. Expect a ``CommandFailedEvent``. - -Case 3: Decrypt Error -````````````````````` - -Use ``encryptedClient`` to insert the document ``{ "encrypted": }`` into ``db.decryption_events``. - -Use ``encryptedClient`` to run an aggregate on ``db.decryption_events`` with an empty pipeline. - -Expect an exception to be thrown from the decryption error. -Expect a ``CommandSucceededEvent``. Expect the ``CommandSucceededEvent.reply`` to contain BSON binary for the field ``cursor.firstBatch.encrypted``. - -Case 4: Decrypt Success -``````````````````````` - -Use ``encryptedClient`` to insert the document ``{ "encrypted": }`` into ``db.decryption_events``. - -Use ``encryptedClient`` to run an aggregate on ``db.decryption_events`` with an empty pipeline. - -Expect no exception. -Expect a ``CommandSucceededEvent``. Expect the ``CommandSucceededEvent.reply`` to contain BSON binary for the field ``cursor.firstBatch.encrypted``. - - -15. On-demand AWS Credentials -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -These tests require valid AWS credentials. Refer: `Automatic AWS Credentials`_. - -For these cases, create a ClientEncryption_ object :math:`C` with the following -options: - -.. code-block:: typescript - - ClientEncryptionOpts { - keyVaultClient: , - keyVaultNamespace: "keyvault.datakeys", - kmsProviders: { "aws": {} }, - } - -Case 1: Failure -``````````````` - -Do not run this test case in an environment where AWS credentials are available -(e.g. via environment variables or a metadata URL). (Refer: -`Obtaining credentials for AWS `_) - -Attempt to create a datakey with :math:`C` using the ``"aws"`` KMS provider. -Expect this to fail due to a lack of KMS provider credentials. - -Case 2: Success -``````````````` - -For this test case, the environment variables ``AWS_ACCESS_KEY_ID`` and -``AWS_SECRET_ACCESS_KEY`` must be defined and set to a valid set of AWS -credentials. - -Use the client encryption to create a datakey using the ``"aws"`` KMS provider. -This should successfully load and use the AWS credentials that were defined in -the environment. - -.. _Automatic AWS Credentials: ../client-side-encryption.rst#automatic-aws-credentials -.. _ClientEncryption: ../client-side-encryption.rst#clientencryption -.. _auth-aws: ../../auth/auth.rst#obtaining-credentials - -16. Rewrap -~~~~~~~~~~ - -Case 1: Rewrap with separate ClientEncryption -````````````````````````````````````````````` - -When the following test case requests setting ``masterKey``, use the following values based on the KMS provider: - -For "aws": - -.. code:: javascript - - { - "region": "us-east-1", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0" - } - -For "azure": - -.. code:: javascript - - { - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - } - -For "gcp": - -.. code:: javascript - - { - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - -For "kmip": - -.. code:: javascript - - {} - -For "local", do not set a masterKey document. - -Run the following test case for each pair of KMS providers (referred to as ``srcProvider`` and ``dstProvider``). -Include pairs where ``srcProvider`` equals ``dstProvider``. - -1. Drop the collection ``keyvault.datakeys``. - -2. Create a ``ClientEncryption`` object named ``clientEncryption1`` with these options: - - .. code:: typescript - - ClientEncryptionOpts { - keyVaultClient: ; - keyVaultNamespace: "keyvault.datakeys"; - kmsProviders: - } - -3. Call ``clientEncryption1.createDataKey`` with ``srcProvider`` and these options: - - .. code:: typescript - - class DataKeyOpts { - masterKey: - } - - Store the return value in ``keyID``. - -4. Call ``clientEncryption1.encrypt`` with the value "test" and these options: - - .. code:: typescript - - class EncryptOpts { - keyId : keyID, - algorithm: "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - - Store the return value in ``ciphertext``. - -5. Create a ``ClientEncryption`` object named ``clientEncryption2`` with these options: - - .. code:: typescript - - ClientEncryptionOpts { - keyVaultClient: ; - keyVaultNamespace: "keyvault.datakeys"; - kmsProviders: - } - -6. Call ``clientEncryption2.rewrapManyDataKey`` with an empty ``filter`` and these options: - - .. code:: typescript - - class RewrapManyDataKeyOpts { - provider: dstProvider - masterKey: - } - - Assert that the returned ``RewrapManyDataKeyResult.bulkWriteResult.modifiedCount`` is 1. - -7. Call ``clientEncryption1.decrypt`` with the ``ciphertext``. Assert the return value is "test". - -8. Call ``clientEncryption2.decrypt`` with the ``ciphertext``. Assert the return value is "test". - - -17. On-demand GCP Credentials -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Refer: `Automatic GCP Credentials`_. - -For these cases, create a ClientEncryption_ object :math:`C` with the following -options: - -.. code-block:: typescript - - ClientEncryptionOpts { - keyVaultClient: , - keyVaultNamespace: "keyvault.datakeys", - kmsProviders: { "gcp": {} }, - } - -Case 1: Failure -``````````````` - -Do not run this test case in an environment with a GCP service account is -attached (e.g. any `GCE equivalent runtime -`_). This may be run in an AWS EC2 instance. - -Attempt to create a datakey with :math:`C` using the ``"gcp"`` KMS provider and -following ``DataKeyOpts``: - -.. code-block:: typescript - - class DataKeyOpts { - masterKey: { - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - } - -Expect the attempt to obtain ``"gcp"`` credentials from the environment to fail. - -Case 2: Success -``````````````` - -This test case must run in a Google Compute Engine (GCE) Virtual Machine with a -service account attached. See `drivers-evergreen-tools/.evergreen/csfle/gcpkms -`_ -for scripts to create a GCE instance for testing. The Evergreen task SHOULD set a -``batchtime`` of 14 days to reduce how often this test case runs. - -Attempt to create a datakey with :math:`C` using the ``"gcp"`` KMS provider and -following ``DataKeyOpts``: - -.. code-block:: typescript - - class DataKeyOpts { - masterKey: { - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - } - -This should successfully load and use the GCP credentials of the service account -attached to the virtual machine. - -Expect the key to be successfully created. - -.. _Automatic GCP Credentials: ../client-side-encryption.rst#automatic-gcp-credentials - - -18. Azure IMDS Credentials -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Refer: `Automatic Azure Credentials `_ - -.. _auto-azure: ../client-side-encryption.rst#obtaining-an-access-token-for-azure-key-vault - -The test cases for IMDS communication are specially designed to not require an -Azure environment, while still exercising the core of the functionality. The -design of these test cases encourages an implementation to separate the concerns -of IMDS communication from the logic of KMS key manipulation. The purpose of -these test cases is to ensure drivers will behave appropriately regardless of -the behavior of the IMDS server. - -For these IMDS credentials tests, a simple stand-in IMDS-imitating HTTP server -is available in drivers-evergreen-tools, at ``.evergreen/csfle/fake_azure.py``. -``fake_azure.py`` is a very simple ``bottle.py`` application. For the easiest -use, it is recommended to execute it through ``bottle.py`` (which is a sibling -file in the same directory):: - - python .evergreen/csfle/bottle.py fake_azure:imds - -This will run the ``imds`` Bottle application defined in the ``fake_azure`` -Python module. ``bottle.py`` accepts additional command line arguments to -control the bind host and TCP port (use ``--help`` for more information). - -For each test case, follow the process for obtaining the token as outlined in -the `automatic Azure credentials section `_ with the following -changes: - -1. Instead of the standard IMDS TCP endpoint of `169.254.169.254:80`, - communicate with the running ``fake_azure`` HTTP server. - -2. For each test case, the behavior of the server may be controlled by attaching - an additional HTTP header to the sent request: ``X-MongoDB-HTTP-TestParams``. - - -Case 1: Success -``````````````` - -Do not set an ``X-MongoDB-HTTP-TestParams`` header. - -Upon receiving a response from ``fake_azure``, the driver must decode the -following information: - -1. HTTP status will be ``200 Okay``. -2. The HTTP body will be a valid JSON string. -3. The access token will be the string ``"magic-cookie"``. -4. The expiry duration of the token will be seventy seconds. -5. The token will have a resource of ``"https://vault.azure.net/"`` - - -Case 2: Empty JSON -`````````````````` - -This case addresses a server returning valid JSON with invalid content. - -Set ``X-MongoDB-HTTP-TestParams`` to ``case=empty-json``. - -Upon receiving a response: - -1. HTTP status will be ``200 Okay`` -2. The HTTP body will be a valid JSON string. -3. There will be no access token, expiry duration, or resource. - -The test case should ensure that this error condition is handled gracefully. - - -Case 3: Bad JSON -```````````````` - -This case addresses a server returning malformed JSON. - -Set ``X-MongoDB-HTTP-TestParams`` to ``case=bad-json``. - -Upon receiving a response: - -1. HTTP status will be ``200 Okay`` -2. The response body will contain a malformed JSON string. - -The test case should ensure that this error condition is handled gracefully. - - -Case 4: HTTP 404 -```````````````` - -This case addresses a server returning a "Not Found" response. This is -documented to occur spuriously within an Azure environment. - -Set ``X-MongoDB-HTTP-TestParams`` to ``case=404``. - -Upon receiving a response: - -1. HTTP status will be ``404 Not Found``. -2. The response body is unspecified. - -The test case should ensure that this error condition is handled gracefully. - - -Case 5: HTTP 500 -```````````````` - -This case addresses an IMDS server reporting an internal error. This is -documented to occur spuriously within an Azure environment. - -Set ``X-MongoDB-HTTP-TestParams`` to ``case=500``. - -Upon receiving a response: - -1. HTTP status code will be ``500``. -2. The response body is unspecified. - -The test case should ensure that this error condition is handled gracefully. - - -Case 6: Slow Response -````````````````````` - -This case addresses an IMDS server responding very slowly. Drivers should not -halt the application waiting on a peer to communicate. - -Set ``X-MongoDB-HTTP-TestParams`` to ``case=slow``. - -The HTTP response from the ``fake_azure`` server will take at least 1000 seconds -to complete. The request should fail with a timeout. - -19. Azure IMDS Credentials Integration Test -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Refer: `Automatic Azure Credentials `_ - -.. _auto-azure: ../client-side-encryption.rst#obtaining-an-access-token-for-azure-key-vault - -For these cases, create a ClientEncryption_ object :math:`C` with the following -options: - -.. code-block:: typescript - - ClientEncryptionOpts { - keyVaultClient: , - keyVaultNamespace: "keyvault.datakeys", - kmsProviders: { "azure": {} }, - } - -Case 1: Failure -``````````````` - -Do not run this test case in an Azure environment with an attached identity. -This may be run in an AWS EC2 instance. - -Attempt to create a datakey with :math:`C` using the ``"azure"`` KMS provider and -following ``DataKeyOpts``: - -.. code-block:: typescript - - class DataKeyOpts { - masterKey: { - "keyVaultEndpoint": "https://keyvault-drivers-2411.vault.azure.net/keys/", - "keyName": "KEY-NAME" - } - } - -Expect the attempt to obtain ``"azure"`` credentials from the environment to fail. - -Case 2: Success -``````````````` - -This test case must run in an Azure environment with an attached identity. -See `drivers-evergreen-tools/.evergreen/csfle/azurekms -`_ -for scripts to create a Azure instance for testing. The Evergreen task SHOULD set a -``batchtime`` of 14 days to reduce how often this test case runs. - -Attempt to create a datakey with :math:`C` using the ``"azure"`` KMS provider and -following ``DataKeyOpts``: - -.. code-block:: typescript - - class DataKeyOpts { - masterKey: { - "keyVaultEndpoint": "https://keyvault-drivers-2411.vault.azure.net/keys/", - "keyName": "KEY-NAME" - } - } - -This should successfully load and use the Azure credentials of the service account -attached to the virtual machine. - -Expect the key to be successfully created. - -20. Bypass creating mongocryptd client when shared library is loaded -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. note:: - - IMPORTANT: If crypt_shared_ is not visible to the operating system's library - search mechanism, this test should be skipped. - - -The following tests that a mongocryptd client is not created when shared library is in-use. - -#. Start a new thread (referred to as ``listenerThread``) - -#. On ``listenerThread``, create a TcpListener on 127.0.0.1 endpoint and port 27021. Start the listener and wait for establishing connections. - If any connection is established, then signal about this to the main thread. - - Drivers MAY pass a different port if they expect their testing infrastructure to be using port 27021. Pass a port that should be free. - -#. Create a MongoClient configured with auto encryption (referred to as ``client_encrypted``) - - Configure the required options. Use the ``local`` KMS provider as follows: - - .. code:: javascript - - { "local": { "key": } } - - Configure with the ``keyVaultNamespace`` set to ``keyvault.datakeys``. - - Configure the following ``extraOptions``: - - .. code:: javascript - - { - "mongocryptdURI": "mongodb://localhost:27021" - } - -#. Use ``client_encrypted`` to insert the document ``{"unencrypted": "test"}`` into ``db.coll``. - -#. Expect no signal from ``listenerThread``. - - - -21. Automatic Data Encryption Keys -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Case 1: Simple Creation and Validation -`````````````````````````````````````` - -This test is the most basic to verify that CreateEncryptedCollection_ created a -collection with queryable encryption enabled. It verifies that the server -rejects an attempt to insert plaintext in an encrypted fields. - -.. _CreateEncryptedCollection: ../client-side-encryption.rst#create-encrypted-collection-helper -.. _MongoClient: ../client-side-encryption.rst#mongoclient-changes - -.. highlight:: typescript -.. default-role:: math - -1. Create a ClientEncryption_ object `CE` with the following options:: - - clientEncryptionOptions: { - keyVaultClient: , - keyVaultNamespace: "keyvault.datakeys", - kmsProviders: { - local: { key: base64Decode(LOCAL_MASTERKEY) }, - }, - } - -2. Create a new create-collection options `Opts` including the following:: - - { - encryptedFields: { - fields: [{ - path: "ssn", - bsonType: "string", - keyId: null - }] - } - } - -3. Open a new database handle `DB`. -4. Invoke `CreateEncryptedCollection(CE, DB, "testing1", Opts, "local", null)` - to obtain a new collection `Coll`. Expect success. -5. Attempt to insert the following document into `Coll`:: - - { - ssn: "123-45-6789" - } - -6. Expect an error from the insert operation that indicates that the document - failed validation. This error indicates that the server expects to receive an - encrypted field for ``ssn``, but we tried to insert a plaintext field via a - client that is unaware of the encryption requirements. \ No newline at end of file diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/aggregate.json b/driver-core/src/test/resources/client-side-encryption/legacy/aggregate.json deleted file mode 100644 index 7de725b71d7..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/aggregate.json +++ /dev/null @@ -1,390 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "Aggregate with deterministic encryption", - "skipReason": "SERVER-39395", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encrypted_string": "457-55-5642" - } - } - ] - }, - "result": [ - { - "_id": 1, - "encrypted_string": "string0" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "default", - "pipeline": [ - { - "$match": { - "encrypted_string": "457-55-5642" - } - } - ] - }, - "command_name": "aggregate" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "Aggregate with empty pipeline", - "skipReason": "SERVER-40829 hides agg support behind enableTestCommands flag.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "aggregate", - "arguments": { - "pipeline": [] - }, - "result": [ - { - "_id": 1, - "encrypted_string": "string0" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "default", - "pipeline": [], - "cursor": {} - }, - "command_name": "aggregate" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "Aggregate should fail with random encryption", - "skipReason": "SERVER-39395", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "random": "abc" - } - } - ] - }, - "result": { - "errorContains": "Cannot query on fields encrypted with the randomized encryption" - } - } - ] - }, - { - "description": "Database aggregate should fail", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "aggregate", - "object": "database", - "arguments": { - "pipeline": [ - { - "$currentOp": { - "allUsers": false, - "idleConnections": false, - "localOps": true - } - }, - { - "$match": { - "command.aggregate": { - "$eq": 1 - } - } - }, - { - "$project": { - "command": 1 - } - }, - { - "$project": { - "command.lsid": 0 - } - } - ] - }, - "result": { - "errorContains": "non-collection command not supported for auto encryption: aggregate" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/awsTemporary.json b/driver-core/src/test/resources/client-side-encryption/legacy/awsTemporary.json deleted file mode 100644 index 10eb85feee1..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/awsTemporary.json +++ /dev/null @@ -1,225 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "Insert a document with auto encryption using the AWS provider with temporary credentials", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "awsTemporary": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault" - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "Insert with invalid temporary credentials", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "awsTemporaryNoSessionToken": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0" - } - }, - "result": { - "errorContains": "security token" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/azureKMS.json b/driver-core/src/test/resources/client-side-encryption/legacy/azureKMS.json deleted file mode 100644 index b0f5111370b..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/azureKMS.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": { - "properties": { - "encrypted_string_aws": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_azure": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZURE+AAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_gcp": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCP+AAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_local": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_kmip": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "dBHpr8aITfeBQ15grpbLpQ==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_kmip_delegated": { - "encrypt": { - "keyId": [ - { - "$uuid": "7411e9af-c688-4df7-8143-5e60ae96cba6" - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "AZURE+AAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "n+HWZ0ZSVOYA3cvQgP7inN4JSXfOH85IngmeQxRpQHjCCcqT3IFqEWNlrsVHiz3AELimHhX4HKqOLWMUeSIT6emUDDoQX9BAv8DR1+E1w4nGs/NyEneac78EYFkK3JysrFDOgl2ypCCTKAypkn9CkAx1if4cfgQE93LW4kczcyHdGiH36CIxrCDGv1UzAvERN5Qa47DVwsM6a+hWsF2AAAJVnF0wYLLJU07TuRHdMrrphPWXZsFgyV+lRqJ7DDpReKNO8nMPLV/mHqHBHGPGQiRdb9NoJo8CvokGz4+KE8oLwzKf6V24dtwZmRkrsDV4iOhvROAzz+Euo1ypSkL3mw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1601573901680" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1601573901680" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "azure", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - }, - "keyAltNames": [ - "altname", - "azure_altname" - ] - } - ], - "tests": [ - { - "description": "Insert a document with auto encryption using Azure KMS provider", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "azure": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string_azure": "string0" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AZURE+AAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault" - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_string_azure": { - "$binary": { - "base64": "AQGVERPgAAAAAAAAAAAAAAAC5DbBSwPwfSlBrDtRuglvNvCXD1KzDuCKY2P+4bRFtHDjpTOE2XuytPAUaAbXf1orsPq59PVZmsbTZbt2CB8qaQ==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string_azure": { - "$binary": { - "base64": "AQGVERPgAAAAAAAAAAAAAAAC5DbBSwPwfSlBrDtRuglvNvCXD1KzDuCKY2P+4bRFtHDjpTOE2XuytPAUaAbXf1orsPq59PVZmsbTZbt2CB8qaQ==", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/badQueries.json b/driver-core/src/test/resources/client-side-encryption/legacy/badQueries.json deleted file mode 100644 index 4968307ba3a..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/badQueries.json +++ /dev/null @@ -1,1446 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "$text unconditionally fails", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "$text": { - "$search": "search text" - } - } - }, - "result": { - "errorContains": "Unsupported match expression operator for encryption" - } - } - ] - }, - { - "description": "$where unconditionally fails", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "$where": { - "$code": "function() { return true }" - } - } - }, - "result": { - "errorContains": "Unsupported match expression operator for encryption" - } - } - ] - }, - { - "description": "$bit operators succeed on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$bitsAllClear": 35 - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$bitsAllClear": 35 - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$bitsAllSet": 35 - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$bitsAllSet": 35 - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$bitsAnyClear": 35 - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$bitsAnyClear": 35 - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$bitsAnySet": 35 - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$bitsAnySet": 35 - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - } - ] - }, - { - "description": "geo operators succeed on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$near": [ - 0, - 0 - ] - } - } - }, - "result": { - "errorContains": "unable to find index" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$near": [ - 0, - 0 - ] - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$nearSphere": [ - 0, - 0 - ] - } - } - }, - "result": { - "errorContains": "unable to find index" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$nearSphere": [ - 0, - 0 - ] - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$geoIntersects": { - "$geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - 0, - 0 - ], - [ - 1, - 0 - ], - [ - 1, - 1 - ], - [ - 0, - 0 - ] - ] - ] - } - } - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$geoIntersects": { - "$geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - 0, - 0 - ], - [ - 1, - 0 - ], - [ - 1, - 1 - ], - [ - 0, - 0 - ] - ] - ] - } - } - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$geoWithin": { - "$geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - 0, - 0 - ], - [ - 1, - 0 - ], - [ - 1, - 1 - ], - [ - 0, - 0 - ] - ] - ] - } - } - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$geoWithin": { - "$geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - 0, - 0 - ], - [ - 1, - 0 - ], - [ - 1, - 1 - ], - [ - 0, - 0 - ] - ] - ] - } - } - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - } - ] - }, - { - "description": "inequality operators succeed on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$gt": 1 - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$gt": 1 - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$lt": 1 - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$lt": 1 - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$gte": 1 - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$gte": 1 - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$lte": 1 - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$lte": 1 - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - } - ] - }, - { - "description": "other misc operators succeed on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$mod": [ - 3, - 1 - ] - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$mod": [ - 3, - 1 - ] - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$regex": "pattern", - "$options": "" - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$regex": "pattern", - "$options": "" - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$size": 2 - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$size": 2 - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$type": 2 - } - } - }, - "result": [] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$type": 2 - } - } - }, - "result": { - "errorContains": "Invalid match expression operator on encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$eq": null - } - } - }, - "result": [ - { - "_id": 1, - "encrypted_string": "string0" - }, - { - "_id": 2, - "encrypted_string": "string1" - } - ] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$eq": null - } - } - }, - "result": { - "errorContains": "Illegal equality to null predicate for encrypted field" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "unencrypted": { - "$in": [ - null - ] - } - } - }, - "result": [ - { - "_id": 1, - "encrypted_string": "string0" - }, - { - "_id": 2, - "encrypted_string": "string1" - } - ] - }, - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$in": [ - null - ] - } - } - }, - "result": { - "errorContains": "Illegal equality to null inside $in against an encrypted field" - } - } - ] - }, - { - "description": "$addToSet succeeds on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$addToSet": { - "unencrypted": [ - "a" - ] - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$addToSet": { - "encrypted_string": [ - "a" - ] - } - } - }, - "result": { - "errorContains": "$addToSet not allowed on encrypted values" - } - } - ] - }, - { - "description": "$inc succeeds on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$inc": { - "unencrypted": 1 - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$inc": { - "encrypted_string": 1 - } - } - }, - "result": { - "errorContains": "$inc and $mul not allowed on encrypted values" - } - } - ] - }, - { - "description": "$mul succeeds on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$mul": { - "unencrypted": 1 - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$mul": { - "encrypted_string": 1 - } - } - }, - "result": { - "errorContains": "$inc and $mul not allowed on encrypted values" - } - } - ] - }, - { - "description": "$max succeeds on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$max": { - "unencrypted": 1 - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$max": { - "encrypted_string": 1 - } - } - }, - "result": { - "errorContains": "$max and $min not allowed on encrypted values" - } - } - ] - }, - { - "description": "$min succeeds on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$min": { - "unencrypted": 1 - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$min": { - "encrypted_string": 1 - } - } - }, - "result": { - "errorContains": "$max and $min not allowed on encrypted values" - } - } - ] - }, - { - "description": "$currentDate succeeds on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$currentDate": { - "unencrypted": true - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$currentDate": { - "encrypted_string": true - } - } - }, - "result": { - "errorContains": "$currentDate not allowed on encrypted values" - } - } - ] - }, - { - "description": "$pop succeeds on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$pop": { - "unencrypted": 1 - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 0, - "upsertedCount": 0 - } - }, - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$pop": { - "encrypted_string": 1 - } - } - }, - "result": { - "errorContains": "$pop not allowed on encrypted values" - } - } - ] - }, - { - "description": "$pull succeeds on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$pull": { - "unencrypted": 1 - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 0, - "upsertedCount": 0 - } - }, - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$pull": { - "encrypted_string": 1 - } - } - }, - "result": { - "errorContains": "$pull not allowed on encrypted values" - } - } - ] - }, - { - "description": "$pullAll succeeds on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$pullAll": { - "unencrypted": [ - 1 - ] - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 0, - "upsertedCount": 0 - } - }, - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$pullAll": { - "encrypted_string": [ - 1 - ] - } - } - }, - "result": { - "errorContains": "$pullAll not allowed on encrypted values" - } - } - ] - }, - { - "description": "$push succeeds on unencrypted, error on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$push": { - "unencrypted": 1 - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$push": { - "encrypted_string": 1 - } - } - }, - "result": { - "errorContains": "$push not allowed on encrypted values" - } - } - ] - }, - { - "description": "array filters on encrypted fields does not error in mongocryptd, but errors in mongod", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$set": { - "encrypted_string.$[i].x": 1 - } - }, - "arrayFilters": [ - { - "i.x": 1 - } - ] - }, - "result": { - "errorContains": "Array update operations not allowed on encrypted values" - } - } - ] - }, - { - "description": "positional operator succeeds on unencrypted, errors on encrypted", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": { - "unencrypted": 1 - }, - "update": { - "$set": { - "unencrypted.$": 1 - } - } - }, - "result": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0 - } - }, - { - "name": "updateOne", - "arguments": { - "filter": { - "encrypted_string": "abc" - }, - "update": { - "$set": { - "encrypted_string.$": "abc" - } - } - }, - "result": { - "errorContains": "Cannot encrypt fields below '$' positional update operator" - } - } - ] - }, - { - "description": "an update that would produce an array on an encrypted field errors", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$set": { - "encrypted_string": [ - 1, - 2 - ] - } - } - }, - "result": { - "errorContains": "Cannot encrypt element of type" - } - } - ] - }, - { - "description": "an insert with encrypted field on _id errors", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "schemaMap": { - "default.default": { - "properties": { - "_id": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1 - } - }, - "result": { - "errorContains": "Invalid schema containing the 'encrypt' keyword." - } - } - ] - }, - { - "description": "an insert with an array value for an encrypted field fails", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "encrypted_string": [ - "123", - "456" - ] - } - }, - "result": { - "errorContains": "Cannot encrypt element of type" - } - } - ] - }, - { - "description": "an insert with a Timestamp(0,0) value in the top-level fails", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "random": { - "$timestamp": { - "t": 0, - "i": 0 - } - } - } - }, - "result": { - "errorContains": "A command that inserts cannot supply Timestamp(0, 0) for an encrypted" - } - } - ] - }, - { - "description": "distinct with the key referring to a field where the keyID is a JSON Pointer errors", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "distinct", - "arguments": { - "filter": {}, - "fieldName": "encrypted_w_altname" - }, - "result": { - "errorContains": "The distinct key is not allowed to be marked for encryption with a non-UUID keyId" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/badSchema.json b/driver-core/src/test/resources/client-side-encryption/legacy/badSchema.json deleted file mode 100644 index 1fd0f8ed3f9..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/badSchema.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "Schema with an encrypted field in an array", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - } - }, - "bsonType": "array" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0" - } - }, - "result": { - "errorContains": "Invalid schema" - } - } - ], - "outcome": { - "collection": { - "data": [] - } - } - }, - { - "description": "Schema without specifying parent object types", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "foo": { - "properties": { - "bar": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - } - } - } - } - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0" - } - }, - "result": { - "errorContains": "Invalid schema" - } - } - ], - "outcome": { - "collection": { - "data": [] - } - } - }, - { - "description": "Schema with siblings of encrypt document", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - }, - "bsonType": "object" - } - } - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0" - } - }, - "result": { - "errorContains": "'encrypt' cannot be used in conjunction with 'bsonType'" - } - } - ], - "outcome": { - "collection": { - "data": [] - } - } - }, - { - "description": "Schema with logical keywords", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "anyOf": [ - { - "properties": { - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - } - } - } - ] - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0" - } - }, - "result": { - "errorContains": "Invalid schema" - } - } - ], - "outcome": { - "collection": { - "data": [] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/basic.json b/driver-core/src/test/resources/client-side-encryption/legacy/basic.json deleted file mode 100644 index 3ed066f5302..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/basic.json +++ /dev/null @@ -1,350 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "Insert with deterministic encryption, then find it", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0" - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": [ - { - "_id": 1, - "encrypted_string": "string0" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "Insert with randomized encryption, then find it", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "random": "123" - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": [ - { - "_id": 1, - "random": "123" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "random": { - "$$type": "binData" - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "random": { - "$$type": "binData" - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/bulk.json b/driver-core/src/test/resources/client-side-encryption/legacy/bulk.json deleted file mode 100644 index 1b62e5e8ab3..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/bulk.json +++ /dev/null @@ -1,333 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "Bulk write with encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0", - "random": "abc" - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 2, - "encrypted_string": "string1" - } - } - }, - { - "name": "updateOne", - "arguments": { - "filter": { - "encrypted_string": "string0" - }, - "update": { - "$set": { - "encrypted_string": "string1" - } - } - } - }, - { - "name": "deleteOne", - "arguments": { - "filter": { - "$and": [ - { - "encrypted_string": "string1" - }, - { - "_id": 2 - } - ] - } - } - } - ], - "options": { - "ordered": true - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "update": "default", - "updates": [ - { - "q": { - "encrypted_string": { - "$eq": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - }, - "u": { - "$set": { - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - } - } - ], - "ordered": true - }, - "command_name": "update" - } - }, - { - "command_started_event": { - "command": { - "delete": "default", - "deletes": [ - { - "q": { - "$and": [ - { - "encrypted_string": { - "$eq": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - }, - { - "_id": { - "$eq": 2 - } - } - ] - }, - "limit": 1 - } - ], - "ordered": true - }, - "command_name": "delete" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/bypassAutoEncryption.json b/driver-core/src/test/resources/client-side-encryption/legacy/bypassAutoEncryption.json deleted file mode 100644 index 9d09cb3fa92..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/bypassAutoEncryption.json +++ /dev/null @@ -1,402 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "Insert with bypassAutoEncryption", - "clientOptions": { - "autoEncryptOpts": { - "bypassAutoEncryption": true, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 2, - "encrypted_string": "string0" - }, - "bypassDocumentValidation": true - } - }, - { - "name": "find", - "arguments": { - "filter": {} - }, - "result": [ - { - "_id": 1, - "encrypted_string": "string0" - }, - { - "_id": 2, - "encrypted_string": "string0" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 2, - "encrypted_string": "string0" - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": {} - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": "string0" - } - ] - } - } - }, - { - "description": "Insert with bypassAutoEncryption for local schema", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "bypassAutoEncryption": true, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 2, - "encrypted_string": "string0" - }, - "bypassDocumentValidation": true - } - }, - { - "name": "find", - "arguments": { - "filter": {} - }, - "result": [ - { - "_id": 1, - "encrypted_string": "string0" - }, - { - "_id": 2, - "encrypted_string": "string0" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 2, - "encrypted_string": "string0" - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": {} - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": "string0" - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/bypassedCommand.json b/driver-core/src/test/resources/client-side-encryption/legacy/bypassedCommand.json deleted file mode 100644 index 18054a70cbf..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/bypassedCommand.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": {}, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "ping is bypassed", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "runCommand", - "object": "database", - "command_name": "ping", - "arguments": { - "command": { - "ping": 1 - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "ping": 1 - }, - "command_name": "ping" - } - } - ] - }, - { - "description": "kill op is not bypassed", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "runCommand", - "object": "database", - "command_name": "killOp", - "arguments": { - "command": { - "killOp": 1, - "op": 1234 - } - }, - "result": { - "errorContains": "command not supported for auto encryption: killOp" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/count.json b/driver-core/src/test/resources/client-side-encryption/legacy/count.json deleted file mode 100644 index 9df8cd639e0..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/count.json +++ /dev/null @@ -1,229 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "Count with deterministic encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "count", - "arguments": { - "filter": { - "encrypted_string": "string0" - } - }, - "result": 2 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "count": "default", - "query": { - "encrypted_string": { - "$eq": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - } - }, - "command_name": "count" - } - } - ] - }, - { - "description": "Count fails when filtering on a random encrypted field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "count", - "arguments": { - "filter": { - "random": "abc" - } - }, - "result": { - "errorContains": "Cannot query on fields encrypted with the randomized encryption" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/countDocuments.json b/driver-core/src/test/resources/client-side-encryption/legacy/countDocuments.json deleted file mode 100644 index 07ff97f2645..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/countDocuments.json +++ /dev/null @@ -1,241 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "countDocuments with deterministic encryption", - "skipReason": "waiting on SERVER-39395", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "countDocuments", - "arguments": { - "filter": { - "encrypted_string": "string0" - } - }, - "result": 1 - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "default", - "pipeline": [ - { - "$match": { - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "command_name": "aggregate" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/create-and-createIndexes.json b/driver-core/src/test/resources/client-side-encryption/legacy/create-and-createIndexes.json deleted file mode 100644 index 48638a97c89..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/create-and-createIndexes.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "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" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/delete.json b/driver-core/src/test/resources/client-side-encryption/legacy/delete.json deleted file mode 100644 index a6f4ffde916..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/delete.json +++ /dev/null @@ -1,340 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "deleteOne with deterministic encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "deleteOne", - "arguments": { - "filter": { - "encrypted_string": "string0" - } - }, - "result": { - "deletedCount": 1 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "delete": "default", - "deletes": [ - { - "q": { - "encrypted_string": { - "$eq": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - }, - "limit": 1 - } - ], - "ordered": true - }, - "command_name": "delete" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "deleteMany with deterministic encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "deleteMany", - "arguments": { - "filter": { - "encrypted_string": { - "$in": [ - "string0", - "string1" - ] - } - } - }, - "result": { - "deletedCount": 2 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "delete": "default", - "deletes": [ - { - "q": { - "encrypted_string": { - "$in": [ - { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - }, - { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - ] - } - }, - "limit": 0 - } - ], - "ordered": true - }, - "command_name": "delete" - } - } - ], - "outcome": { - "collection": { - "data": [] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/distinct.json b/driver-core/src/test/resources/client-side-encryption/legacy/distinct.json deleted file mode 100644 index 9786b07814c..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/distinct.json +++ /dev/null @@ -1,276 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 3, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "distinct with deterministic encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "distinct", - "arguments": { - "filter": { - "encrypted_string": "string0" - }, - "fieldName": "encrypted_string" - }, - "result": [ - "string0" - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "distinct": "default", - "key": "encrypted_string", - "query": { - "encrypted_string": { - "$eq": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - } - }, - "command_name": "distinct" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 3, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "Distinct fails when filtering on a random encrypted field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "distinct", - "arguments": { - "filter": { - "random": "abc" - }, - "fieldName": "encrypted_string" - }, - "result": { - "errorContains": "Cannot query on fields encrypted with the randomized encryption" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/explain.json b/driver-core/src/test/resources/client-side-encryption/legacy/explain.json deleted file mode 100644 index 8ca3b48d37d..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/explain.json +++ /dev/null @@ -1,239 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "Explain a find with deterministic encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "runCommand", - "object": "database", - "command_name": "explain", - "arguments": { - "command": { - "explain": { - "find": "default", - "filter": { - "encrypted_string": "string1" - } - } - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "explain": { - "find": "default", - "filter": { - "encrypted_string": { - "$eq": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - } - }, - "verbosity": "allPlansExecution" - }, - "command_name": "explain" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/find.json b/driver-core/src/test/resources/client-side-encryption/legacy/find.json deleted file mode 100644 index 1feddab0e37..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/find.json +++ /dev/null @@ -1,408 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - }, - "random": { - "$binary": { - "base64": "AgAAAAAAAAAAAAAAAAAAAAACyfp+lXvKOi7f5vh6ZsCijLEaXFKq1X06RmyS98ZvmMQGixTw8HM1f/bGxZjGwvYwjXOkIEb7Exgb8p2KCDI5TQ==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "Find with deterministic encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": "string0" - } - }, - "result": [ - { - "_id": 1, - "encrypted_string": "string0" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "encrypted_string": { - "$eq": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - }, - "random": { - "$binary": { - "base64": "AgAAAAAAAAAAAAAAAAAAAAACyfp+lXvKOi7f5vh6ZsCijLEaXFKq1X06RmyS98ZvmMQGixTw8HM1f/bGxZjGwvYwjXOkIEb7Exgb8p2KCDI5TQ==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "Find with $in with deterministic encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "encrypted_string": { - "$in": [ - "string0", - "string1" - ] - } - } - }, - "result": [ - { - "_id": 1, - "encrypted_string": "string0" - }, - { - "_id": 2, - "encrypted_string": "string1", - "random": "abc" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "encrypted_string": { - "$in": [ - { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - }, - { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - ] - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - }, - "random": { - "$binary": { - "base64": "AgAAAAAAAAAAAAAAAAAAAAACyfp+lXvKOi7f5vh6ZsCijLEaXFKq1X06RmyS98ZvmMQGixTw8HM1f/bGxZjGwvYwjXOkIEb7Exgb8p2KCDI5TQ==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "Find fails when filtering on a random encrypted field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "random": "abc" - } - }, - "result": { - "errorContains": "Cannot query on fields encrypted with the randomized encryption" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/findOneAndDelete.json b/driver-core/src/test/resources/client-side-encryption/legacy/findOneAndDelete.json deleted file mode 100644 index e418a4581be..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/findOneAndDelete.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "findOneAndDelete with deterministic encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "findOneAndDelete", - "arguments": { - "filter": { - "encrypted_string": "string0" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default", - "query": { - "encrypted_string": { - "$eq": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - }, - "remove": true - }, - "command_name": "findAndModify" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/findOneAndReplace.json b/driver-core/src/test/resources/client-side-encryption/legacy/findOneAndReplace.json deleted file mode 100644 index 78baca8432e..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/findOneAndReplace.json +++ /dev/null @@ -1,227 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "findOneAndReplace with deterministic encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "findOneAndReplace", - "arguments": { - "filter": { - "encrypted_string": "string0" - }, - "replacement": { - "encrypted_string": "string1" - }, - "returnDocument": "Before" - }, - "result": { - "_id": 1, - "encrypted_string": "string0" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default", - "query": { - "encrypted_string": { - "$eq": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - }, - "update": { - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - }, - "command_name": "findAndModify" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/findOneAndUpdate.json b/driver-core/src/test/resources/client-side-encryption/legacy/findOneAndUpdate.json deleted file mode 100644 index 1d858511516..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/findOneAndUpdate.json +++ /dev/null @@ -1,231 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "findOneAndUpdate with deterministic encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "encrypted_string": "string0" - }, - "update": { - "$set": { - "encrypted_string": "string1" - } - }, - "returnDocument": "Before" - }, - "result": { - "_id": 1, - "encrypted_string": "string0" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default", - "query": { - "encrypted_string": { - "$eq": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - }, - "update": { - "$set": { - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - } - }, - "command_name": "findAndModify" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-BypassQueryAnalysis.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-BypassQueryAnalysis.json deleted file mode 100644 index 9b28df2f9a1..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-BypassQueryAnalysis.json +++ /dev/null @@ -1,261 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "BypassQueryAnalysis decrypts", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "bypassQueryAnalysis": true - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedIndexed": { - "$binary": { - "base64": "C18BAAAFZAAgAAAAANnt+eLTkv4GdDPl8IAfJOvTzArOgFJQ2S/DcLza4W0DBXMAIAAAAAD2u+omZme3P2gBPehMQyQHQ153tPN1+z7bksYA9jKTpAVwADAAAAAAUnCOQqIvmR65YKyYnsiVfVrg9hwUVO3RhhKExo3RWOzgaS0QdsBL5xKFS0JhZSoWBXUAEAAAAAQSNFZ4EjSYdhI0EjRWeJASEHQAAgAAAAV2AFAAAAAAEjRWeBI0mHYSNBI0VniQEpQbp/ZJpWBKeDtKLiXb0P2E9wvc0g3f373jnYQYlJquOrlPOoEy3ngsHPJuSUijvWDsrQzqYa349K7G/66qaXEFZQAgAAAAAOuac/eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsBWwAIAAAAACkm0o9bj6j0HuADKc0svbqO2UHj6GrlNdF6yKNxh63xRJrAAAAAAAAAAAAAA==", - "subType": "06" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": [ - { - "_id": 1, - "encryptedIndexed": "123" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedIndexed": { - "$binary": { - "base64": "C18BAAAFZAAgAAAAANnt+eLTkv4GdDPl8IAfJOvTzArOgFJQ2S/DcLza4W0DBXMAIAAAAAD2u+omZme3P2gBPehMQyQHQ153tPN1+z7bksYA9jKTpAVwADAAAAAAUnCOQqIvmR65YKyYnsiVfVrg9hwUVO3RhhKExo3RWOzgaS0QdsBL5xKFS0JhZSoWBXUAEAAAAAQSNFZ4EjSYdhI0EjRWeJASEHQAAgAAAAV2AFAAAAAAEjRWeBI0mHYSNBI0VniQEpQbp/ZJpWBKeDtKLiXb0P2E9wvc0g3f373jnYQYlJquOrlPOoEy3ngsHPJuSUijvWDsrQzqYa349K7G/66qaXEFZQAgAAAAAOuac/eRLYakKX6B0vZ1r3QodOQFfjqJD+xlGiPu4/PsBWwAIAAAAACkm0o9bj6j0HuADKc0svbqO2UHj6GrlNdF6yKNxh63xRJrAAAAAAAAAAAAAA==", - "subType": "06" - } - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "31eCYlbQoVboc5zwC8IoyJVSkag9PxREka8dkmbXJeY=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Compact.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Compact.json deleted file mode 100644 index 868095e1e64..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Compact.json +++ /dev/null @@ -1,233 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - }, - { - "_id": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "HBk9BWihXExNDvTp1lUxOuxuZK2Pe2ZdVdlsxPEBkiO1bS4mG5NNDsQ7zVxJAH8BtdOYp72Ku4Y3nwc0BUpIKsvAKX4eYXtlhv5zUQxWdeNFhg9qK7qb8nqhnnLeT0f25jFSqzWJoT379hfwDeu0bebJHr35QrJ8myZdPMTEDYF08QYQ48ShRBli0S+QzBHHAQiM2iJNr4svg2WR8JSeWQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Compact works", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "runCommand", - "object": "database", - "command_name": "compactStructuredEncryptionData", - "arguments": { - "command": { - "compactStructuredEncryptionData": "default" - } - }, - "result": { - "ok": 1 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "compactStructuredEncryptionData": "default", - "compactionTokens": { - "encryptedIndexed": { - "$binary": { - "base64": "noN+05JsuO1oDg59yypIGj45i+eFH6HOTXOPpeZ//Mk=", - "subType": "00" - } - }, - "encryptedUnindexed": { - "$binary": { - "base64": "SWO8WEoZ2r2Kx/muQKb7+COizy85nIIUFiHh4K9kcvA=", - "subType": "00" - } - } - } - }, - "command_name": "compactStructuredEncryptionData" - } - } - ] - }, - { - "description": "Compact errors on an unencrypted client", - "operations": [ - { - "name": "runCommand", - "object": "database", - "command_name": "compactStructuredEncryptionData", - "arguments": { - "command": { - "compactStructuredEncryptionData": "default" - } - }, - "result": { - "errorContains": "'compactStructuredEncryptionData.compactionTokens' is missing" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-CreateCollection-OldServer.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-CreateCollection-OldServer.json deleted file mode 100644 index c266aa6b835..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-CreateCollection-OldServer.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "6.0.0", - "maxServerVersion": "6.3.99", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "tests": [ - { - "description": "driver returns an error if creating a QEv2 collection on unsupported server", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - }, - "result": { - "errorContains": "Driver support of Queryable Encryption is incompatible with server. Upgrade server to use Queryable Encryption." - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.esc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecoc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-CreateCollection.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-CreateCollection.json deleted file mode 100644 index c324be8abc5..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-CreateCollection.json +++ /dev/null @@ -1,1758 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "tests": [ - { - "description": "state collections and index are created", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.esc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecoc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - }, - { - "name": "assertIndexExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection", - "index": "__safeContent___1" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.esc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.ecoc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "encryptedCollection" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.esc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.ecoc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "createIndexes": "encryptedCollection", - "indexes": [ - { - "name": "__safeContent___1", - "key": { - "__safeContent__": 1 - } - } - ] - }, - "command_name": "createIndexes", - "database_name": "default" - } - } - ] - }, - { - "description": "default state collection names are applied", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.esc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecoc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - }, - { - "name": "assertIndexExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection", - "index": "__safeContent___1" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.esc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.ecoc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "encryptedCollection" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.esc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.ecoc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "createIndexes": "encryptedCollection", - "indexes": [ - { - "name": "__safeContent___1", - "key": { - "__safeContent__": 1 - } - } - ] - }, - "command_name": "createIndexes", - "database_name": "default" - } - } - ] - }, - { - "description": "drop removes all state collections", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.esc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecoc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - }, - { - "name": "assertIndexExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection", - "index": "__safeContent___1" - } - }, - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecoc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - }, - { - "name": "assertIndexNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection", - "index": "__safeContent___1" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.esc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.ecoc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "encryptedCollection" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.esc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.ecoc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "createIndexes": "encryptedCollection", - "indexes": [ - { - "name": "__safeContent___1", - "key": { - "__safeContent__": 1 - } - } - ] - }, - "command_name": "createIndexes", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.esc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.ecoc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "encryptedCollection" - }, - "command_name": "drop", - "database_name": "default" - } - } - ] - }, - { - "description": "CreateCollection without encryptedFields.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "plaintextCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "plaintextCollection" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "plaintextCollection" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "plaintextCollection" - } - }, - "command_name": "listCollections", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "plaintextCollection" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "plaintextCollection" - }, - "command_name": "create", - "database_name": "default" - } - } - ] - }, - { - "description": "CreateCollection from encryptedFieldsMap.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.esc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecoc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - }, - { - "name": "assertIndexExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection", - "index": "__safeContent___1" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.esc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.ecoc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "encryptedCollection" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.esc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.ecoc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "createIndexes": "encryptedCollection", - "indexes": [ - { - "name": "__safeContent___1", - "key": { - "__safeContent__": 1 - } - } - ] - }, - "command_name": "createIndexes", - "database_name": "default" - } - } - ] - }, - { - "description": "CreateCollection from encryptedFields.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.esc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecoc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - }, - { - "name": "assertIndexExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection", - "index": "__safeContent___1" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.esc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.ecoc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "encryptedCollection" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.esc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.ecoc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "encryptedCollection" - } - }, - "command_name": "listCollections", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "createIndexes": "encryptedCollection", - "indexes": [ - { - "name": "__safeContent___1", - "key": { - "__safeContent__": 1 - } - } - ] - }, - "command_name": "createIndexes", - "database_name": "default" - } - } - ] - }, - { - "description": "DropCollection from encryptedFieldsMap", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.esc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.ecoc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "encryptedCollection" - }, - "command_name": "drop", - "database_name": "default" - } - } - ] - }, - { - "description": "DropCollection from encryptedFields", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "encryptedFieldsMap": {} - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.esc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecoc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - }, - { - "name": "assertIndexExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection", - "index": "__safeContent___1" - } - }, - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.esc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecoc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.esc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.ecoc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "encryptedCollection" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.esc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.ecoc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "encryptedCollection" - } - }, - "command_name": "listCollections", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "createIndexes": "encryptedCollection", - "indexes": [ - { - "name": "__safeContent___1", - "key": { - "__safeContent__": 1 - } - } - ] - }, - "command_name": "createIndexes", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.esc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.ecoc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "encryptedCollection" - }, - "command_name": "drop", - "database_name": "default" - } - } - ] - }, - { - "description": "DropCollection from remote encryptedFields", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "encryptedFieldsMap": {} - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.esc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecoc" - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - }, - { - "name": "assertIndexExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection", - "index": "__safeContent___1" - } - }, - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.esc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "enxcol_.encryptedCollection.ecoc" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.esc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.ecoc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "encryptedCollection" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.esc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "enxcol_.encryptedCollection.ecoc", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "create": "encryptedCollection", - "encryptedFields": { - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - }, - "command_name": "create", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "encryptedCollection" - } - }, - "command_name": "listCollections", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "createIndexes": "encryptedCollection", - "indexes": [ - { - "name": "__safeContent___1", - "key": { - "__safeContent__": 1 - } - } - ] - }, - "command_name": "createIndexes", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "encryptedCollection" - } - }, - "command_name": "listCollections", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.esc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "enxcol_.encryptedCollection.ecoc" - }, - "command_name": "drop", - "database_name": "default" - } - }, - { - "command_started_event": { - "command": { - "drop": "encryptedCollection" - }, - "command_name": "drop", - "database_name": "default" - } - } - ] - }, - { - "description": "encryptedFields are consulted for metadata collection names", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "escCollection": "invalid_esc_name", - "ecocCollection": "invalid_ecoc_name", - "fields": [ - { - "path": "firstName", - "bsonType": "string", - "keyId": { - "$binary": { - "subType": "04", - "base64": "AAAAAAAAAAAAAAAAAAAAAA==" - } - } - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - }, - "result": { - "errorContains": "Encrypted State Collection name should follow" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-DecryptExistingData.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-DecryptExistingData.json deleted file mode 100644 index 1fb4c1d1bc7..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-DecryptExistingData.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encryptedUnindexed": { - "$binary": { - "base64": "BqvN76sSNJh2EjQSNFZ4kBICTQaVZPWgXp41I7mPV1rLFTtw1tXzjcdSEyxpKKqujlko5TeizkB9hHQ009dVY1+fgIiDcefh+eQrm3CkhQ==", - "subType": "06" - } - } - } - ], - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "HBk9BWihXExNDvTp1lUxOuxuZK2Pe2ZdVdlsxPEBkiO1bS4mG5NNDsQ7zVxJAH8BtdOYp72Ku4Y3nwc0BUpIKsvAKX4eYXtlhv5zUQxWdeNFhg9qK7qb8nqhnnLeT0f25jFSqzWJoT379hfwDeu0bebJHr35QrJ8myZdPMTEDYF08QYQ48ShRBli0S+QzBHHAQiM2iJNr4svg2WR8JSeWQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 decrypt of existing data succeeds", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": [ - { - "_id": 1, - "encryptedUnindexed": "value123" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Delete.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Delete.json deleted file mode 100644 index ddfe57b00cb..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Delete.json +++ /dev/null @@ -1,284 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Delete can query an FLE2 indexed field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedIndexed": "value123" - } - } - }, - { - "name": "deleteOne", - "arguments": { - "filter": { - "encryptedIndexed": "value123" - } - }, - "result": { - "deletedCount": 1 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "delete": "default", - "deletes": [ - { - "q": { - "encryptedIndexed": { - "$eq": { - "$binary": { - "base64": "DIkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVsACAAAAAAaZ9s3G+4znfxStxeOZwcZy1OhzjMGc5hjmdMN+b/w6kSY20AAAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "limit": 1 - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "delete" - } - } - ], - "outcome": { - "collection": { - "data": [] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-EncryptedFields-vs-EncryptedFieldsMap.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-EncryptedFields-vs-EncryptedFieldsMap.json deleted file mode 100644 index bdc5c99bc28..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-EncryptedFields-vs-EncryptedFieldsMap.json +++ /dev/null @@ -1,212 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "HBk9BWihXExNDvTp1lUxOuxuZK2Pe2ZdVdlsxPEBkiO1bS4mG5NNDsQ7zVxJAH8BtdOYp72Ku4Y3nwc0BUpIKsvAKX4eYXtlhv5zUQxWdeNFhg9qK7qb8nqhnnLeT0f25jFSqzWJoT379hfwDeu0bebJHr35QrJ8myZdPMTEDYF08QYQ48ShRBli0S+QzBHHAQiM2iJNr4svg2WR8JSeWQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "encryptedFieldsMap is preferred over remote encryptedFields", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "encryptedFieldsMap": { - "default.default": { - "fields": [] - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedUnindexed": { - "$binary": { - "base64": "BqvN76sSNJh2EjQSNFZ4kBICTQaVZPWgXp41I7mPV1rLFTtw1tXzjcdSEyxpKKqujlko5TeizkB9hHQ009dVY1+fgIiDcefh+eQrm3CkhQ==", - "subType": "06" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": [ - { - "_id": 1, - "encryptedUnindexed": "value123" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedUnindexed": { - "$binary": { - "base64": "BqvN76sSNJh2EjQSNFZ4kBICTQaVZPWgXp41I7mPV1rLFTtw1tXzjcdSEyxpKKqujlko5TeizkB9hHQ009dVY1+fgIiDcefh+eQrm3CkhQ==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encryptedUnindexed": { - "$binary": { - "base64": "BqvN76sSNJh2EjQSNFZ4kBICTQaVZPWgXp41I7mPV1rLFTtw1tXzjcdSEyxpKKqujlko5TeizkB9hHQ009dVY1+fgIiDcefh+eQrm3CkhQ==", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-EncryptedFields-vs-jsonSchema.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-EncryptedFields-vs-jsonSchema.json deleted file mode 100644 index 8e0c6dafa3c..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-EncryptedFields-vs-jsonSchema.json +++ /dev/null @@ -1,300 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": { - "properties": {}, - "bsonType": "object" - }, - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "encryptedFields is preferred over jsonSchema", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedIndexed": "123" - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedIndexed": "123" - } - }, - "result": [ - { - "_id": 1, - "encryptedIndexed": "123" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "encryptedIndexed": { - "$eq": { - "$binary": { - "base64": "DIkAAAAFZAAgAAAAAPGmZcUzdE/FPILvRSyAScGvZparGI2y9rJ/vSBxgCujBXMAIAAAAACi1RjmndKqgnXy7xb22RzUbnZl1sOZRXPOC0KcJkAxmQVsACAAAAAApJtKPW4+o9B7gAynNLL26jtlB4+hq5TXResijcYet8USY20AAAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "31eCYlbQoVboc5zwC8IoyJVSkag9PxREka8dkmbXJeY=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-EncryptedFieldsMap-defaults.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-EncryptedFieldsMap-defaults.json deleted file mode 100644 index 1c0a057cad4..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-EncryptedFieldsMap-defaults.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "key_vault_data": [], - "tests": [ - { - "description": "default state collections are applied to encryptionInformation", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "encryptedFieldsMap": { - "default.default": { - "fields": [] - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "foo": { - "$binary": { - "base64": "BYkAAAAFZAAgAAAAAE8KGPgq7h3n9nH5lfHcia8wtOTLwGkZNLBesb6PULqbBXMAIAAAAACq0558QyD3c3jkR5k0Zc9UpQK8ByhXhtn2d1xVQnuJ3AVjACAAAAAA1003zUWGwD4zVZ0KeihnZOthS3V6CEHUfnJZcIYHefISY20AAAAAAAAAAAAA", - "subType": "06" - } - } - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "foo": { - "$binary": { - "base64": "BYkAAAAFZAAgAAAAAE8KGPgq7h3n9nH5lfHcia8wtOTLwGkZNLBesb6PULqbBXMAIAAAAACq0558QyD3c3jkR5k0Zc9UpQK8ByhXhtn2d1xVQnuJ3AVjACAAAAAA1003zUWGwD4zVZ0KeihnZOthS3V6CEHUfnJZcIYHefISY20AAAAAAAAAAAAA", - "subType": "06" - } - } - } - ], - "encryptionInformation": { - "type": { - "$numberInt": "1" - }, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [] - } - } - }, - "ordered": true - }, - "command_name": "insert" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "foo": { - "$binary": { - "base64": "BYkAAAAFZAAgAAAAAE8KGPgq7h3n9nH5lfHcia8wtOTLwGkZNLBesb6PULqbBXMAIAAAAACq0558QyD3c3jkR5k0Zc9UpQK8ByhXhtn2d1xVQnuJ3AVjACAAAAAA1003zUWGwD4zVZ0KeihnZOthS3V6CEHUfnJZcIYHefISY20AAAAAAAAAAAAA", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-FindOneAndUpdate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-FindOneAndUpdate.json deleted file mode 100644 index c5e689a3de4..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-FindOneAndUpdate.json +++ /dev/null @@ -1,560 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "findOneAndUpdate can query an FLE2 indexed field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedIndexed": "value123" - } - } - }, - { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "encryptedIndexed": "value123" - }, - "update": { - "$set": { - "foo": "bar" - } - }, - "returnDocument": "Before" - }, - "result": { - "_id": 1, - "encryptedIndexed": "value123" - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default", - "query": { - "encryptedIndexed": { - "$eq": { - "$binary": { - "base64": "DIkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVsACAAAAAAaZ9s3G+4znfxStxeOZwcZy1OhzjMGc5hjmdMN+b/w6kSY20AAAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "update": { - "$set": { - "foo": "bar" - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "findAndModify" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - }, - "foo": "bar", - "__safeContent__": [ - { - "$binary": { - "base64": "ThpoKfQ8AkOzkFfNC1+9PF0pY2nIzfXvRdxQgjkNbBw=", - "subType": "00" - } - } - ] - } - ] - } - } - }, - { - "description": "findOneAndUpdate can modify an FLE2 indexed field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedIndexed": "value123" - } - } - }, - { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "encryptedIndexed": "value123" - }, - "update": { - "$set": { - "encryptedIndexed": "value456" - } - }, - "returnDocument": "Before" - }, - "result": { - "_id": 1, - "encryptedIndexed": "value123" - } - }, - { - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": [ - { - "encryptedIndexed": "value456" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default", - "query": { - "encryptedIndexed": { - "$eq": { - "$binary": { - "base64": "DIkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVsACAAAAAAaZ9s3G+4znfxStxeOZwcZy1OhzjMGc5hjmdMN+b/w6kSY20AAAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "update": { - "$set": { - "encryptedIndexed": { - "$$type": "binData" - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "findAndModify" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": { - "$eq": 1 - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "rhe7/w8Ob8Unl44rGr/moScx6m5VODQnscDhF4Nkn6g=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-InsertFind-Indexed.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-InsertFind-Indexed.json deleted file mode 100644 index 6e156ffc603..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-InsertFind-Indexed.json +++ /dev/null @@ -1,296 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Insert and find FLE2 indexed field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedIndexed": "123" - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedIndexed": "123" - } - }, - "result": [ - { - "_id": 1, - "encryptedIndexed": "123" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "encryptedIndexed": { - "$eq": { - "$binary": { - "base64": "DIkAAAAFZAAgAAAAAPGmZcUzdE/FPILvRSyAScGvZparGI2y9rJ/vSBxgCujBXMAIAAAAACi1RjmndKqgnXy7xb22RzUbnZl1sOZRXPOC0KcJkAxmQVsACAAAAAApJtKPW4+o9B7gAynNLL26jtlB4+hq5TXResijcYet8USY20AAAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "31eCYlbQoVboc5zwC8IoyJVSkag9PxREka8dkmbXJeY=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-InsertFind-Unindexed.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-InsertFind-Unindexed.json deleted file mode 100644 index 48280f5bd4d..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-InsertFind-Unindexed.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "HBk9BWihXExNDvTp1lUxOuxuZK2Pe2ZdVdlsxPEBkiO1bS4mG5NNDsQ7zVxJAH8BtdOYp72Ku4Y3nwc0BUpIKsvAKX4eYXtlhv5zUQxWdeNFhg9qK7qb8nqhnnLeT0f25jFSqzWJoT379hfwDeu0bebJHr35QrJ8myZdPMTEDYF08QYQ48ShRBli0S+QzBHHAQiM2iJNr4svg2WR8JSeWQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Insert and find FLE2 unindexed field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedUnindexed": "value123" - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": [ - { - "_id": 1, - "encryptedUnindexed": "value123" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedUnindexed": { - "$$type": "binData" - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": { - "$eq": 1 - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encryptedUnindexed": { - "$$type": "binData" - } - } - ] - } - } - }, - { - "description": "Query with an unindexed field fails", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedUnindexed": "value123" - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedUnindexed": "value123" - } - }, - "result": { - "errorContains": "encrypt" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-MissingKey.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-MissingKey.json deleted file mode 100644 index 1e655f0a9c4..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-MissingKey.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "encryptedUnindexed": { - "$binary": { - "base64": "BqvN76sSNJh2EjQSNFZ4kBICTQaVZPWgXp41I7mPV1rLFTtw1tXzjcdSEyxpKKqujlko5TeizkB9hHQ009dVY1+fgIiDcefh+eQrm3CkhQ==", - "subType": "06" - } - } - } - ], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - }, - "key_vault_data": [], - "tests": [ - { - "description": "FLE2 encrypt fails with missing key", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedIndexed": "123" - } - }, - "result": { - "errorContains": "not all keys requested were satisfied" - } - } - ] - }, - { - "description": "FLE2 decrypt fails with missing key", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": {} - }, - "result": { - "errorContains": "not all keys requested were satisfied" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-NoEncryption.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-NoEncryption.json deleted file mode 100644 index a6843c4737f..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-NoEncryption.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "key_vault_data": [], - "encrypted_fields": { - "fields": [] - }, - "tests": [ - { - "description": "insert with no encryption succeeds", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "foo": "bar" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "foo": "bar" - } - ], - "ordered": true - }, - "command_name": "insert" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "foo": "bar" - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Compact.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Compact.json deleted file mode 100644 index bba9f25535a..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Compact.json +++ /dev/null @@ -1,290 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Compact works with 'range' fields", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "command_name": "compactStructuredEncryptionData", - "arguments": { - "command": { - "compactStructuredEncryptionData": "default" - } - }, - "result": { - "ok": 1 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "compactStructuredEncryptionData": "default", - "compactionTokens": { - "encryptedInt": { - "ecoc": { - "$binary": { - "base64": "noN+05JsuO1oDg59yypIGj45i+eFH6HOTXOPpeZ//Mk=", - "subType": "00" - } - }, - "anchorPaddingToken": { - "$binary": { - "base64": "QxKJD2If48p0l8NAXf2Kr0aleMd/dATSjBK6hTpNMyc=", - "subType": "00" - } - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "compactStructuredEncryptionData" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-Aggregate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-Aggregate.json deleted file mode 100644 index df2161cc364..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-Aggregate.json +++ /dev/null @@ -1,508 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Date. Aggregate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$gt": { - "$date": { - "$numberLong": "0" - } - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDate": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDate": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "default", - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$gt": { - "$binary": { - "base64": "DXUFAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAAJbW4AAAAAAAAAAAAJbXgAyAAAAAAAAAAA", - "subType": "06" - } - } - } - } - } - ], - "cursor": {}, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "aggregate" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDate": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDate": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FA74j21GUEJb1DJBOpR9nVnjaDZnd8yAQNuaW9Qi26g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kJv//KVkbrobIBf+QeWC5jxn20mx/P0R1N6aCSMgKM8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zB+Whi9IUUGxfLEe+lGuIzLX4LFbIhaIAm5lRk65QTc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ybO1QU3CgvhO8JgRXH+HxKszWcpl5aGDYYVa75fHa1g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X3Y3eSAbbMg//JgiHHiFpYOpV61t8kkDexI+CQyitH4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SlNHXyqVFGDPrX/2ppwog6l4pwj3PKda2TkZbqgfSfA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "McjV8xwTF3xI7863DYOBdyvIv6UpzThl6v9vBRk05bI=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-Correctness.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-Correctness.json deleted file mode 100644 index fae25a1c028..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-Correctness.json +++ /dev/null @@ -1,1842 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Find with $gt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$gt": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ] - }, - { - "description": "Find with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$gte": { - "$date": { - "$numberLong": "0" - } - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - }, - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ] - }, - { - "description": "Find with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$gt": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - "result": [] - } - ] - }, - { - "description": "Find with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$lt": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - ] - } - ] - }, - { - "description": "Find with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$lte": { - "$date": { - "$numberLong": "1" - } - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - }, - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ] - }, - { - "description": "Find with $lt below min", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$lt": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - "result": { - "errorContains": "must be greater than the range minimum" - } - } - ] - }, - { - "description": "Find with $gt above max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$gt": { - "$date": { - "$numberLong": "200" - } - } - } - } - }, - "result": { - "errorContains": "must be less than the range maximum" - } - } - ] - }, - { - "description": "Find with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$gt": { - "$date": { - "$numberLong": "0" - } - }, - "$lt": { - "$date": { - "$numberLong": "2" - } - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ] - }, - { - "description": "Find with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - ] - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ] - }, - { - "description": "Find with full range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$gte": { - "$date": { - "$numberLong": "0" - } - }, - "$lte": { - "$date": { - "$numberLong": "200" - } - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - }, - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ] - }, - { - "description": "Find with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$in": [ - { - "$date": { - "$numberLong": "0" - } - } - ] - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - ] - } - ] - }, - { - "description": "Insert out of range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "-1" - } - } - } - }, - "result": { - "errorContains": "value must be greater than or equal to the minimum value" - } - } - ] - }, - { - "description": "Insert min and max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 200, - "encryptedDate": { - "$date": { - "$numberLong": "200" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - }, - { - "_id": 200, - "encryptedDate": { - "$date": { - "$numberLong": "200" - } - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$gte": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - }, - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$gt": { - "$date": { - "$numberLong": "1" - } - } - } - } - } - ] - }, - "result": [] - } - ] - }, - { - "description": "Aggregate with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$lt": { - "$date": { - "$numberLong": "1" - } - } - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - ] - } - ] - }, - { - "description": "Aggregate with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$lte": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - }, - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ] - }, - { - "description": "Aggregate with $lt below min", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$lt": { - "$date": { - "$numberLong": "0" - } - } - } - } - } - ] - }, - "result": { - "errorContains": "must be greater than the range minimum" - } - } - ] - }, - { - "description": "Aggregate with $gt above max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$gt": { - "$date": { - "$numberLong": "200" - } - } - } - } - } - ] - }, - "result": { - "errorContains": "must be less than the range maximum" - } - } - ] - }, - { - "description": "Aggregate with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$gt": { - "$date": { - "$numberLong": "0" - } - }, - "$lt": { - "$date": { - "$numberLong": "2" - } - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ] - }, - { - "description": "Aggregate with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - ] - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ] - }, - { - "description": "Aggregate with full range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$gte": { - "$date": { - "$numberLong": "0" - } - }, - "$lte": { - "$date": { - "$numberLong": "200" - } - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - }, - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ] - }, - { - "description": "Aggregate with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDate": { - "$in": [ - { - "$date": { - "$numberLong": "0" - } - } - ] - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - ] - } - ] - }, - { - "description": "Wrong type: Insert Double", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$numberDouble": "0" - } - } - }, - "result": { - "errorContains": "cannot encrypt element" - } - } - ] - }, - { - "description": "Wrong type: Find Double", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$gte": { - "$numberDouble": "0" - } - } - } - }, - "result": { - "errorContains": "value type is a date" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-Delete.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-Delete.json deleted file mode 100644 index b4f15d9b1fd..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-Delete.json +++ /dev/null @@ -1,442 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Date. Delete.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "deleteOne", - "arguments": { - "filter": { - "encryptedDate": { - "$gt": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - "result": { - "deletedCount": 1 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDate": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDate": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "delete": "default", - "deletes": [ - { - "q": { - "encryptedDate": { - "$gt": { - "$binary": { - "base64": "DXUFAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAAJbW4AAAAAAAAAAAAJbXgAyAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "limit": 1 - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "delete" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDate": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-FindOneAndUpdate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-FindOneAndUpdate.json deleted file mode 100644 index 97ab4aaeb91..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-FindOneAndUpdate.json +++ /dev/null @@ -1,514 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Date. FindOneAndUpdate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "encryptedDate": { - "$gt": { - "$date": { - "$numberLong": "0" - } - } - } - }, - "update": { - "$set": { - "encryptedDate": { - "$date": { - "$numberLong": "2" - } - } - } - }, - "returnDocument": "Before" - }, - "result": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDate": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDate": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default", - "query": { - "encryptedDate": { - "$gt": { - "$binary": { - "base64": "DXUFAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAAJbW4AAAAAAAAAAAAJbXgAyAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "update": { - "$set": { - "encryptedDate": { - "$$type": "binData" - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "findAndModify" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDate": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDate": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "hyDcE6QQjPrYJaIS/n7evEZFYcm31Tj89CpEYGF45cI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "F08nMDWDZc+DbWM7XCEJNNCEYyinRmrvGP7EWhmp4is=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cXH4688amcDc8kZOJq4UP8cE3R58Zl7e+Qo/1jyspps=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uURBxvTp3FBCVkd+LPqyuY7d6rMW6SGIJQEPY/wtkZI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jG3hax1L3RBp9t38vUt53FsBxgr/+Si/vVISpAylYpE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kwtIW8MhH9Ky5xNjBx8gFA/SHh2YVphie7g5FGBzals=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FHflwFuEMu4xX0ZApHi+pdlBH+oevAtXckCUb5Wv0xU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ty4cnzJdAlbQKnh7px3GEYjBnvO+jIOaKjoTRDtmh3M=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-InsertFind.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-InsertFind.json deleted file mode 100644 index a011c388e46..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-InsertFind.json +++ /dev/null @@ -1,499 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Date. Insert and Find.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDate": { - "$gt": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDate": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDate": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "encryptedDate": { - "$gt": { - "$binary": { - "base64": "DXUFAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAAJbW4AAAAAAAAAAAAJbXgAyAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDate": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDate": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FA74j21GUEJb1DJBOpR9nVnjaDZnd8yAQNuaW9Qi26g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kJv//KVkbrobIBf+QeWC5jxn20mx/P0R1N6aCSMgKM8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zB+Whi9IUUGxfLEe+lGuIzLX4LFbIhaIAm5lRk65QTc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ybO1QU3CgvhO8JgRXH+HxKszWcpl5aGDYYVa75fHa1g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X3Y3eSAbbMg//JgiHHiFpYOpV61t8kkDexI+CQyitH4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SlNHXyqVFGDPrX/2ppwog6l4pwj3PKda2TkZbqgfSfA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "McjV8xwTF3xI7863DYOBdyvIv6UpzThl6v9vBRk05bI=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-Update.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-Update.json deleted file mode 100644 index 6bab6499f55..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Date-Update.json +++ /dev/null @@ -1,516 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Date. Update.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDate": { - "$date": { - "$numberLong": "0" - } - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDate": { - "$date": { - "$numberLong": "1" - } - } - } - } - }, - { - "name": "updateOne", - "arguments": { - "filter": { - "encryptedDate": { - "$gt": { - "$date": { - "$numberLong": "0" - } - } - } - }, - "update": { - "$set": { - "encryptedDate": { - "$date": { - "$numberLong": "2" - } - } - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDate": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDate": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command_name": "update", - "command": { - "update": "default", - "ordered": true, - "updates": [ - { - "q": { - "encryptedDate": { - "$gt": { - "$binary": { - "base64": "DXUFAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAAJbW4AAAAAAAAAAAAJbXgAyAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "u": { - "$set": { - "encryptedDate": { - "$$type": "binData" - } - } - } - } - ], - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDate", - "bsonType": "date", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$date": { - "$numberLong": "0" - } - }, - "max": { - "$date": { - "$numberLong": "200" - } - } - } - } - ] - } - } - }, - "$db": "default" - } - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDate": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDate": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "hyDcE6QQjPrYJaIS/n7evEZFYcm31Tj89CpEYGF45cI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "F08nMDWDZc+DbWM7XCEJNNCEYyinRmrvGP7EWhmp4is=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cXH4688amcDc8kZOJq4UP8cE3R58Zl7e+Qo/1jyspps=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uURBxvTp3FBCVkd+LPqyuY7d6rMW6SGIJQEPY/wtkZI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jG3hax1L3RBp9t38vUt53FsBxgr/+Si/vVISpAylYpE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kwtIW8MhH9Ky5xNjBx8gFA/SHh2YVphie7g5FGBzals=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FHflwFuEMu4xX0ZApHi+pdlBH+oevAtXckCUb5Wv0xU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ty4cnzJdAlbQKnh7px3GEYjBnvO+jIOaKjoTRDtmh3M=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-Aggregate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-Aggregate.json deleted file mode 100644 index d1a82c21644..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-Aggregate.json +++ /dev/null @@ -1,1902 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Decimal. Aggregate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$numberDecimal": "0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "default", - "pipeline": [ - { - "$match": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - } - } - ], - "cursor": {}, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "aggregate" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": { - "$numberInt": "0" - }, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "rbf3AeBEv4wWFAKknqDxRW5cLNkFvbIs6iJjc6LShQY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "n+XAuFnP8Dov9TnhGFxNx0K/MnVM9WbJ7RouEu0ndO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yRXojuVdn5GQtD97qYlaCL6cOLmZ7Cvcb3wFjkLUIdM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DuIkdRPITRs55I4SZmgomAHCIsDQmXRhW8+MOznkzSk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SsBk+Et1lTbU+QRPx+xyJ/jMkmfG+QCvQEpip2YYrzA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "crCIzOd8KhHvvUlX7M1v9bhvU4pLdTc+X2SuqoKU5Ek=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YOWdCw4UrqnxkAaVjqmC4sKQDMVMHEpFGnlxpxdaU6E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "M3SShp81Ff8tQ632qKbv9MUcN6wjDaBReI0VXNu6Xh4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gzHlSPxpM0hT75kQvWFzGlOxKvDoiKQZOr19V6l2zXI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s3JnppOGYw9SL2Q1kMAZs948v2F5PrpXjGei/HioDWs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cG6+3Gk/zEH68P/uuuwiAUVCuyJwa1LeV+t29FlPPAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dupdvR3AyJtM+g9NDKiaLVOtGca387JQp8w+V03m7Ig=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JqEQc5svj2jTvZ6LLA5ivE+kTb/0aRemSEmxk4G7Zrg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "szcXXXKnob+p3SoM4yED2R920LeJ7cVsclPMFTe4CeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o1QoGVXmuBdHwHm7aCtGMlMVKrjFdYvJXpoq6uhIAZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Jfm5wPlqqLCJRGQIqRq2NGmpn7s0Vrih2H3YAOoI2YU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zMHLb8ARbsYo8Ld05bqnGFf1Usha6EGb8QKwdSAyps0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yQdtq9lh5pugL7/i0Bj/PuZUUBUIzf+7wj1rl5y736w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wGWVZdO7qIuyDg/BqDgqjgoQ02h5YYgwXQB1oCin2NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "by9HMLj6NTEpgztZ5HSN6GxImkXPcaFINYDzgZY33X8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tWo0vbasi7bXmn/MsOx13VC1IsWtpx/nYp0uj4iMzdA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tQQpndUYd5O87lOtrGjH3wl9VsOK0ray7RMasL90sBM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cQjXEDCMsOpKLLf+vlTgIHA+cbSJdzqhbSX9Wvh95aA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7yMpU48IxK9SzP2cx3VnTownGEwFmeFofuuFT97SuuY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kSOx1kz0CmBgzKQHZlo65ZUY1DIv9A99JRm+Us2y6Ew=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ubQpdPBe6/xvtr+AcXdfYLSvYCR4ot0tivehkCsupb4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xal+iCJ6FTefRQToyoNksc9NCZShyn04NDGi4IYrcoM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "d7jU4iOK50xHxlkSifcxlZFCM46TSgQzoYivxG3HNLY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJvl2nsBLBVzL3pp6sKWCL4UXeh3q/roYBJjSb74ve0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OIUCaKRvIx9t1w6Hxlz1IcQTdPNCfdRNwnnTm10W+X0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A9tvzsiElotOUVIB4CqfQp9mAwqvTM35YkmAR170aHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lI8gpK7hpb7c9x4RQugsxMnQay5LZJmwslZdvMx/dcE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dNCzh40U0XvdKnSDi3HRQOWQftEsDVqc4uUvsVFGoq8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IP+iwEBWBwVVZIdpaMu8k5+soFCz+TZkYn3drKZ9grE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnqyh6e0y5svHkJDShlN9CHV0WvMBE4QbtJpQw5ZCXc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "elEl42tbVDoRTLjAhZUFEtXiut4b3PVhg/1ZLZSQdtE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vHuu2FxwclMHqyE6JBYbTYgbEkB0dqb/JuaxsvfwsmY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xTf7NCe3Gf8QpE78HR5OknlLTKfs9J+RN9UZpH6fnso=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XiWSasRnJAulGR6+LCVD3mwRObXylqYWR9jvpywq12c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MZMxEQ5ikx0PG1YFIExv0UnTZogsvgeOEZTpzvBDn4w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yZMyMZBDrWbAhvnic7vvIYhmO9m5H2iuv0c8KNZrBzY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xxM14hTPY5j0vvcK2C7YAEjzdsfUTFHozHC0hEo1bxI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+01rqR1xVwkpGXcstbk1ItJqFVjH6Q8MGxEN3Cm9Y1A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xOpLV0Z2VTRJ3iWtnWZcsyjXubTIkYWo31cO+HV1o1k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BWUOLqgLBqc5NwxVlSV5H3KFQPXbCp7mdo+jF+8cJqY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fuQb1S6xZDGlrEbK+kI23aL53PP1PVNwqICnZNt9Yzg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfscnoibFttahLdPVC4Ee+47ewGFKpDSU7M6HX19bKE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rpSW2awybNVeKtat91VFxqbINoTfNhPfQAu+d73Xtf8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9M/CP9ccOIIj2LLFmE0GFDO0Ban2wsNalEXfM6+h+1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WrEMG49l1ye4MhXs5ZS9tz8P6h+hDvthIg/2wW9ne1Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ImNhbfeyfH8qIEeA5ic0s3dAQBdzzTBS+CPsNih9vZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dWP33YDSn04UKJN2ogh2Rui0iW/0q2y18OCDRVcfyoo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lYv0isAtfGh6H9tdp3cp2eHU7q2J+uk7QrgcxtK3w7Y=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VGMoamB/+7zTOYcY/pqJc96xlv2PdW4hwsIAEIslTDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yNeBWMF7BnD9wVwz2PgJsvWr77QiVvvWUvJF0+fqBug=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfpvObJ+tJBXSvqeN7vlOfmhYign635lciYAJIjUtY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dsen4NqjzVGjpjufiTMs3+gqeD09EbnuogPgxrJECwg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pxCWVM3sn19NsFEpgHbgLa+PmYlhN3mMiP0Wk8kJhYw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q11KNvJszjYIB9n9HcC+N4uz11a3eRj1L3BH9scKMDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A1PmkgcEToWh1JiVWE6mI5jUu7poxWWuCUt/cgRUUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qJo3Hu4PJeanL7XEaWXO/n3YsodhZyd+MJOOmB9Kpd8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BkBKLO8URFscfRY9Bav/1+L9mLohDgNr/MkZtGiraIs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rZq5WA3Hx3xthOyHAJXK//f8pE2qbz7YKu3TIMp9GFY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X07a/Lm80p5xd4RFs1dNmw+90tmPDPdGiAKVZkxd4zY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6YrBn2ofIw1b5ooakrLOwF41BWrps8OO0H9WH4/rtlE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0l86Ag5OszXpa78SlOUV3K9nff5iC1p0mRXtLg9M1s4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Hn6yuxFHodeyu7ISlhYrbSf9pTiH4TDEvbYLWjTwFO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zdf4y2etKBuIpkEU1zMwoCkCsdisfXZCh8QPamm+drY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rOQ9oMdiK5xxGH+jPzOvwVqdGGnF3+HkJXxn81s6hp4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "61aKKsE3+BJHHWYvs3xSIBvlRmKswmaOo5rygQJguUg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KuDb/GIzqDM8wv7m7m8AECiWJbae5EKKtJRugZx7kR0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Q+t8t2TmNUiCIorVr9F3AlVnX+Mpt2ZYvN+s8UGict8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJRZIpKxUgHyL83kW8cvfjkxN3z6WoNnUg+SQw+LK+k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnUsYjip8SvW0+m9mR5WWTkpK+p6uwJ6yBUAlBnFKMk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PArHlz+yPRYDycAP/PgnI/AkP8Wgmfg++Vf4UG1Bf0E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wnIh53Q3jeK8jEBe1n8kJLa89/H0BxO26ZU8SRIAs9Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4F8U59gzBLGhq58PEWQk2nch+R0Va7eTUoxMneReUIA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ihKagIW3uT1dm22ROr/g5QaCpxZVj2+Fs/YSdM2Noco=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EJtUOOwjkrPUi9mavYAi+Gom9Y2DuFll7aDwo4mq0M0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dIkr8dbaVRQFskAVT6B286BbcBBt1pZPEOcTZqk4ZcI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aYVAcZYkH/Tieoa1XOjE/zCy5AJcVTHjS0NG2QB7muA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sBidL6y8TenseetpioIAAtn0lK/7C8MoW4JXpVYi3z8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0Dd2klU/t4R86c2WJcJDAd57k/N7OjvYSO5Vf8KH8sw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I3jZ92WEVmZmgaIkLbuWhBxl7EM6bEjiEttgBJunArA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aGHoQMlgJoGvArjfIbc3nnkoc8SWBxcrN7hSmjMRzos=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "bpiWPnF/KVBQr5F6MEwc5ZZayzIRvQOLDAm4ntwOi8g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tI7QVKbE6avWgDD9h4QKyFlnTxFCwd2iLySKakxNR/I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XGsge0CnoaXgE3rcpKm8AEeku5QVfokS3kcI+JKV1lk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JQxlryW2Q5WOwfrjAnaZxDvC83Dg6sjRVP5zegf2WiM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YFuHKJOfoqp1iGVxoFjx7bLYgVdsN4GuUFxEgO9HJ5s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Z6vUdiCR18ylKomf08uxcQHeRtmyav7/Ecvzz4av3k4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SPGo1Ib5AiP/tSllL7Z5PAypvnKdwJLzt8imfIMSEJQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "m94Nh6PFFQFLIib9Cu5LAKavhXnagSHG6F5EF8lD96I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pfEkQI98mB+gm1+JbmVurPAODMFPJ4E8DnqfVyUWbSo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DNj3OVRLbr43s0vd+rgWghOL3FqeO/60npdojC8Ry/M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kAYIQrjHVu49W8FTxyxJeiLVRWWjC9fPcBn+Hx1F+Ss=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aCSO7UVOpoQvu/iridarxkxV1SVxU1i9HVSYXUAeXk4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Gh6hTP/yj1IKlXQ+Q69KTfMlGZjEcXoRLGbQHNFo/1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/gDgIFQ4tAlJk3GN48IS5Qa5IPmErwGk8CHxAbp6gs0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PICyimwPjxpusyKxNssOOwUotAUbygpyEtORsVGXT8g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4lu+cBHyAUvuxC6JUNyHLzHsCogGSWFFnUCkDwfQdgI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pSndkmoNUJwXjgkbkgOrT5f9nSvuoMEZOkwAN9ElRaE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tyW+D4i26QihNM5MuBM+wnt5AdWGSJaJ4X5ydc9iWTU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9Syjr8RoxUgPKr+O5rsCu07AvcebA4P8IVKyS1NVLWc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "67tPfDYnK2tmrioI51fOBG0ygajcV0pLo5+Zm/rEW7U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "y0EiPRxYTuS1eVTIaPQUQBBxwkyxNckbePvKgChwd0M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NWd+2veAaeXQgR3vCvzlI4R1WW67D5YsVLdoXfdb8qg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PY5RQqKQsL2GqBBSPNOEVpojNFRX/NijCghIpxD6CZk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lcvwTyEjFlssCJtdjRpdN6oY+C7bxZY+WA+QAqzj9zg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWE7XRNylvTwO/9Fv56dNqUaQWMmESNS/GNIwgBaEI0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ijwlrUeS8nRYqK1F8kiCYF0mNDolEZS+/lJO1Lg93C8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8KzV+qYGYuIjoNj8eEpnTuHrMYuhzphl80rS6wrODuU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wDyTLjSEFF895hSQsHvmoEQVS6KIkZOtq1c9dVogm9I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SGrtPuMYCjUrfKF0Pq/thdaQzmGBMUvlwN3ORIu9tHU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KySHON3hIoUk4xWcwTqk6IL0kgjzjxgMBObVIkCGvk4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hBIdS9j0XJPeT4ot73ngELkpUoSixvRBvdOL9z48jY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Tx6um0q9HjS5ZvlFhvukpI6ORnyrXMWVW1OoxvgqII0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zFKlyfX5H81+d4A4J3FKn4T5JfG+OWtR06ddyX4Mxas=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cGgCDuPV7MeMMYEDpgOupqyNP4BQ4H7rBnd2QygumgM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IPaUoy98v11EoglTpJ4kBlEawoZ8y7BPwzjLYBpkvHQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Pfo4Am6tOWAyZNn8G9W5HWWGC3ZWmX0igI/RRB870Ro=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fnTSjd7bC1Udoq6iM7UDnHAC/lsIXSHp/Gy332qw+/I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fApBgVRrTDyEumkeWs5p3ag9KB48SbU4Si0dl7Ns9rc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QxudfBItgoCnUj5NXVnSmWH3HK76YtKkMmzn4lyyUYY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sSOvwhKa29Wq94bZ5jGIiJQGbG1uBrKSBfOYBz/oZeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FdaMgwwJ0NKsqmPZLC5oE+/0D74Dfpvig3LaI5yW5Fs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sRWBy12IERN43BSZIrnBfC9+zFBUdvjTlkqIH81NGt4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/4tIRpxKhoOwnXAiFn1Z7Xmric4USOIfKvTYQXk3QTc=", - "subType": "00" - } - } - ] - }, - { - "_id": { - "$numberInt": "1" - }, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RGTjNVEsNJb+DG7DpPOam8rQWD5HZAMpRyiTQaw7tk8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I93Md7QNPGmEEGYU1+VVCqBPBEvXdqHPtTJtMOn06Yk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "GecBFQ1PemlECWZWCl7f74vmsL6eB6mzQ9n6tK6FYfs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QpjhZl+O1ORifgtCZuWAdcP6OKL7IZ2cA46v8FJcV28=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RlQWwhU+uVv0a+9IB5cUkEfvHBvOw3B1Sx6WfPWMqes=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ubb81XTC7U+4tcNzf1oYvOY6gR5hC2Izqx54f4GuJ0E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6M4Q5NMQ9TqNnjzGOxIkiUIY8TEL0I3XD1QnhefQUqU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BtInzk9t2FFMCEY6AQ7zN8jwrrZEs2irSv6q0Q4NaIw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6vxXfETu9cuBIpRBo3jUUU04mJIH/aAhLX8K6VI5Xv0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wXPCdS+q23zi1bkPnaVG2j0PsVtxdeSLJ//h6J1x8RU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KY3KkfBAsN2l80wbpj41G0gwBR5KmmFnZcagg7D3ENk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tI8NFAxXCX4VOnY5X73K6KI/Yspd3aR94KV39MhJlAw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "nFxH0UC3mATKA6Vboz+QX/hAjj19kF/SH6H5Cne7qC0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q8hYqIYaIi7nOdG/7qQZYnz8Bsacfi66M1nVku4SH08=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4saA92R4arp4anvD9xFtze+sNcQqTEhPHyl1h70A8NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DbIziOBRRyeQS6RtBR09E37LV+CTKrEjGoRMLSpG6eE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Fv80Plp/7w2gnVqrwawLd6qhJ10G4NCDm3re67cNq4Y=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "T/T2oiQCBBES4YN7EodzPRdabZSFlYIClHBym+bQUZE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ZQgHD3l46Ujqtbnj1VbbeM29C9wJzOhz+yZ/7XdSrxk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ltlFKzWvyZvHxDFOYDd/XXJ6kUiJj0ln2HTCEz2o4Z4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "flW8A7bltC1u8bzx0WJtxosGJdOVsJFfbx33jxnpFGg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SXO+92QbMKwUSG2t27ciunV1c3VvFkUuDmSczpRe008=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+KioGs1GM+xRBzFE67ePTWj04KMSE5/Y6qUF7nJ5kvU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L3xNVbh6YH+RzqABN+5Jgb7T234Efpn766DmUvxIxgg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hPF+60mBYPjh21dEmPlBhKgyc9S2qLtTkypYvnqP2Fc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EletRsETy2HcjaPIm2c8CkT7ch/P3pJJDC8hasepcSU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "r5bMXUaNKqLPxZ+TG9HYTG4aSDgcpim27rN8rQFkM0w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0Q7Erdr8+/S0wUEDDIqlS5XjBVWvhZY65K0uUDb6+Ns=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xEcnhXy35hbXNVBPOOt3TUHbxvKfQ48KjA9b6/rbMqQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "T8bEpiQNgsEudXvyKE9SZlSvbpV/LUaslsdqgSFltyo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hIoiaF2YjnxDbODfhFEB+JGZ5nf8suD3Shck5bwQ3N0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qnA6qzejeRJ0rsZaZ0zOvKAaXyxt5lpscKQNYFZNl4k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "anAKCL2DN/le2VaP0n2ucYSEH/DaaEH/8Sa4OqTZsRA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JCZlBJaFm618oWYSnT9Jr1MtwFVw4BZjOzO+5yWgR90=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yxyk4n9762WzcDVGnTn4jCqUnSMIVCrLDIjCX1QVj34=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fDI6fdKvDJwim5/CQwWZEzcrXE3LHgy7FTtffcC7tXE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Vex+gcz5T+WkzsVZQrkqUR2ryyZbnaOGuWpYvjN0zCw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8TLEXz+Gbbp6llHpZXVjLsdlYY9f6hrKpHVpyfDe0RY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7fTyt5BrunypS65TfOzFW2E2qdIuT4SLeDeGlbQoJCs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8fKGrkqN0/KuSjyXgDBmRauDKrSa//JBKRWHEB9xBf4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s4codmG7uN4ss6P357jL21lazEe90M9GOK5WrOknSV0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RkSpua8XF+NUdxVDU90EbLUTTyZFX3tt3atBTroFaRk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "LnTCuCDyAHK5B9KXzjtwGmWB+qergQk2OCjnIx9MI2A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cBFh0virAX4pVXf/udIGI2951i0+0aZAdJcBVGtYnT4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "G54X6myQXWZ5fw/G31en3QbdgfXzL9+hFTtJpnWMqDI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EdsiiuezcsFJFnYIyGjCOhnqMj1BOwTB5EFxN+ERUkg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dVH9MXLtk0WTwGQ3xmrhOqfropMUkDW3o6paNPGl3NU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sB3HqXKWY3pKbuEH8BTbfNIGfbY+7/ZbOc3XC+JRNNI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WHyDk62Xhqbo4/iie2aLIM4x2uuAjv6102dJSHI58oM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pNUFuHpeNRDUZ/NrtII2c6sNc9eGR1lIUlIyXKERA+0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UPa+pdCqnN0bfAptdzldQOSd01gidrDKy8KhWrpSKAI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "l+7dOAlo+HUffMqFYXL6pgUFeTbwOM9CjKQLxEoLtc4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SRnDXV/rN6C8xwMutv9E1luv3DOUio3VkgPr8Cpm7Ew=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QcH6gl+gX7xZ7OWhUNQMbndJy0Piz49pDo6RsnLkVSA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "t+uL4DnfsI/Zll/KXWW1cOKX3Hu8WIkm3pt9efCVSAQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "myutHDctku/+Uug/nD8gRbYvmx/IovtoAAC2/fz2oHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6C+cjD0e0nSCP6cPqQYbNG7SlOd6Mfvi8hyfm7Ng+D8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zg01JSoOj9oBKT0S1ldJucXzY5AKgreS+h2xJreWTOs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7qQ80/FjodHl1m1py/Oii0/9C/xWbLdhaRXQ+kkCP10=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YwWMNH07vL6c5Nhg+MRnVByhzUunu8y0VLM9z/XvR5U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Dle8bU98+fudAbc14SToZFkwvV3tcYVsjDug0NWljpc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "J+eKL1vPJmlzltvhI6Li5Fz/TJmi3Ng+ehRTcs46API=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zB3XzfFygLwC3WHkj0up+VbEd25KKoce1vOpG/5bwK4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vnVnmOnL+z2pqwE+A6cVKS0Iwy4F4/2IiElJca9bUQM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+lG5r/Fpqry3BtFuvY67+RntmHAMDoLVOSGc6ZoXPb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L5MXQertqc6uj7ADe8aWKbd1sYHPCE7P1VYVg9Zc3VI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "imKONuZgopt0bhM3GMX2WVPwQYMTobuUUEdhcLfHs4c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "eOkU1J1uVbiVFWBerbXsSIVcF2nqiicTkFy4x7kFHB8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gI0uDhXeoH/UatDQKEf4qo8FHzWZDhb/wuWTqbq/ID4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cOkd5Aa3btYhtojE/smsF/PJnULqQ4NNqTkU6KXTFmo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "AWNJMs1MTe294oFipp8Y6P0CjpkZ4qCZoClQF3XcHq8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6gJtlzXOFhGYrVbTuRMmvMlDTwXdNtR9aGBlHZPwIMw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "LEmwVGA/xsEG7UrcOoYLFu6KCXgijzFznenknuDacm8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "mIRFPTXRrGaPtp/Ydij2jgkRe4uoUvAKxW2d8b9zYL0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "B+Uv2u48WALOO0L311z+eryjYQzKJVMfdHMZPhOAFmY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "INXXp0wDyVCq+NtfIrrC2ciETmyW/dWB/48/u4yLEZ4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "se7DGo8XrlrQDLEcco1tZrQt9kDe+0RTyl2bw/quG4w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vr0m2+Zk9lbN6UgWCyn8xJWJOokU3IDYab5U5q1+CgQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XI+eJ8Gy2JktG1gICgoj1qpsfy1tKmH0kglWbaQH6DA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A+UCuNnuAUqnQzspA6TVqUPRmtZmpSex5HFw7THRxs0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xaH2Ehfljd19uo0Fvb3iwkdaiWEVQd2YPoitgEPkhSM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "S/iZBJGcc8+qZxyMtab65MMBoSglybwk3x58Nb86gnY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "w14ZE5qqY5YgkS4Zcs9YNbrQbY1XfGOOHNn9bOYnFVQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0MhGd/jEF1vjkKGp+ZMn9SjLK54jkp9W4Hg+Sp/oxaI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "92QZ73e/NRTYgCm4aifaKth6aAsKnLLccBc0zx/qUTY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WOjzemCgFJOiGIp81RSVh/tFlzSTj9eFWcBnsiv2Ycs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DrsP9CmfKPjw5yLL8bnSeAxfNzAwlb+Z8OqCiKgBY7o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lMogqg8veBv6mri3/drMe9afJiKMvevkmGcw9BedfLo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "TxqwNcY8Tg2MPpNdkPBwvfpuTttSYRHU26DGECKYQ9o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "l0u1b4b4vYACWIwfnB7PZac4oDEgjQZCzHruNPTgAIY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "iVSGQ+cCfhbWIrY/v/WBORK92elu9gfRKyGhr6r/k00=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yK1forG50diEXte8ECzjfpHeYsPyuQ/dgxbxn/nzY5k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gIfTLCD3VwnOwkC0zPXWTqaITxX6ZplA69PO2a6zolc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "O/Zxlgh3WqpzJ7+Sd8XWMVID4/GXJUUWaSqfgDUi3b0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ZQ6yv368zwahUqSUYH/StL0Qgz/TwS1CzlMjVDvCciI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "m2rPEYkjwyiKdonMrKlcF7hya4lFOAUwEePJ3SgrNx8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Mq0yl5iVKlq71bT/dT/fXOWf2n90bTnXFnOdGDN0JOc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6qDGMXipPLC2O6EAAMjO2F9xx4rdqZso4IkPpH2304U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jvQHRQQa2RIszE2LX2Hv2LbRhYawJ6qmtRt8HZzFQXg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ovJXQrkZlpeHRciKyE/WWNm5O389gRgzx1W+Dw596X4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "a4kgRNvYctGYqyQv9qScL/WkljTYVylJ9pE9KDULlxU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qV4Q48vPiCJMTjljotzYKI/zfExWpkKOSHGcAjGyDig=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jtI7zbBF+QW/aYYTkn90zzyHLXLgmy7l1bzgMb2oqic=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q0KmJl9txPdn962UNvnfe6UFhdk9YaFZuTm33F+csso=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ULNdEqeZJgtmNOhN/Y9INzsE9AnxWYwOMn+pIbRXIFs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "R4oz9+wkdjpKe5tE1jpG7IURAnfvS5fLP4LrD5cZfTE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qG5Z7VhwSu/HT/YFTgDzyAAzJKq51xPw2HeEV5btYC4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OM/1DmIIZ5Qyhtq8TGkHTBEMVKjAnKRZMRXYtTG8ctc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2R5vZbljLXnDFA99YfGuRB7pAdPJVKsT25zLNMC0fUk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OMbavF2EmdAz1fHkLV3ctFEUDfriKhoT2gidwHZ9z1o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MWT4Zrw3/vVvTYMa1Is5Pjr3wEwnBfnEAPPUAHKQhNU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tBkRPfG9yxfKocQx5pAJX0oEHKPL0Tgtr+0UYe09InE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lqxpnDR/H0YgH7RcfKoNoaaRhe1SIazIeMbQ1fu9y3Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "utT1UdR22PWOTrOkZauztX613lAplV4eh/ejTRb7ZSk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "S+Y2yFyKi/a6FXhih4yGo29X8I8OT6/zwEoX6NMKT4o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QSjVppg29x6oS5yBg8OFjrFt0tuTpWCuKxfIy0k8YnE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "y3r6/Xsfvsl3HksXlVYkJgHUqpQGfICxg3x9f8Zw1qM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BSltHzEwDjFN4du9rDHAPvl22atlcTioEtt+gC5L1tk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0arGXjSN0006UnXbrWsGqhvBair569DeFDUME3Df3rA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s/DumaMad08S+PBUUcrS+v42K0z8HgcdiQtrFAEu2Qs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EzJ8Y8N0OQBTlnvrK82PdevDNZZO4E6CNgYVu8Cj6Ks=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VA4vr8jBPI5QdiPrULzzZjBMIUbG3V7Slg5zm0bFcKc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YAOvEB2ZLtq9LQiFViBHWaxxWVVonC2rNYj9tN9s3L0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hgaHMo9aAGS+nBwvqnTjZO+YkiQPY1c1XcIYeaYKHyI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YvaoLt3ZpH0atB0tNzwMjpoxRYJXl0DqSjisMJiGVBE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EMmW6CptFsiLoPOi5/uAJQ2FmeLg6mCpuVLLrRWk7Mc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1jQsNMarSnarlYmXEuoFokeBMg/090qUD9wqo1Zn8Gs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hupXNKhRpJxpyDAAP1TgJ5JMZh9lhbMk6s7D7dMS3C8=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-Correctness.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-Correctness.json deleted file mode 100644 index 4316a31c3e3..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-Correctness.json +++ /dev/null @@ -1,1158 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Find with $gt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$numberDecimal": "0.0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$gte": { - "$numberDecimal": "0.0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - }, - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$numberDecimal": "1.0" - } - } - } - }, - "result": [] - } - ] - }, - { - "description": "Find with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$lt": { - "$numberDecimal": "1.0" - } - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - ] - } - ] - }, - { - "description": "Find with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$lte": { - "$numberDecimal": "1.0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - }, - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$numberDecimal": "0.0" - }, - "$lt": { - "$numberDecimal": "2.0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - ] - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$in": [ - { - "$numberDecimal": "0.0" - } - ] - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalNoPrecision": { - "$gte": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - }, - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$numberDecimal": "1.0" - } - } - } - } - ] - }, - "result": [] - } - ] - }, - { - "description": "Aggregate with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalNoPrecision": { - "$lt": { - "$numberDecimal": "1.0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalNoPrecision": { - "$lte": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - }, - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$numberDecimal": "0.0" - }, - "$lt": { - "$numberDecimal": "2.0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - ] - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalNoPrecision": { - "$in": [ - { - "$numberDecimal": "0.0" - } - ] - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0.0" - } - } - ] - } - ] - }, - { - "description": "Wrong type: Insert Int", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberInt": "0" - } - } - }, - "result": { - "errorContains": "cannot encrypt element" - } - } - ] - }, - { - "description": "Wrong type: Find Int", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$gte": { - "$numberInt": "0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": { - "errorContains": "field type is not supported" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-Delete.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-Delete.json deleted file mode 100644 index 19cae3c64fa..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-Delete.json +++ /dev/null @@ -1,1116 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Decimal. Delete.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1" - } - } - } - }, - { - "name": "deleteOne", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$numberDecimal": "0" - } - } - } - }, - "result": { - "deletedCount": 1 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "delete": "default", - "deletes": [ - { - "q": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "limit": 1 - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "delete" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": { - "$numberInt": "0" - }, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "rbf3AeBEv4wWFAKknqDxRW5cLNkFvbIs6iJjc6LShQY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "n+XAuFnP8Dov9TnhGFxNx0K/MnVM9WbJ7RouEu0ndO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yRXojuVdn5GQtD97qYlaCL6cOLmZ7Cvcb3wFjkLUIdM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DuIkdRPITRs55I4SZmgomAHCIsDQmXRhW8+MOznkzSk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SsBk+Et1lTbU+QRPx+xyJ/jMkmfG+QCvQEpip2YYrzA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "crCIzOd8KhHvvUlX7M1v9bhvU4pLdTc+X2SuqoKU5Ek=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YOWdCw4UrqnxkAaVjqmC4sKQDMVMHEpFGnlxpxdaU6E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "M3SShp81Ff8tQ632qKbv9MUcN6wjDaBReI0VXNu6Xh4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gzHlSPxpM0hT75kQvWFzGlOxKvDoiKQZOr19V6l2zXI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s3JnppOGYw9SL2Q1kMAZs948v2F5PrpXjGei/HioDWs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cG6+3Gk/zEH68P/uuuwiAUVCuyJwa1LeV+t29FlPPAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dupdvR3AyJtM+g9NDKiaLVOtGca387JQp8w+V03m7Ig=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JqEQc5svj2jTvZ6LLA5ivE+kTb/0aRemSEmxk4G7Zrg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "szcXXXKnob+p3SoM4yED2R920LeJ7cVsclPMFTe4CeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o1QoGVXmuBdHwHm7aCtGMlMVKrjFdYvJXpoq6uhIAZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Jfm5wPlqqLCJRGQIqRq2NGmpn7s0Vrih2H3YAOoI2YU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zMHLb8ARbsYo8Ld05bqnGFf1Usha6EGb8QKwdSAyps0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yQdtq9lh5pugL7/i0Bj/PuZUUBUIzf+7wj1rl5y736w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wGWVZdO7qIuyDg/BqDgqjgoQ02h5YYgwXQB1oCin2NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "by9HMLj6NTEpgztZ5HSN6GxImkXPcaFINYDzgZY33X8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tWo0vbasi7bXmn/MsOx13VC1IsWtpx/nYp0uj4iMzdA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tQQpndUYd5O87lOtrGjH3wl9VsOK0ray7RMasL90sBM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cQjXEDCMsOpKLLf+vlTgIHA+cbSJdzqhbSX9Wvh95aA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7yMpU48IxK9SzP2cx3VnTownGEwFmeFofuuFT97SuuY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kSOx1kz0CmBgzKQHZlo65ZUY1DIv9A99JRm+Us2y6Ew=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ubQpdPBe6/xvtr+AcXdfYLSvYCR4ot0tivehkCsupb4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xal+iCJ6FTefRQToyoNksc9NCZShyn04NDGi4IYrcoM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "d7jU4iOK50xHxlkSifcxlZFCM46TSgQzoYivxG3HNLY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJvl2nsBLBVzL3pp6sKWCL4UXeh3q/roYBJjSb74ve0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OIUCaKRvIx9t1w6Hxlz1IcQTdPNCfdRNwnnTm10W+X0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A9tvzsiElotOUVIB4CqfQp9mAwqvTM35YkmAR170aHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lI8gpK7hpb7c9x4RQugsxMnQay5LZJmwslZdvMx/dcE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dNCzh40U0XvdKnSDi3HRQOWQftEsDVqc4uUvsVFGoq8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IP+iwEBWBwVVZIdpaMu8k5+soFCz+TZkYn3drKZ9grE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnqyh6e0y5svHkJDShlN9CHV0WvMBE4QbtJpQw5ZCXc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "elEl42tbVDoRTLjAhZUFEtXiut4b3PVhg/1ZLZSQdtE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vHuu2FxwclMHqyE6JBYbTYgbEkB0dqb/JuaxsvfwsmY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xTf7NCe3Gf8QpE78HR5OknlLTKfs9J+RN9UZpH6fnso=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XiWSasRnJAulGR6+LCVD3mwRObXylqYWR9jvpywq12c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MZMxEQ5ikx0PG1YFIExv0UnTZogsvgeOEZTpzvBDn4w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yZMyMZBDrWbAhvnic7vvIYhmO9m5H2iuv0c8KNZrBzY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xxM14hTPY5j0vvcK2C7YAEjzdsfUTFHozHC0hEo1bxI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+01rqR1xVwkpGXcstbk1ItJqFVjH6Q8MGxEN3Cm9Y1A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xOpLV0Z2VTRJ3iWtnWZcsyjXubTIkYWo31cO+HV1o1k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BWUOLqgLBqc5NwxVlSV5H3KFQPXbCp7mdo+jF+8cJqY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fuQb1S6xZDGlrEbK+kI23aL53PP1PVNwqICnZNt9Yzg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfscnoibFttahLdPVC4Ee+47ewGFKpDSU7M6HX19bKE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rpSW2awybNVeKtat91VFxqbINoTfNhPfQAu+d73Xtf8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9M/CP9ccOIIj2LLFmE0GFDO0Ban2wsNalEXfM6+h+1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WrEMG49l1ye4MhXs5ZS9tz8P6h+hDvthIg/2wW9ne1Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ImNhbfeyfH8qIEeA5ic0s3dAQBdzzTBS+CPsNih9vZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dWP33YDSn04UKJN2ogh2Rui0iW/0q2y18OCDRVcfyoo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lYv0isAtfGh6H9tdp3cp2eHU7q2J+uk7QrgcxtK3w7Y=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VGMoamB/+7zTOYcY/pqJc96xlv2PdW4hwsIAEIslTDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yNeBWMF7BnD9wVwz2PgJsvWr77QiVvvWUvJF0+fqBug=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfpvObJ+tJBXSvqeN7vlOfmhYign635lciYAJIjUtY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dsen4NqjzVGjpjufiTMs3+gqeD09EbnuogPgxrJECwg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pxCWVM3sn19NsFEpgHbgLa+PmYlhN3mMiP0Wk8kJhYw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q11KNvJszjYIB9n9HcC+N4uz11a3eRj1L3BH9scKMDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A1PmkgcEToWh1JiVWE6mI5jUu7poxWWuCUt/cgRUUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qJo3Hu4PJeanL7XEaWXO/n3YsodhZyd+MJOOmB9Kpd8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BkBKLO8URFscfRY9Bav/1+L9mLohDgNr/MkZtGiraIs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rZq5WA3Hx3xthOyHAJXK//f8pE2qbz7YKu3TIMp9GFY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X07a/Lm80p5xd4RFs1dNmw+90tmPDPdGiAKVZkxd4zY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6YrBn2ofIw1b5ooakrLOwF41BWrps8OO0H9WH4/rtlE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0l86Ag5OszXpa78SlOUV3K9nff5iC1p0mRXtLg9M1s4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Hn6yuxFHodeyu7ISlhYrbSf9pTiH4TDEvbYLWjTwFO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zdf4y2etKBuIpkEU1zMwoCkCsdisfXZCh8QPamm+drY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rOQ9oMdiK5xxGH+jPzOvwVqdGGnF3+HkJXxn81s6hp4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "61aKKsE3+BJHHWYvs3xSIBvlRmKswmaOo5rygQJguUg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KuDb/GIzqDM8wv7m7m8AECiWJbae5EKKtJRugZx7kR0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Q+t8t2TmNUiCIorVr9F3AlVnX+Mpt2ZYvN+s8UGict8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJRZIpKxUgHyL83kW8cvfjkxN3z6WoNnUg+SQw+LK+k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnUsYjip8SvW0+m9mR5WWTkpK+p6uwJ6yBUAlBnFKMk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PArHlz+yPRYDycAP/PgnI/AkP8Wgmfg++Vf4UG1Bf0E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wnIh53Q3jeK8jEBe1n8kJLa89/H0BxO26ZU8SRIAs9Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4F8U59gzBLGhq58PEWQk2nch+R0Va7eTUoxMneReUIA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ihKagIW3uT1dm22ROr/g5QaCpxZVj2+Fs/YSdM2Noco=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EJtUOOwjkrPUi9mavYAi+Gom9Y2DuFll7aDwo4mq0M0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dIkr8dbaVRQFskAVT6B286BbcBBt1pZPEOcTZqk4ZcI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aYVAcZYkH/Tieoa1XOjE/zCy5AJcVTHjS0NG2QB7muA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sBidL6y8TenseetpioIAAtn0lK/7C8MoW4JXpVYi3z8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0Dd2klU/t4R86c2WJcJDAd57k/N7OjvYSO5Vf8KH8sw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I3jZ92WEVmZmgaIkLbuWhBxl7EM6bEjiEttgBJunArA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aGHoQMlgJoGvArjfIbc3nnkoc8SWBxcrN7hSmjMRzos=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "bpiWPnF/KVBQr5F6MEwc5ZZayzIRvQOLDAm4ntwOi8g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tI7QVKbE6avWgDD9h4QKyFlnTxFCwd2iLySKakxNR/I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XGsge0CnoaXgE3rcpKm8AEeku5QVfokS3kcI+JKV1lk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JQxlryW2Q5WOwfrjAnaZxDvC83Dg6sjRVP5zegf2WiM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YFuHKJOfoqp1iGVxoFjx7bLYgVdsN4GuUFxEgO9HJ5s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Z6vUdiCR18ylKomf08uxcQHeRtmyav7/Ecvzz4av3k4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SPGo1Ib5AiP/tSllL7Z5PAypvnKdwJLzt8imfIMSEJQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "m94Nh6PFFQFLIib9Cu5LAKavhXnagSHG6F5EF8lD96I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pfEkQI98mB+gm1+JbmVurPAODMFPJ4E8DnqfVyUWbSo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DNj3OVRLbr43s0vd+rgWghOL3FqeO/60npdojC8Ry/M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kAYIQrjHVu49W8FTxyxJeiLVRWWjC9fPcBn+Hx1F+Ss=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aCSO7UVOpoQvu/iridarxkxV1SVxU1i9HVSYXUAeXk4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Gh6hTP/yj1IKlXQ+Q69KTfMlGZjEcXoRLGbQHNFo/1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/gDgIFQ4tAlJk3GN48IS5Qa5IPmErwGk8CHxAbp6gs0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PICyimwPjxpusyKxNssOOwUotAUbygpyEtORsVGXT8g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4lu+cBHyAUvuxC6JUNyHLzHsCogGSWFFnUCkDwfQdgI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pSndkmoNUJwXjgkbkgOrT5f9nSvuoMEZOkwAN9ElRaE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tyW+D4i26QihNM5MuBM+wnt5AdWGSJaJ4X5ydc9iWTU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9Syjr8RoxUgPKr+O5rsCu07AvcebA4P8IVKyS1NVLWc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "67tPfDYnK2tmrioI51fOBG0ygajcV0pLo5+Zm/rEW7U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "y0EiPRxYTuS1eVTIaPQUQBBxwkyxNckbePvKgChwd0M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NWd+2veAaeXQgR3vCvzlI4R1WW67D5YsVLdoXfdb8qg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PY5RQqKQsL2GqBBSPNOEVpojNFRX/NijCghIpxD6CZk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lcvwTyEjFlssCJtdjRpdN6oY+C7bxZY+WA+QAqzj9zg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWE7XRNylvTwO/9Fv56dNqUaQWMmESNS/GNIwgBaEI0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ijwlrUeS8nRYqK1F8kiCYF0mNDolEZS+/lJO1Lg93C8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8KzV+qYGYuIjoNj8eEpnTuHrMYuhzphl80rS6wrODuU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wDyTLjSEFF895hSQsHvmoEQVS6KIkZOtq1c9dVogm9I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SGrtPuMYCjUrfKF0Pq/thdaQzmGBMUvlwN3ORIu9tHU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KySHON3hIoUk4xWcwTqk6IL0kgjzjxgMBObVIkCGvk4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hBIdS9j0XJPeT4ot73ngELkpUoSixvRBvdOL9z48jY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Tx6um0q9HjS5ZvlFhvukpI6ORnyrXMWVW1OoxvgqII0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zFKlyfX5H81+d4A4J3FKn4T5JfG+OWtR06ddyX4Mxas=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cGgCDuPV7MeMMYEDpgOupqyNP4BQ4H7rBnd2QygumgM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IPaUoy98v11EoglTpJ4kBlEawoZ8y7BPwzjLYBpkvHQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Pfo4Am6tOWAyZNn8G9W5HWWGC3ZWmX0igI/RRB870Ro=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fnTSjd7bC1Udoq6iM7UDnHAC/lsIXSHp/Gy332qw+/I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fApBgVRrTDyEumkeWs5p3ag9KB48SbU4Si0dl7Ns9rc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QxudfBItgoCnUj5NXVnSmWH3HK76YtKkMmzn4lyyUYY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sSOvwhKa29Wq94bZ5jGIiJQGbG1uBrKSBfOYBz/oZeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FdaMgwwJ0NKsqmPZLC5oE+/0D74Dfpvig3LaI5yW5Fs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sRWBy12IERN43BSZIrnBfC9+zFBUdvjTlkqIH81NGt4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/4tIRpxKhoOwnXAiFn1Z7Xmric4USOIfKvTYQXk3QTc=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-FindOneAndUpdate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-FindOneAndUpdate.json deleted file mode 100644 index 4ab3b63ea56..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-FindOneAndUpdate.json +++ /dev/null @@ -1,1906 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Decimal. FindOneAndUpdate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1" - } - } - } - }, - { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$numberDecimal": "0" - } - } - }, - "update": { - "$set": { - "encryptedDecimalNoPrecision": { - "$numberDecimal": "2" - } - } - }, - "returnDocument": "Before" - }, - "result": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default", - "query": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "update": { - "$set": { - "encryptedDecimalNoPrecision": { - "$$type": "binData" - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "findAndModify" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": { - "$numberInt": "0" - }, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "rbf3AeBEv4wWFAKknqDxRW5cLNkFvbIs6iJjc6LShQY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "n+XAuFnP8Dov9TnhGFxNx0K/MnVM9WbJ7RouEu0ndO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yRXojuVdn5GQtD97qYlaCL6cOLmZ7Cvcb3wFjkLUIdM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DuIkdRPITRs55I4SZmgomAHCIsDQmXRhW8+MOznkzSk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SsBk+Et1lTbU+QRPx+xyJ/jMkmfG+QCvQEpip2YYrzA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "crCIzOd8KhHvvUlX7M1v9bhvU4pLdTc+X2SuqoKU5Ek=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YOWdCw4UrqnxkAaVjqmC4sKQDMVMHEpFGnlxpxdaU6E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "M3SShp81Ff8tQ632qKbv9MUcN6wjDaBReI0VXNu6Xh4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gzHlSPxpM0hT75kQvWFzGlOxKvDoiKQZOr19V6l2zXI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s3JnppOGYw9SL2Q1kMAZs948v2F5PrpXjGei/HioDWs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cG6+3Gk/zEH68P/uuuwiAUVCuyJwa1LeV+t29FlPPAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dupdvR3AyJtM+g9NDKiaLVOtGca387JQp8w+V03m7Ig=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JqEQc5svj2jTvZ6LLA5ivE+kTb/0aRemSEmxk4G7Zrg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "szcXXXKnob+p3SoM4yED2R920LeJ7cVsclPMFTe4CeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o1QoGVXmuBdHwHm7aCtGMlMVKrjFdYvJXpoq6uhIAZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Jfm5wPlqqLCJRGQIqRq2NGmpn7s0Vrih2H3YAOoI2YU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zMHLb8ARbsYo8Ld05bqnGFf1Usha6EGb8QKwdSAyps0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yQdtq9lh5pugL7/i0Bj/PuZUUBUIzf+7wj1rl5y736w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wGWVZdO7qIuyDg/BqDgqjgoQ02h5YYgwXQB1oCin2NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "by9HMLj6NTEpgztZ5HSN6GxImkXPcaFINYDzgZY33X8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tWo0vbasi7bXmn/MsOx13VC1IsWtpx/nYp0uj4iMzdA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tQQpndUYd5O87lOtrGjH3wl9VsOK0ray7RMasL90sBM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cQjXEDCMsOpKLLf+vlTgIHA+cbSJdzqhbSX9Wvh95aA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7yMpU48IxK9SzP2cx3VnTownGEwFmeFofuuFT97SuuY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kSOx1kz0CmBgzKQHZlo65ZUY1DIv9A99JRm+Us2y6Ew=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ubQpdPBe6/xvtr+AcXdfYLSvYCR4ot0tivehkCsupb4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xal+iCJ6FTefRQToyoNksc9NCZShyn04NDGi4IYrcoM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "d7jU4iOK50xHxlkSifcxlZFCM46TSgQzoYivxG3HNLY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJvl2nsBLBVzL3pp6sKWCL4UXeh3q/roYBJjSb74ve0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OIUCaKRvIx9t1w6Hxlz1IcQTdPNCfdRNwnnTm10W+X0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A9tvzsiElotOUVIB4CqfQp9mAwqvTM35YkmAR170aHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lI8gpK7hpb7c9x4RQugsxMnQay5LZJmwslZdvMx/dcE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dNCzh40U0XvdKnSDi3HRQOWQftEsDVqc4uUvsVFGoq8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IP+iwEBWBwVVZIdpaMu8k5+soFCz+TZkYn3drKZ9grE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnqyh6e0y5svHkJDShlN9CHV0WvMBE4QbtJpQw5ZCXc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "elEl42tbVDoRTLjAhZUFEtXiut4b3PVhg/1ZLZSQdtE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vHuu2FxwclMHqyE6JBYbTYgbEkB0dqb/JuaxsvfwsmY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xTf7NCe3Gf8QpE78HR5OknlLTKfs9J+RN9UZpH6fnso=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XiWSasRnJAulGR6+LCVD3mwRObXylqYWR9jvpywq12c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MZMxEQ5ikx0PG1YFIExv0UnTZogsvgeOEZTpzvBDn4w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yZMyMZBDrWbAhvnic7vvIYhmO9m5H2iuv0c8KNZrBzY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xxM14hTPY5j0vvcK2C7YAEjzdsfUTFHozHC0hEo1bxI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+01rqR1xVwkpGXcstbk1ItJqFVjH6Q8MGxEN3Cm9Y1A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xOpLV0Z2VTRJ3iWtnWZcsyjXubTIkYWo31cO+HV1o1k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BWUOLqgLBqc5NwxVlSV5H3KFQPXbCp7mdo+jF+8cJqY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fuQb1S6xZDGlrEbK+kI23aL53PP1PVNwqICnZNt9Yzg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfscnoibFttahLdPVC4Ee+47ewGFKpDSU7M6HX19bKE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rpSW2awybNVeKtat91VFxqbINoTfNhPfQAu+d73Xtf8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9M/CP9ccOIIj2LLFmE0GFDO0Ban2wsNalEXfM6+h+1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WrEMG49l1ye4MhXs5ZS9tz8P6h+hDvthIg/2wW9ne1Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ImNhbfeyfH8qIEeA5ic0s3dAQBdzzTBS+CPsNih9vZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dWP33YDSn04UKJN2ogh2Rui0iW/0q2y18OCDRVcfyoo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lYv0isAtfGh6H9tdp3cp2eHU7q2J+uk7QrgcxtK3w7Y=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VGMoamB/+7zTOYcY/pqJc96xlv2PdW4hwsIAEIslTDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yNeBWMF7BnD9wVwz2PgJsvWr77QiVvvWUvJF0+fqBug=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfpvObJ+tJBXSvqeN7vlOfmhYign635lciYAJIjUtY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dsen4NqjzVGjpjufiTMs3+gqeD09EbnuogPgxrJECwg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pxCWVM3sn19NsFEpgHbgLa+PmYlhN3mMiP0Wk8kJhYw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q11KNvJszjYIB9n9HcC+N4uz11a3eRj1L3BH9scKMDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A1PmkgcEToWh1JiVWE6mI5jUu7poxWWuCUt/cgRUUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qJo3Hu4PJeanL7XEaWXO/n3YsodhZyd+MJOOmB9Kpd8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BkBKLO8URFscfRY9Bav/1+L9mLohDgNr/MkZtGiraIs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rZq5WA3Hx3xthOyHAJXK//f8pE2qbz7YKu3TIMp9GFY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X07a/Lm80p5xd4RFs1dNmw+90tmPDPdGiAKVZkxd4zY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6YrBn2ofIw1b5ooakrLOwF41BWrps8OO0H9WH4/rtlE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0l86Ag5OszXpa78SlOUV3K9nff5iC1p0mRXtLg9M1s4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Hn6yuxFHodeyu7ISlhYrbSf9pTiH4TDEvbYLWjTwFO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zdf4y2etKBuIpkEU1zMwoCkCsdisfXZCh8QPamm+drY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rOQ9oMdiK5xxGH+jPzOvwVqdGGnF3+HkJXxn81s6hp4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "61aKKsE3+BJHHWYvs3xSIBvlRmKswmaOo5rygQJguUg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KuDb/GIzqDM8wv7m7m8AECiWJbae5EKKtJRugZx7kR0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Q+t8t2TmNUiCIorVr9F3AlVnX+Mpt2ZYvN+s8UGict8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJRZIpKxUgHyL83kW8cvfjkxN3z6WoNnUg+SQw+LK+k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnUsYjip8SvW0+m9mR5WWTkpK+p6uwJ6yBUAlBnFKMk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PArHlz+yPRYDycAP/PgnI/AkP8Wgmfg++Vf4UG1Bf0E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wnIh53Q3jeK8jEBe1n8kJLa89/H0BxO26ZU8SRIAs9Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4F8U59gzBLGhq58PEWQk2nch+R0Va7eTUoxMneReUIA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ihKagIW3uT1dm22ROr/g5QaCpxZVj2+Fs/YSdM2Noco=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EJtUOOwjkrPUi9mavYAi+Gom9Y2DuFll7aDwo4mq0M0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dIkr8dbaVRQFskAVT6B286BbcBBt1pZPEOcTZqk4ZcI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aYVAcZYkH/Tieoa1XOjE/zCy5AJcVTHjS0NG2QB7muA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sBidL6y8TenseetpioIAAtn0lK/7C8MoW4JXpVYi3z8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0Dd2klU/t4R86c2WJcJDAd57k/N7OjvYSO5Vf8KH8sw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I3jZ92WEVmZmgaIkLbuWhBxl7EM6bEjiEttgBJunArA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aGHoQMlgJoGvArjfIbc3nnkoc8SWBxcrN7hSmjMRzos=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "bpiWPnF/KVBQr5F6MEwc5ZZayzIRvQOLDAm4ntwOi8g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tI7QVKbE6avWgDD9h4QKyFlnTxFCwd2iLySKakxNR/I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XGsge0CnoaXgE3rcpKm8AEeku5QVfokS3kcI+JKV1lk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JQxlryW2Q5WOwfrjAnaZxDvC83Dg6sjRVP5zegf2WiM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YFuHKJOfoqp1iGVxoFjx7bLYgVdsN4GuUFxEgO9HJ5s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Z6vUdiCR18ylKomf08uxcQHeRtmyav7/Ecvzz4av3k4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SPGo1Ib5AiP/tSllL7Z5PAypvnKdwJLzt8imfIMSEJQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "m94Nh6PFFQFLIib9Cu5LAKavhXnagSHG6F5EF8lD96I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pfEkQI98mB+gm1+JbmVurPAODMFPJ4E8DnqfVyUWbSo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DNj3OVRLbr43s0vd+rgWghOL3FqeO/60npdojC8Ry/M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kAYIQrjHVu49W8FTxyxJeiLVRWWjC9fPcBn+Hx1F+Ss=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aCSO7UVOpoQvu/iridarxkxV1SVxU1i9HVSYXUAeXk4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Gh6hTP/yj1IKlXQ+Q69KTfMlGZjEcXoRLGbQHNFo/1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/gDgIFQ4tAlJk3GN48IS5Qa5IPmErwGk8CHxAbp6gs0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PICyimwPjxpusyKxNssOOwUotAUbygpyEtORsVGXT8g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4lu+cBHyAUvuxC6JUNyHLzHsCogGSWFFnUCkDwfQdgI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pSndkmoNUJwXjgkbkgOrT5f9nSvuoMEZOkwAN9ElRaE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tyW+D4i26QihNM5MuBM+wnt5AdWGSJaJ4X5ydc9iWTU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9Syjr8RoxUgPKr+O5rsCu07AvcebA4P8IVKyS1NVLWc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "67tPfDYnK2tmrioI51fOBG0ygajcV0pLo5+Zm/rEW7U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "y0EiPRxYTuS1eVTIaPQUQBBxwkyxNckbePvKgChwd0M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NWd+2veAaeXQgR3vCvzlI4R1WW67D5YsVLdoXfdb8qg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PY5RQqKQsL2GqBBSPNOEVpojNFRX/NijCghIpxD6CZk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lcvwTyEjFlssCJtdjRpdN6oY+C7bxZY+WA+QAqzj9zg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWE7XRNylvTwO/9Fv56dNqUaQWMmESNS/GNIwgBaEI0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ijwlrUeS8nRYqK1F8kiCYF0mNDolEZS+/lJO1Lg93C8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8KzV+qYGYuIjoNj8eEpnTuHrMYuhzphl80rS6wrODuU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wDyTLjSEFF895hSQsHvmoEQVS6KIkZOtq1c9dVogm9I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SGrtPuMYCjUrfKF0Pq/thdaQzmGBMUvlwN3ORIu9tHU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KySHON3hIoUk4xWcwTqk6IL0kgjzjxgMBObVIkCGvk4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hBIdS9j0XJPeT4ot73ngELkpUoSixvRBvdOL9z48jY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Tx6um0q9HjS5ZvlFhvukpI6ORnyrXMWVW1OoxvgqII0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zFKlyfX5H81+d4A4J3FKn4T5JfG+OWtR06ddyX4Mxas=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cGgCDuPV7MeMMYEDpgOupqyNP4BQ4H7rBnd2QygumgM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IPaUoy98v11EoglTpJ4kBlEawoZ8y7BPwzjLYBpkvHQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Pfo4Am6tOWAyZNn8G9W5HWWGC3ZWmX0igI/RRB870Ro=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fnTSjd7bC1Udoq6iM7UDnHAC/lsIXSHp/Gy332qw+/I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fApBgVRrTDyEumkeWs5p3ag9KB48SbU4Si0dl7Ns9rc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QxudfBItgoCnUj5NXVnSmWH3HK76YtKkMmzn4lyyUYY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sSOvwhKa29Wq94bZ5jGIiJQGbG1uBrKSBfOYBz/oZeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FdaMgwwJ0NKsqmPZLC5oE+/0D74Dfpvig3LaI5yW5Fs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sRWBy12IERN43BSZIrnBfC9+zFBUdvjTlkqIH81NGt4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/4tIRpxKhoOwnXAiFn1Z7Xmric4USOIfKvTYQXk3QTc=", - "subType": "00" - } - } - ] - }, - { - "_id": { - "$numberInt": "1" - }, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "Mr/laWHUijZT5VT3x2a7crb7wgd/UXOGz8jr8BVqBpM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wXVD/HSbBljko0jJcaxJ1nrzs2+pchLQqYR3vywS8SU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VDCpBYsJIxTfcI6Zgf7FTmKMxUffQv+Ys8zt5dlK76I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zYDslUwOUVNwTYkETfjceH/PU3bac9X3UuQyYJ19qK0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rAOmHSz18Jx107xpbv9fYcPOmh/KPAqge0PAtuhIRnc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BFOB1OGVUen7VsOuS0g8Ti7oDsTt2Yj/k/7ta8YAdGM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2fckE5SPs0GU+akDkUEM6mm0EtcV3WDE/sQsnTtodlk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "mi9+aNjuwIvaMpSHENvKzKRAmX9cYguo2mXLvOoftHQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "K6TWn4VcWWkz/gkUkLmbtwkG7SNeABICmLDnoYJFlLU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Z+2/cEtGU0Fq7QJFNGA/0y4aWAsw0ncG6X0LYRqwS3c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rrSIf+lgcNZFbbUkS9BmE045jRWBpcBJXHzfMVEFuzE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KlHL3Kyje1/LMIfgbCqw1SolxffJvvgsYBV5y77wxuA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hzJ1YBoETmYeCh352dBmG8d8Wse/bUcqojTWpWQlgsc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lSdcllDXx8MA+s0GULjDA1lQkcV0L8/aHtZ6dM2pZ2c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "HGr7JLTTA7ksAnlmjSIwwdBVvgr3fv46/FTdiCPYpos=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "mMr25v1VwOEVZ8xaNUTHJCcsYqV+kwK6RzGYilxPtJ4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "129hJbziPJzNo0IoTU3bECdge0FtaPW8dm4dyNVNwYU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "doiLJ96qoo+v7NqIAZLq6BI5axV8Id8gT5vyJ1ZZ0PM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cW/Lcul3xYmfyvI/0x/+ybN78aQmBK1XIGs1EEU09N8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1aVIwzu9N5EJV9yEES+/g6hOTH7cA2NTcLIc59cu0wU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kw5tyl7Ew0r1wFyrN1mB9FiVW2hK2BxxxUuJDNWjyjQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ADAY2YBrm6RJBDY/eLLcfNxmSJku+mefz74gH66oyco=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8gkqB1LojzPrstpFG7RHYmWxXpIlPDTqWnNsXH7XDRU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "TESfVQMDQjfTZmHmUeYUE2XrokJ6CcrsKx/GmypGjOw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qFM+HFVQ539S0Ouynd1fBHoemFxtU9PRxE5+Dq7Ljy4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jPiFgUZteSmOg4wf3bsEKCZzcnxmMoILsgp/GaZD+dM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YaWUgJhYgPNN7TkFK16H8SsQS226JguaVhOIQxZwQNQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x90/Qk3AgyaFsvWf2KUCu5XF3j76WFSjt/GrnG01060=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ZGWybWL/xlEdMYRFCZDUoz10sywTf7U/7wufsb78lH0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8l4ganN66jIcdxfHAdYLaym/mdzUUQ8TViw3MDRySPc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "c8p5XEGTqxqvRGVlR+nkxw9uUdoqDqTB0jlYQ361qMA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1ZGFLlpQBcU3zIUg8MmgWwFKVz/SaA7eSYFrfe3Hb70=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "34529174M77rHr3Ftn9r8jU4a5ztYtyVhMn1wryZSkU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YkQ4pxFWzc49MS0vZM6S8mNo4wAwo21rePBeF3C+9mI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MhOf4mYY00KKVhptOcXf0bXB7WfuuM801MRJg4vXPgc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7pbbD8ihNIYIBJ3tAUPGzHpFPpIeCTAk5L88qCB0/9w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "C9Q5PoNJTQo6pmNzXEEXUEqH22//UUWY1gqILcIywec=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "AqGVk1QjDNDLYWGRBX/nv9QdGR2SEgXZEhF0EWBAiSE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/sGI3VCbJUKATULJmhTayPOeVW+5MjWSvVCqS77sRbU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yOtbL0ih7gsuoxVtRrACMz+4N5uo7jIR7zzmtih2Beo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uA6dkb2Iyg9Su8UNDvZzkPx33kPZtWr/CCuEY+XgzUM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1DoSFPdHIplqZk+DyWAmEPckWwXw/GdB25NLmzeEZhk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OfDVS0T3ZuIXI/LNbTp6C9UbPIWLKiMy6Wx+9tqNl+g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "3PZjHXbmG6GtPz+iapKtQ3yY4PoFFgjIy+fV2xQv1YU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kaoLN0BoBWsmqE7kKkJQejATmLShd8qffcAmlhsxsGY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vpiw9KgQdegGmp7IJnSGX2miujRLU0xzs0ITTqbPW7c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NuXFf7xGUefYjIUTuMxNUTCfVHrF8oL0AT7dPv5Plk4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8Tz53LxtfEBJ9eR+d2690kwNsqPV6XyKo2PlqZCbUrc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "e6zsOmHSyV8tyQtSX6BSwui6wK9v1xG3giY/IILJQ2w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2fedFMCxa2DzmIpfbDKGXhQg0PPwbUv6vIWdwwlvhms=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yEJKMFnWXTC8tJUfzCInzQRByNEPjHxpw4L4m8No91Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YbFuWwOiFuQyOzIJXDbOkCWC2DyrG+248TBuVCa1pXU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "w7IkwGdrguwDrar5+w0Z3va5wXyZ4VXJkDMISyRjPGo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YmJUoILTRJPhyIyWyXJTsQ6KSZHHbEpwPVup6Ldm/Ko=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FvMjcwVZJmfh6FP/yBg2wgskK+KHD8YVUY6WtrE8xbg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "h4HCtD4HyYz0nci49IVAa10Z4NJD/FHnRMV4sRX6qro=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "nC7BpXCmym+a0Is2kReM9cYN2M1Eh5rVo8fjms14Oiw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1qtVWaeVo649ZZZtN8gXbwLgMWGLhz8beODbvru0I7Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Ej+mC0QFyMNIiSjR939S+iGBm7dm+1xObu5IcF/OpbU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UQ8LbUG3cMegbr9yKfKanAPQE1EfPkFciVDrNqZ5GHY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4iI3mXIDjnX+ralk1HhJY43mZx2uTJM7hsv9MQzTX7E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0WQCcs3rvsasgohERHHCaBM4Iy6yomS4qJ5To3/yYiw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qDCTVPoue1/DOAGNAlUstdA9Sid8MgEY4e5EzHcVHRk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9F9Mus0UnlzHb8E8ImxgXtz6SU98YXD0JqswOKw/Bzs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pctHpHKVBBcsahQ6TNh6/1V1ZrqOtKSAPtATV6BJqh0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vfR3C/4cPkVdxtNaqtF/v635ONbhTf5WbwJM6s4EXNE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ejP43xUBIex6szDcqExAFpx1IE/Ksi5ywJ84GKDFRrs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jbP4AWYd3S2f3ejmMG7dS5IbrFol48UUoT+ve3JLN6U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CiDifI7958sUjNqJUBQULeyF7x0Up3loPWvYKw9uAuw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "e2dQFsiHqd2BFHNhlSxocjd+cPs4wkcUW/CnCz4KNuM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PJFckVmzBipqaEqsuP2mkjhJE4qhw36NhfQ9DcOHyEU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "S3MeuJhET/B8VcfZYDR9fvX0nscDj416jdDekhmK11s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CGVHZRXpuNtQviDB2Kj03Q8uvs4w3RwTgV847R7GwPw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yUGgmgyLrxbEpDVy89XN3c2cmFpZXWWmuJ/35zVZ+Jw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "inb6Q97mL1a9onfNTT8v9wsoi/fz7KXKq3p8j90AU9c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CCyYx/4npq9xGO1lsCo8ZJhFO9/tN7DB+/DTE778rYg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "LNnYw4fwbiAZu0kBdAHPEm/OFnreS+oArdB5O/l/I98=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "P006SxmUS/RjiQJVYPdMFnNo3827GIEmSzagggkg05Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "oyvwY+WsnYV6UHuPki1o0ILJ2jN4uyXf9yaUNtZJyBA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "36Lk3RHWh1wmtCWC/Yj6jNIo17U5y6SofAgQjzjVxD8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vOOo8FqeHnuO9mqOYjIb4vgwIwVyXZ5Y+bY5d9tGFUM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "bJiDJjwQRNxqxlGjRm5lLziFhcfTDCnQ/qU1V85qcRg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2Qgrm1n0wUELAQnpkEiIHB856yv76q8jLbpiucetcm0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "5ciPOYxTK0WDwwYyfs7yiVymwtYQXDELLxmM4JLl4/o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "31dC2WUSIOKQc4jwT6PikfeYTwi80mTlh7P31T5KNQU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YluTV2Mu53EGCKLcWfHZb0BM/IPW2xJdG3vYlDMEsM4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dh/8lGo2Ek6KukSwutH6Q35iy8TgV0FN0SJqe0ZVHN8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EVw6HpIs3BKen2qY2gz4y5dw1JpXilfh07msZfQqJpc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FYolLla9L8EZMROEdWetozroU40Dnmwwx2jIMrr7c1A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8M6k4QIutSIj6CM41vvkQtuFsaGrjoR9SZJVSLbfGKQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9LM0VoddDNHway442MqY+Z7vohB2UHau/cddshhzf40=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "66i8Ytco4Yq/FMl6pIRZazz3CZlu8fO2OI6Pne0pvHU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2a/HgX+MjZxjXtSvHgF1yEpHMJBkl8Caee8XrJtn0WM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "frhBM662c4ZVG7mWP8K/HhRjd01lydW/cPcHnDjifqc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6k1T7Q1t668PBqv6fwpVnT1HWh7Am5LtbKvwPJKcpGU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UlJ5Edfusp8S/Pyhw6KTglIejmbr1HO0zUeHn/qFETA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jsxsB+1ECB3assUdoC333do9tYH+LglHmVSJHy4N8Hg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2nzIQxGYF7j3bGsIesECEOqhObKs/9ywknPHeJ3yges=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xJYKtuWrX90JrJVoYtnwP7Ce59XQGFYoalxpNfBXEH0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NLI5lriBTleGCELcHBtNnmnvwSRkHHaLOX4cKboMgTw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hUOQV0RmE5aJdJww1AR9rirJG4zOYPo+6cCkgn/BGvQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "h4G2Of76AgxcUziBwCyH+ayMOpdBWzg4yFrTfehSC2c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VuamM75RzGfQpj2/Y1jSVuQLrhy6OAwlZxjuQLB/9Ss=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kn9+hLq7hvw02xr9vrplOCDXKBTuFhfbX7d5v/l85Pg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fAiGqKyLZpGngBYFbtYUYt8LUrJ49vYafiboifTDjxs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BxRILymgfVJCczqjUIWXcfrfSgrrYkxTM5VTg0HkZLY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CrFY/PzfPU2zsFkGLu/dI6mEeizZzCR+uYgjZBAHro0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "AEbrIuwvXLTtYgMjOqnGQ8y8axUn5Ukrn7UZRSyfQVw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ouWeVH3PEFg+dKWlXc6BmqirJOaVWjJbMzZbCsce4dA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+hd6xFB+EG+kVP7WH4uMd1CLaWMnt5xJRaY/Guuga9Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zmpGalfAOL3gmcUMJYcLYIRT/2VDO/1Dw4KdYZoNcng=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2PbHAoM/46J2UIZ/vyksKzmVVfxA7YUyIxWeL/N/vBk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7fD9x+zk5MVFesb59Klqiwwmve7P5ON/5COURXj5smE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tlrNQ4jaq051iaWonuv1sSrYhKkL1LtNZuHsvATha3s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fBodm28iClNpvlRyVq0dOdXQ08S7/N3aDwid+PdWvRo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "O+/nnRqT3Zv7yMMGug8GhKHaWy6u7BfRGtZoj0sdN1c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "5AZZ/RTMY4Photnm/cpXZr/HnFRi3eljacMsipkJLHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "oFVyo/kgoMxBIk2VE52ySSimeyU+Gr0EfCwapXnTpKA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Z8v59DfcnviA0mzvnUk+URVO0UuqAWvtarEgJva/n1c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "P64GOntZ+zBJEHkigoh9FSxSO+rJTqR20z5aiGQ9an4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xMbSuDPfWuO/Dm7wuVl06GnzG9uzTlJJX9vFy7boGlY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kXPB19mRClxdH2UsHwlttS6lLU2uHvzuZgZz7kC45jU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NDVjVYXAw4k0w4tFzvs7QDq39aaU3HQor4I2XMKKnCk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uKw/+ErVfpTO1dGUfd3T/eWfZW3nUxXCdBGdjvHtZ88=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "av0uxEzWkizYWm0QUM/MN1hLibnxPvCWJKwjOV4yVQY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ERwUC47dvgOBzIsEESMIioLYbFOxOe8PtJTnmDkKuHM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2gseKlG5Le12fS/vj4eaED4lturF16kAgJ1TpW3HxEE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7Cvg0Y3j/5i2F1TeXxlMmU7xwif5dCmwkZAOrVC5K2Y=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-InsertFind.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-InsertFind.json deleted file mode 100644 index 5a2adf69070..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-InsertFind.json +++ /dev/null @@ -1,1893 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Decimal. Insert and Find.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$numberDecimal": "0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$binary": { - "base64": "DR1jAAADcGF5bG9hZACxYgAABGcAnWIAAAMwAH0AAAAFZAAgAAAAAJu2KgiI8vM+kz9qD3ZQzFQY5qbgYqCqHG5R4jAlnlwXBXMAIAAAAAAAUXxFXsz764T79sGCdhxvNd5b6E/9p61FonsHyEIhogVsACAAAAAAt19RL3Oo5ni5L8kcvgOJYLgVYyXJExwP8pkuzLG7f/kAAzEAfQAAAAVkACAAAAAAPQPvL0ARjujSv2Rkm8r7spVsgeC1K3FWcskGGZ3OdDIFcwAgAAAAACgNn660GmefR8jLqzgR1u5O+Uocx9GyEHiBqVGko5FZBWwAIAAAAADflr+fsnZngm6KRWYgHa9JzK+bXogWl9evBU9sQUHPHQADMgB9AAAABWQAIAAAAAD2Zi6kcxmaD2mY3VWrP+wYJMPg6cSBIYPapxaFQxYFdQVzACAAAAAAM/cV36BLBY3xFBXsXJY8M9EHHOc/qrmdc2CJmj3M89gFbAAgAAAAAOpydOrKxx6m2gquSDV2Vv3w10GocmNCFeOo/fRhRH9JAAMzAH0AAAAFZAAgAAAAAOaNqI9srQ/mI9gwbk+VkizGBBH/PPWOVusgnfPk3tY1BXMAIAAAAAAc96O/pwKCmHCagT6T/QV/wz4vqO+R22GsZ1dse2Vg6QVsACAAAAAAgzIak+Q3UFLTHXPmJ+MuEklFtR3eLtvM+jdKkmGCV/YAAzQAfQAAAAVkACAAAAAA0XlQgy/Yu97EQOjronl9b3dcR1DFn3deuVhtTLbJZHkFcwAgAAAAACoMnpVl6EFJak8A+t5N4RFnQhkQEBnNAx8wDqmq5U/dBWwAIAAAAACR26FJif673qpwF1J1FEkQGJ1Ywcr/ZW6JQ7meGqzt1QADNQB9AAAABWQAIAAAAAAOtpNexRxfv0yRFvZO9DhlkpU4mDuAb8ykdLnE5Vf1VAVzACAAAAAAeblFKm/30orP16uQpZslvsoS8s0xfNPIBlw3VkHeekYFbAAgAAAAAPEoHj87sYE+nBut52/LPvleWQBzB/uaJFnosxp4NRO2AAM2AH0AAAAFZAAgAAAAAIr8xAFm1zPmrvW4Vy5Ct0W8FxMmyPmFzdWVzesBhAJFBXMAIAAAAABYeeXjJEzTHwxab6pUiCRiZjxgtN59a1y8Szy3hfkg+gVsACAAAAAAJuoY4rF8mbI+nKb+5XbZShJ8191o/e8ZCRHE0O4Ey8MAAzcAfQAAAAVkACAAAAAAl+ibLk0/+EwoqeC8S8cGgAtjtpQWGEZDsybMPnrrkwEFcwAgAAAAAHPPBudWgQ+HUorLDpJMqhS9VBF2VF5aLcxgrM1s+yU7BWwAIAAAAAAcCcBR2Vyv5pAFbaOU97yovuOi1+ATDnLLcAUqHecXcAADOAB9AAAABWQAIAAAAACR9erwLTb+tcWFZgJ2MEfM0PKI9uuwIjDTHADRFgD+SQVzACAAAAAAcOop8TXsGUVQoKhzUllMYWxL93xCOkwtIpV8Q6hiSYYFbAAgAAAAAKXKmh4V8veYwob1H03Q3p3PN8SRAaQwDT34KlNVUjiDAAM5AH0AAAAFZAAgAAAAALv0vCPgh7QpmM8Ug6ad5ioZJCh7pLMdT8FYyQioBQ6KBXMAIAAAAADsCPyIG8t6ApQkRk1fX/sfc1kpuWCWP8gAEpnYoBSHrQVsACAAAAAAJe/r67N6d8uTiogvfoR9rEXbIDjyLb9EVdqkayFFGaYAAzEwAH0AAAAFZAAgAAAAAIW4AxJgYoM0pcNTwk1RSbyjZGIqgKL1hcTJmNrnZmoPBXMAIAAAAAAZpfx3EFO0vY0f1eHnE0PazgqeNDTaj+pPJMUNW8lFrAVsACAAAAAAP+Um2vwW6Bj6vuz9DKz6+6aWkoKoEmFNoiz/xXm7lOsAAzExAH0AAAAFZAAgAAAAAKliO6L9zgeuufjj174hvmQGNRbmYYs9yAirL7OxwEW3BXMAIAAAAAAqU7vs3DWUQ95Eq8OejwWnD0GuXd+ASi/uD6S0l8MM1QVsACAAAAAAb9legYzsfctBPpHyl7YWpPmLr5QiNZFND/50N1vv2MUAAzEyAH0AAAAFZAAgAAAAAOGQcCBkk+j/Kzjt/Cs6g3BZPJG81wIHBS8JewHGpgk+BXMAIAAAAABjrxZXWCkdzrExwCgyHaafuPSQ4V4x2k9kUCAqUaYKDQVsACAAAAAADBU6KefT0v8zSmseaMNmQxKjJar72y7MojLFhkEHqrUAAzEzAH0AAAAFZAAgAAAAAPmCNEt4t97waOSd5hNi2fNCdWEkmcFJ37LI9k4Az4/5BXMAIAAAAABX7DuDPNg+duvELf3NbLWkPMFw2HGLgWGHyVWcPvSNCAVsACAAAAAAS7El1FtZ5STh8Q1FguvieyYX9b2DF1DFVsb9hzxXYRsAAzE0AH0AAAAFZAAgAAAAAD4vtVUYRNB+FD9yoQ2FVJH3nMeJeKbi6eZfth638YqbBXMAIAAAAAANCuUB4OdmuD6LaDK2f3vaqfgYYvg40wDXOBbcFjTqLwVsACAAAAAA9hqC2VoJBjwR7hcQ45xO8ZVojwC83jiRacCaDj6Px2gAAzE1AH0AAAAFZAAgAAAAAJPIRzjmTjbdIvshG6UslbEOd797ZSIdjGAhGWxVQvK1BXMAIAAAAABgmJ0Jh8WLs9IYs/a7DBjDWd8J3thW/AGJK7zDnMeYOAVsACAAAAAAi9zAsyAuou2oiCUHGc6QefLUkACa9IgeBhGu9W/r0X8AAzE2AH0AAAAFZAAgAAAAAABQyKQPoW8wGPIqnsTv69+DzIdRkohRhOhDmyVHkw9WBXMAIAAAAAAqWA2X4tB/h3O1Xlawtz6ndI6WaTwgU1QYflL35opu5gVsACAAAAAAWI/Gj5aZMwDIxztqmVL0g5LBcI8EdKEc2UA28pnekQoAAzE3AH0AAAAFZAAgAAAAACB7NOyGQ1Id3MYnxtBXqyZ5Ul/lHH6p1b10U63DfT6bBXMAIAAAAADpOryIcndxztkHSfLN3Kzq29sD8djS0PspDSqERMqokQVsACAAAAAADatsMW4ezgnyi1PiP7xk+gA4AFIN/fb5uJqfVkjg4UoAAzE4AH0AAAAFZAAgAAAAAKVfXLfs8XA14CRTB56oZwV+bFJN5BHraTXbqEXZDmTkBXMAIAAAAAASRWTsfGOpqdffiOodoqIgBzG/yzFyjR5CfUsIUIWGpgVsACAAAAAAkgCHbCwyX640/0Ni8+MoYxeHUiC+FSU4Mn9jTLYtgZgAAzE5AH0AAAAFZAAgAAAAAH/aZr4EuS0/noQR9rcF8vwoaxnxrwgOsSJ0ys8PkHhGBXMAIAAAAACd7ObGQW7qfddcvyxRTkPuvq/PHu7+6I5dxwS1Lzy5XAVsACAAAAAA3q0eKdV7KeU3pc+CtfypKR7BPxwaf30yu0j9FXeOOboAAzIwAH0AAAAFZAAgAAAAAKvlcpFFNq0oA+urq3w6d80PK1HHHw0H0yVWvU9aHijXBXMAIAAAAADWnAHQ5Fhlcjawki7kWzdqjM2f6IdGJblojrYElWjsZgVsACAAAAAAO0wvY66l24gx8nRxyVGC0QcTztIi81Kx3ndRhuZr6W4AAzIxAH0AAAAFZAAgAAAAAH/2aMezEOddrq+dNOkDrdqf13h2ttOnexZsJxG1G6PNBXMAIAAAAABNtgnibjC4VKy5poYjvdsBBnVvDTF/4mmEAxsXVgZVKgVsACAAAAAAqvadzJFLqQbs8WxgZ2D2X+XnaPSDMLCVVgWxx5jnLcYAAzIyAH0AAAAFZAAgAAAAAF2wZoDL6/V59QqO8vdRZWDpXpkV4h4KOCSn5e7x7nmzBXMAIAAAAADLZBu7LCYjbThaVUqMK14H/elrVOYIKJQCx4C9Yjw37gVsACAAAAAAEh6Vs81jLU204aGpL90fmYTm5i5R8/RT1uIbg6VU3HwAAzIzAH0AAAAFZAAgAAAAAH27yYaLn9zh2CpvaoomUPercSfJRUmBY6XFqmhcXi9QBXMAIAAAAAAUwumVlIYIs9JhDhSj0R0+59psCMsFk94E62VxkPt42QVsACAAAAAAT5x2hCCd2bpmpnyWaxas8nSxTc8e4C9DfKaqr0ABEysAAzI0AH0AAAAFZAAgAAAAALMg2kNAO4AFFs/mW3In04yFeN4AP6Vo0klyUoT06RquBXMAIAAAAAAgGWJbeIdwlpqXCyVIYSs0dt54Rfc8JF4b8uYc+YUj0AVsACAAAAAAWHeWxIkyvXTOWvfZzqtPXjfGaWWKjGSIQENTU3zBCrsAAzI1AH0AAAAFZAAgAAAAALas/i1T2DFCEmrrLEi7O2ngJZyFHialOoedVXS+OjenBXMAIAAAAAA1kK0QxY4REcGxHeMkgumyF7iwlsRFtw9MlbSSoQY7uAVsACAAAAAAUNlpMJZs1p4HfsD4Q4WZ4TBEi6Oc2fX34rzyynqWCdwAAzI2AH0AAAAFZAAgAAAAAP1TejmWg1CEuNSMt6NUgeQ5lT+oBoeyF7d2l5xQrbXWBXMAIAAAAABPX0kj6obggdJShmqtVfueKHplH4ZrXusiwrRDHMOKeQVsACAAAAAAIYOsNwC3DA7fLcOzqdr0bOFdHCfmK8tLwPoaE9uKOosAAzI3AH0AAAAFZAAgAAAAAMrKn+QPa/NxYezNhlOX9nyEkN1kE/gW7EuZkVqYl0b8BXMAIAAAAABUoZMSPUywRGfX2EEencJEKH5x/P9ySUVrhStAwgR/LgVsACAAAAAAMgZFH6lQIIDrgHnFeslv3ld20ynwQjQJt3cAp4GgrFkAAzI4AH0AAAAFZAAgAAAAAMmD1+a+oVbiUZd1HuZqdgtdVsVKwuWAn3/M1B6QGBM3BXMAIAAAAACLyytOYuZ9WEsIrrtJbXUx4QgipbaAbmlJvSZVkGi0CAVsACAAAAAA4v1lSp5H9BB+HYJ4bH43tC8aeuPZMf78Ng1JOhJh190AAzI5AH0AAAAFZAAgAAAAAOVKV7IuFwmYP1qVv8h0NvJmfPICu8yQhzjG7oJdTLDoBXMAIAAAAABL70XLfQLKRsw1deJ2MUvxSWKxpF/Ez73jqtbLvqbuogVsACAAAAAAvfgzIorXxE91dDt4nQxYfntTsx0M8Gzdsao5naQqcRUAAzMwAH0AAAAFZAAgAAAAAKS/1RSAQma+xV9rz04IcdzmavtrBDjOKPM+Z2NEyYfPBXMAIAAAAAAOJDWGORDgfRv8+w5nunh41wXb2hCA0MRzwnLnQtIqPgVsACAAAAAAf42C1+T7xdHEFF83+c2mF5S8PuuL22ogXXELnRAZ4boAAzMxAH0AAAAFZAAgAAAAAFeq8o82uNY1X8cH6OhdTzHNBUnCChsEDs5tm0kPBz3qBXMAIAAAAABaxMBbsaeEj/EDtr8nZfrhhhirBRPJwVamDo5WwbgvTQVsACAAAAAAMbH453A+BYAaDOTo5kdhV1VdND1avNwvshEG/4MIJjQAAzMyAH0AAAAFZAAgAAAAAI8IKIfDrohHh2cjspJHCovqroSr5N3QyVtNzFvT5+FzBXMAIAAAAABXHXteKG0DoOMmECKp6ro1MZNQvXGzqTDdZ0DUc8QfFAVsACAAAAAA/w5s++XYmO+9TWTbtGc3n3ndV4T9JUribIbF4jmDLSMAAzMzAH0AAAAFZAAgAAAAAJkHvm15kIu1OtAiaByj5ieWqzxiu/epK6c/9+KYIrB0BXMAIAAAAACzg5TcyANk0nes/wCJudd1BwlkWWF6zw3nGclq5v3SJQVsACAAAAAAvruXHTT3irPJLyWpI1j/Xwf2FeIE/IV+6Z49pqRzISoAAzM0AH0AAAAFZAAgAAAAAAYSOvEWWuSg1Aym7EssNLR+xsY7e9BcwsX4JKlnSHJcBXMAIAAAAABT48eY3PXVDOjw7JpNjOe1j2JyI3LjDnQoqZ8Je5B2KgVsACAAAAAAU2815RR57TQ9uDg0XjWjBkAKvf8yssxDMzrM4+FqP6AAAzM1AH0AAAAFZAAgAAAAAGQxC9L1e9DfO5XZvX1yvc3hTLtQEdKO9FPMkyg0Y9ZABXMAIAAAAADtmcMNJwdWLxQEArMGZQyzpnu+Z5yMmPAkvgq4eAKwNQVsACAAAAAAJ88zt4Y/Hoqh+zrf6KCOiUwHbOzCxSfp6k/qsZaYGEgAAzM2AH0AAAAFZAAgAAAAADLHK2LNCNRO0pv8n4fAsxwtUqCNnVK8rRgNiQfXpHSdBXMAIAAAAACf16EBIHRKD3SzjRW+LMOl+47QXA3CJhMzlcqyFRW22AVsACAAAAAAMGz4fAOa0EoVv90fUffwLjBrQhHATf+NdlgCR65vujAAAzM3AH0AAAAFZAAgAAAAAHiZJiXKNF8bbukQGsdYkEi95I+FSBHy1I5/hK2uEZruBXMAIAAAAADE+lZBa8HDUJPN+bF6xI9x4N7GF9pj3vBR7y0BcfFhBAVsACAAAAAAGIEN6sfqq30nyxW4dxDgXr/jz5HmvA9T1jx/pKCn4zgAAzM4AH0AAAAFZAAgAAAAAI1oa2OIw5TvhT14tYCGmhanUoYcCZtNbrVbeoMldHNZBXMAIAAAAAAx2nS0Ipblf2XOgBiUOuJFBupBhe7nb6QPLZlA4aMPCgVsACAAAAAA9xu828hugIgo0E3de9dZD+gTpVUGlwtDba+tw/WcbUoAAzM5AH0AAAAFZAAgAAAAABgTWS3Yap7Q59hii/uPPimHWXsr+DUmsqfwt/X73qsOBXMAIAAAAACKK05liW5KrmEAvtpCB1WUltruzUylDDpjea//UlWoOAVsACAAAAAAcgN4P/wakJ5aJK5c1bvJBqpVGND221dli2YicPFfuAYAAzQwAH0AAAAFZAAgAAAAABOAnBPXDp6i9TISQXvcNKwGDLepZTu3cKrB4vKnSCjBBXMAIAAAAADjjzZO7UowAAvpwyG8BNOVqLCccMFk3aDK4unUeft5ywVsACAAAAAA4zkCd4k9gvfXoD1C7vwTjNcdVJwEARh8h/cxZ4PNMfgAAzQxAH0AAAAFZAAgAAAAAHN8hyvT1lYrAsdiV5GBdd5jhtrAYE/KnSjw2Ka9hjz9BXMAIAAAAAD794JK7EeXBs+D7yOVK7nWF8SbZ/7U8gZ7nnT9JFNwTAVsACAAAAAAg8Wt1HO3NhByq2ggux2a4Lo6Gryr24rEFIqh2acrwWMAAzQyAH0AAAAFZAAgAAAAAO93bPrq8bsnp1AtNd9ETnXIz0lH/2HYN/vuw9wA3fyFBXMAIAAAAABHlls5fbaF2oAGqptC481XQ4eYxInTC29aElfmVZgDUgVsACAAAAAANoQXEWpXJpgrSNK/cKi/m7oYhuSRlp1IZBF0bqTEATcAAzQzAH0AAAAFZAAgAAAAAL1YsAZm1SA0ztU6ySIrQgCCA74V6rr0/4iIygCcaJL6BXMAIAAAAADTXWTHWovGmUR1Zg9l/Aqq9H5mOCJQQrb/Dfae7e3wKAVsACAAAAAA5dunyJK6/SVfDD0t9QlNBcFqoZnf9legRjHaLSKAoQMAAzQ0AH0AAAAFZAAgAAAAAEoFAeHk0RZ9kD+cJRD3j7PcE5gzWKnyBrF1I/MDNp5mBXMAIAAAAACgHtc2hMBRSZjKw8RAdDHK+Pi1HeyjiBuAslGVNcW5tAVsACAAAAAAXzBLfq+GxRtX4Wa9fazA49DBLG6AjZm2XODStJKH8D0AAzQ1AH0AAAAFZAAgAAAAAAW+7DmSN/LX+/0uBVJDHIc2dhxAGz4+ehyyz8fAnNGoBXMAIAAAAAA6Ilw42EvvfLJ3Eq8Afd+FjPoPcQutZO6ltmCLEr8kxQVsACAAAAAAbbZalyo07BbFjPFlYmbmv0z023eT9eLkHqeVUnfUAUAAAzQ2AH0AAAAFZAAgAAAAANBdV7M7kuYO3EMoQItAbXv4t2cIhfaT9V6+s4cg9djlBXMAIAAAAABvz4MIvZWxxrcJCL5qxLfFhXiUYB1OLHdKEjco94SgDgVsACAAAAAAK2GVGvyPIKolF/ECcmfmkVcf1/IZNcaTv96N92yGrkEAAzQ3AH0AAAAFZAAgAAAAAMoAoiAn1kc79j5oPZtlMWHMhhgwNhLUnvqkqIFvcH1NBXMAIAAAAADcJTW7WiCyW0Z9YDUYwppXhLj4Ac1povpJvcAq+i48MQVsACAAAAAAIGxGDzoeB3PTmudl4+j6piQB++e33EEzuzAiXcqGxvUAAzQ4AH0AAAAFZAAgAAAAACI3j5QP7dWHpcT6WO/OhsWwRJNASBYqIBDNzW8IorEyBXMAIAAAAABxUpBSjXwCKDdGP9hYU+RvyR+96kChfvyyRC4jZmztqAVsACAAAAAAvBCHguWswb4X0xdcAryCvZgQuthXzt7597bJ5VxAMdgAAzQ5AH0AAAAFZAAgAAAAAKsbycEuQSeNrF8Qnxqw3x3og8JmQabwGqnDbqzFRVrrBXMAIAAAAACno/3ef2JZJS93SVVzmOZSN+jjJHT8s0XYq2M46d2sLAVsACAAAAAAAt5zLJG+/j4K8rnkFtAn8IvdUVNefe6utJ3rdzgwudIAAzUwAH0AAAAFZAAgAAAAAPXIcoO8TiULqlxzb74NFg+I8kWX5uXIDUPnh2DobIoMBXMAIAAAAADR6/drkdTpnr9g1XNvKDwtBRBdKn7c2c4ZNUVK5CThdQVsACAAAAAAJqOA1c6KVog3F4Hb/GfDb3jCxXDRTqpXWSbMH4ePIJsAAzUxAH0AAAAFZAAgAAAAAEa03ZOJmfHT6/nVadvIw71jVxEuIloyvxXraYEW7u7pBXMAIAAAAADzRlBJK75FLiKjz3djqcgjCLo/e3yntI3MnPS48OORhgVsACAAAAAAnQhx4Rnyj081XrLRLD5NLpWmRWCsd0M9Hl7Jl19R0h8AAzUyAH0AAAAFZAAgAAAAAKx8NLSZUU04pSSGmHa5fh2oLHsEN5mmNMNHL95/tuC9BXMAIAAAAAA59hcXVaN3MNdHoo11OcH1aPRzHCwpVjO9mGfMz4xh3QVsACAAAAAAYIPdjV2XbPj7dBeHPwnwhVU7zMuJ+xtMUW5mIOYtmdAAAzUzAH0AAAAFZAAgAAAAAHNKAUxUqBFNS9Ea9NgCZoXMWgwhP4x0/OvoaPRWMquXBXMAIAAAAABUZ551mnP4ZjX+PXU9ttomzuOpo427MVynpkyq+nsYCQVsACAAAAAALnVK5p2tTTeZEh1zYt4iqKIQT9Z0si//Hy1L85oF+5IAAzU0AH0AAAAFZAAgAAAAALfGXDlyDVcGaqtyHkLT0qpuRhJQLgCxtznazhFtuyn/BXMAIAAAAABipxlXDq14C62pXhwAeen5+syA+/C6bN4rtZYcO4zKwAVsACAAAAAAXUf0pzUq0NhLYagWDap4uEiwq5rLpcx29rWbt1NYMsMAAzU1AH0AAAAFZAAgAAAAANoEr8sheJjg4UCfBkuUzarU9NFoy1xwbXjs5ifVDeA9BXMAIAAAAABPoyTf6M+xeZVGES4aNzVlq7LgjqZXJ/QunjYVusGUEAVsACAAAAAA1hA2gMeZZPUNytk9K+lB1RCqWRudRr7GtadJlExJf8oAAzU2AH0AAAAFZAAgAAAAAKvDiK+xjlBe1uQ3SZTNQl2lClIIvpP/5CHwY6Kb3WlgBXMAIAAAAAANnxImq5MFbWaRBHdJp+yD09bVlcFtiFDYsy1eDZj+iQVsACAAAAAAWtsyO+FxMPSIezwsV1TJD8ZrXAdRnQM6DJ+f+1V3qEkAAzU3AH0AAAAFZAAgAAAAAF49IlFH9RmSUSvUQpEPUedEksrQUcjsOv44nMkwXhjzBXMAIAAAAADJtWGbk0bZzmk20obz+mNsp86UCu/nLLlbg7ppxYn7PgVsACAAAAAA3k0Tj/XgPQtcYijH8cIlQoe/VXf15q1nrZNmg7yWYEgAAzU4AH0AAAAFZAAgAAAAAOuSJyuvz50lp3BzXlFKnq62QkN2quNU1Gq1IDsnFoJCBXMAIAAAAAAqavH1d93XV3IzshWlMnzznucadBF0ND092/2ApI1AcAVsACAAAAAAzUrK4kpoKCmcpdZlZNI13fddjdoAseVe67jaX1LobIIAAzU5AH0AAAAFZAAgAAAAALtgC4Whb4ZdkCiI30zY6fwlsxSa7lEaOAU3SfUXr02XBXMAIAAAAACgdZ6U1ZVgUaZZwbIaCdlANpCw6TZV0bwg3DS1NC/mnAVsACAAAAAAzI49hdpp0PbO7S2KexISxC16sE73EUAEyuqUFAC/J48AAzYwAH0AAAAFZAAgAAAAAF6PfplcGp6vek1ThwenMHVkbZgrc/dHgdsgx1VdPqZ5BXMAIAAAAACha3qhWkqmuwJSEXPozDO8y1ZdRLyzt9Crt2vjGnT7AAVsACAAAAAA7nvcU59+LwxGupSF21jAeAE0x7JE94tjRkJfgM1yKU8AAzYxAH0AAAAFZAAgAAAAAKoLEhLvLjKc7lhOJfx+VrGJCx9tXlOSa9bxQzGR6rfbBXMAIAAAAAAIDK5wNnjRMBzET7x/KAMExL/zi1IumJM92XTgXfoPoAVsACAAAAAAFkUYWFwNr815dEdFqp+TiIozDcq5IBNVkyMoDjharDQAAzYyAH0AAAAFZAAgAAAAADoQv6lutRmh5scQFvIW6K5JBquLxszuygM1tzBiGknIBXMAIAAAAADAD+JjW7FoBQ76/rsECmmcL76bmyfXpUU/awqIsZdO+wVsACAAAAAAPFHdLw3jssmEXsgtvl/RBNaUCRA1kgSwsofG364VOvQAAzYzAH0AAAAFZAAgAAAAAJNHUGAgn56KekghO19d11nai3lAh0JAlWfeP+6w4lJBBXMAIAAAAAD9XGJlvz59msJvA6St9fKW9CG4JoHV61rlWWnkdBRLzwVsACAAAAAAxwP/X/InJJHmrjznvahIMgj6pQR30B62UtHCthSjrP0AAzY0AH0AAAAFZAAgAAAAAHgYoMGjEE6fAlAhICv0+doHcVX8CmMVxyq7+jlyGrvmBXMAIAAAAAC/5MQZgTHuIr/O5Z3mXPvqrom5JTQ8IeSpQGhO9sB+8gVsACAAAAAAuPSXVmJUAUpTQg/A9Bu1hYczZF58KEhVofakygbsvJQAAzY1AH0AAAAFZAAgAAAAANpIljbxHOM7pydY877gpRQvYY2TGK7igqgGsavqGPBABXMAIAAAAAAqHyEu9gpurPOulApPnr0x9wrygY/7mXe9rAC+tPK80wVsACAAAAAA7gkPzNsS3gCxdFBWbSW9tkBjoR5ib+saDvpGSB3A3ogAAzY2AH0AAAAFZAAgAAAAAGR+gEaZTeGNgG9BuM1bX2R9ed4FCxBA9F9QvdQDAjZwBXMAIAAAAABSkrYFQ6pf8MZ1flgmeIRkxaSh/Eep4Btdx4QYnGGnwAVsACAAAAAApRovMiV00hm/pEcT4XBsyPNw0eo8RLAX/fuabjdU+uwAAzY3AH0AAAAFZAAgAAAAAFNprhQ3ZwIcYbuzLolAT5n/vc14P9kUUQComDu6eFyKBXMAIAAAAAAcx9z9pk32YbPV/sfPZl9ALIEVsqoLXgqWLVK/tP+heAVsACAAAAAA/qxvuvJbAHwwhfrPVpmCFzNvg2cU/NXaWgqgYUZpgXwAAzY4AH0AAAAFZAAgAAAAADgyPqQdqQrgfmJjRFAILTHzXbdw5kpKyfeoEcy6YYG/BXMAIAAAAAAE+3XsBQ8VAxAkN81au+f3FDeCD/s7KoZD+fnM1MJSSAVsACAAAAAAhRnjrXecwV0yeCWKJ5J/x12Xx4qVJahsCEVHB/1U2rcAAzY5AH0AAAAFZAAgAAAAAI0CT7JNngTCTUSei1Arw7eHWCD0jumv2rb7imjWIlWABXMAIAAAAABSP8t6ya0SyCphXMwnru6ZUDXWElN0NfBvEOhDvW9bJQVsACAAAAAAGWeGmBNDRaMtvm7Rv+8TJ2sJ4WNXKcp3tqpv5Se9Ut4AAzcwAH0AAAAFZAAgAAAAAD/FIrGYFDjyYmVb7oTMVwweWP7A6F9LnyIuNO4MjBnXBXMAIAAAAACIZgJCQRZu7NhuNMyOqCn1tf+DfU1qm10TPCfj5JYV3wVsACAAAAAA5hmY4ptuNxULGf87SUFXQWGAONsL9U29duh8xqsHtxoAAzcxAH0AAAAFZAAgAAAAAHIkVuNDkSS1cHIThKc/O0r2/ubaABTOi8Q1r/dvBAsEBXMAIAAAAADdHYqchEiJLM340c3Q4vJABmmth3+MKzwLYlsG6GS7sQVsACAAAAAADa+KP/pdTiG22l+ZWd30P1iHjnBF4zSNRdFm0oEK82kAAzcyAH0AAAAFZAAgAAAAAJmoDILNhC6kn3masElfnjIjP1VjsjRavGk1gSUIjh1NBXMAIAAAAAD97Ilvp3XF8T6MmVVcxMPcdL80RgQ09UoC6PnoOvZ1IQVsACAAAAAA2RK3Xng6v8kpvfVW9tkVXjpE+BSnx9/+Fw85Evs+kUEAAzczAH0AAAAFZAAgAAAAAI5bm3YO0Xgf0VT+qjVTTfvckecM3Cwqj7DTKZXf8/NXBXMAIAAAAAD/m+h8fBhWaHm6Ykuz0WX1xL4Eme3ErLObyEVJf8NCywVsACAAAAAAfb1VZZCqs2ivYbRzX4p5CtaCkKW+g20Pr57FWXzEZi8AAzc0AH0AAAAFZAAgAAAAANqo4+p6qdtCzcB4BX1wQ6llU7eFBnuu4MtZwp4B6mDlBXMAIAAAAAAGiz+VaukMZ+6IH4jtn4KWWdKK4/W+O+gRioQDrfzpMgVsACAAAAAAG4YYkTp80EKo59mlHExDodRQFR7njhR5dmISwUJ6ukAAAzc1AH0AAAAFZAAgAAAAAPrFXmHP2Y4YAm7b/aqsdn/DPoDkv7B8egWkfe23XsM1BXMAIAAAAAAGhwpKAr7skeqHm3oseSbO7qKNhmYsuUrECBxJ5k+D2AVsACAAAAAAAqPQi9luYAu3GrFCEsVjd9z2zIDcp6SPTR2w6KQEr+IAAzc2AH0AAAAFZAAgAAAAABzjYxwAjXxXc0Uxv18rH8I3my0Aguow0kTwKyxbrm+cBXMAIAAAAADVbqJVr6IdokuhXkEtXF0C2gINLiAjMVN20lE20Vmp2QVsACAAAAAAD7K1Fx4gFaaizkIUrf+EGXQeG7QX1jadhGc6Ji471H8AAzc3AH0AAAAFZAAgAAAAAFMm2feF2fFCm/UC6AfIyepX/xJDSmnnolQIBnHcPmb5BXMAIAAAAABLI11kFrQoaNVZFmq/38aRNImPOjdJh0Lo6irI8M/AaAVsACAAAAAAOWul0oVqJ9CejD2RqphhTC98DJeRQy5EwbNerU2+4l8AAzc4AH0AAAAFZAAgAAAAAJvXB3KyNiNtQko4SSzo/9b2qmM2zU9CQTTDfLSBWMgRBXMAIAAAAAAvjuVP7KsLRDeqVqRziTKpBrjVyqKiIbO9Gw8Wl2wFTAVsACAAAAAADlE+oc1ins+paNcaOZJhBlKlObDJ4VQORWjFYocM4LgAAzc5AH0AAAAFZAAgAAAAAPGdcxDiid8z8XYnfdDivNMYVPgBKdGOUw6UStU+48CdBXMAIAAAAAARj6g1Ap0eEfuCZ4X2TsEw+Djrhto3fA5nLwPaY0vCTgVsACAAAAAAoHqiwGOUkBu8SX5U1yHho+UIFdSN2MdQN5s6bQ0EsJYAAzgwAH0AAAAFZAAgAAAAAP5rGPrYGt3aKob5f/ldP0qrW7bmWvqnKY4QwdDWz400BXMAIAAAAADTQkW2ymaaf/bhteOOGmSrIR97bAnJx+yN3yMj1bTeewVsACAAAAAADyQnHGH2gF4w4L8axUsSTf6Ubk7L5/eoFOJk12MtZAoAAzgxAH0AAAAFZAAgAAAAAAlz6wJze5UkIxKpJOZFGCOf3v2KByWyI6NB6JM9wNcBBXMAIAAAAABUC7P/neUIHHoZtq0jFVBHY75tSFYr1Y5S16YN5XxC1QVsACAAAAAAgvxRbXDisNnLY3pfsjDdnFLtkvYUC4lhA68eBXc7KAwAAzgyAH0AAAAFZAAgAAAAAFJ8AtHcjia/9Y5pLEc3qVgH5xKiXw12G9Kn2A1EY8McBXMAIAAAAAAxe7Bdw7eUSBk/oAawa7uicTEDgXLymRNhBy1LAxhDvwVsACAAAAAAxKPaIBKVx3jTA+R/el7P7AZ7efrmTGjJs3Hj/YdMddwAAzgzAH0AAAAFZAAgAAAAAO8uwQUaKFb6vqR3Sv3Wn4QAonC2exOC9lGG1juqP5DtBXMAIAAAAABZf1KyJgQg8/Rf5c02DgDK2aQu0rNCOvaL60ohDHyY+gVsACAAAAAAqyEjfKC8lYoIfoXYHUqHZPoaA6EK5BAZy5dxXZmay4kAAzg0AH0AAAAFZAAgAAAAAE8YtqyRsGCeiR6hhiyisR/hccmK4nZqIMzO4lUBmEFzBXMAIAAAAAC1UYOSKqAeG1UJiKjWFVskRhuFKpj9Ezy+lICZvFlN5AVsACAAAAAA6Ct9nNMKyRazn1OKnRKagm746CGu+jyhbL1qJnZxGi0AAzg1AH0AAAAFZAAgAAAAAPhCrMausDx1QUIEqp9rUdRKyM6a9AAx7jQ3ILIu8wNIBXMAIAAAAACmH8lotGCiF2q9VQxhsS+7LAZv79VUAsOUALaGxE/EpAVsACAAAAAAnc1xCKfdvbUEc8F7XZqlNn1C+hZTtC0I9I3LL06iaNkAAzg2AH0AAAAFZAAgAAAAAOBi/GAYFcstMSJPgp3VkMiuuUUCrZytvqYaU8dwm8v2BXMAIAAAAACEZSZVyD3pKzGlbdwlYmWQhHHTV5SnNLknl2Gw8IaUTQVsACAAAAAAfsLZsEDcWSuNsIo/TD1ReyQW75HPMgmuKZuWFOLKRLoAAzg3AH0AAAAFZAAgAAAAAIQuup+YGfH3mflzWopN8J1X8o8a0d9CSGIvrA5HOzraBXMAIAAAAADYvNLURXsC2ITMqK14LABQBI+hZZ5wNf24JMcKLW+84AVsACAAAAAACzfjbTBH7IwDU91OqLAz94RFkoqBOkzKAqQb55gT4/MAAzg4AH0AAAAFZAAgAAAAAKsh0ADyOnVocFrOrf6MpTrNvAj8iaiE923DPryu124gBXMAIAAAAADg24a8NVE1GyScc6tmnTbmu5ulzO+896fE92lN08MeswVsACAAAAAAaPxcOIxnU7But88/yadOuDJDMcCywwrRitaxMODT4msAAzg5AH0AAAAFZAAgAAAAAKkVC2Y6HtRmv72tDnPUSjJBvse7SxLqnr09/Uuj9sVVBXMAIAAAAABYNFUkH7ylPMN+Bc3HWX1e0flGYNbtJNCY9SltJCW/UAVsACAAAAAAZYK/f9H4OeihmpiFMH7Wm7uLvs2s92zNA8wyrNZTsuMAAzkwAH0AAAAFZAAgAAAAADDggcwcb/Yn1Kk39sOHsv7BO/MfP3m/AJzjGH506Wf9BXMAIAAAAAAYZIsdjICS0+BDyRUPnrSAZfPrwtuMaEDEn0/ijLNQmAVsACAAAAAAGPnYVvo2ulO9z4LGd/69NAklfIcZqZvFX2KK0s+FcTUAAzkxAH0AAAAFZAAgAAAAAEWY7dEUOJBgjOoWVht1wLehsWAzB3rSOBtLgTuM2HC8BXMAIAAAAAAAoswiHRROurjwUW8u8D5EUT+67yvrgpB/j6PzBDAfVwVsACAAAAAA6NhRTYFL/Sz4tao7vpPjLNgAJ0FX6P/IyMW65qT6YsMAAzkyAH0AAAAFZAAgAAAAAPZaapeAUUFPA7JTCMOWHJa9lnPFh0/gXfAPjA1ezm4ZBXMAIAAAAACmJvLY2nivw7/b3DOKH/X7bBXjJwoowqb1GtEFO3OYgAVsACAAAAAA/JcUoyKacCB1NfmH8vYqC1f7rd13KShrQqV2r9QBP44AAzkzAH0AAAAFZAAgAAAAAK00u6jadxCZAiA+fTsPVDsnW5p5LCr4+kZZZOTDuZlfBXMAIAAAAAAote4zTEYMDgaaQbAdN8Dzv93ljPLdGjJzvnRn3KXgtQVsACAAAAAAxXd9Mh6R3mnJy8m7UfqMKi6oD5DlZpkaOz6bEjMOdiwAAzk0AH0AAAAFZAAgAAAAAFbgabdyymiEVYYwtJSWa7lfl/oYuj/SukzJeDOR6wPVBXMAIAAAAADAFGFjS1vPbN6mQEhkDYTD6V2V23Ys9gUEUMGNvMPkaAVsACAAAAAAL/D5Sze/ZoEanZLK0IeEkhgVkxEjMWVCfmJaD3a8uNIAAzk1AH0AAAAFZAAgAAAAABNMR6UBv2E627CqLtQ/eDYx7OEwQ7JrR4mSHFa1N8tLBXMAIAAAAAAxH4gucI4UmNVB7625C6hFSVCuIpJO3lusJlPuL8H5EQVsACAAAAAAVLHNg0OUVqZ7WGOP53BkTap9FOw9dr1P4J8HxqFqU04AAzk2AH0AAAAFZAAgAAAAAG8cd6WBneNunlqrQ2EmNf35W7OGObGq9WL4ePX+LUDmBXMAIAAAAAAjJ2+sX87NSis9hBsgb1QprVRnO7Bf+GObCGoUqyPE4wVsACAAAAAAs9c9SM49/pWmyUQKslpt3RTMBNSRppfNO0JBvUqHPg0AAzk3AH0AAAAFZAAgAAAAAFWOUGkUpy8yf6gB3dio/aOfRKh7XuhvsUj48iESFJrGBXMAIAAAAAAY7sCDMcrUXvNuL6dO0m11WyijzXZvPIcOKob6IpC4PQVsACAAAAAAJOP+EHz6awDb1qK2bZQ3kTV7wsj5Daj/IGAWh4g7omAAAzk4AH0AAAAFZAAgAAAAAGUrIdKxOihwNmo6B+aG+Ag1qa0+iqdksHOjQj+Oy9bZBXMAIAAAAABwa5dbI2KmzBDNBTQBEkjZv4sPaeRkRNejcjdVymRFKQVsACAAAAAA4ml/nm0gJNTcJ4vuD+T2Qfq2fQZlibJp/j6MOGDrbHMAAzk5AH0AAAAFZAAgAAAAAOx89xV/hRk64/CkM9N2EMK6aldII0c8smdcsZ46NbP8BXMAIAAAAADBF6tfQ+7q9kTuLyuyrSnDgmrdmrXkdhl980i1KHuGHgVsACAAAAAACUqiFqHZdGbwAA+hN0YUE5zFg+H+dabIB4dj5/75W/YAAzEwMAB9AAAABWQAIAAAAADJDdC9aEFl4Y8J/awHbnXGHjfP+VXQilPHJg7ewaJI7AVzACAAAAAAE+tqRl6EcBMXvbr4GDiNIYObTsYpa1n6BJk9EjIJVicFbAAgAAAAAJVc+HYYqa0m1Hq6OiRX8c0iRnJYOt6AJAJoG0sG3GMSAAMxMDEAfQAAAAVkACAAAAAA3F9rjEKhpoHuTULVGgfUsGGwJs3bISrXkFP1v6KoQLgFcwAgAAAAAIBf0tXw96Z/Ds0XSIHX/zk3MzUR/7WZR/J6FpxRWChtBWwAIAAAAABWrjGlvKYuTS2s8L9rYy8Hf0juFGJfwQmxVIjkTmFIGQADMTAyAH0AAAAFZAAgAAAAAOYIYoWkX7dGuyKfi3XssUlc7u/gWzqrR9KMkikKVdmSBXMAIAAAAABVF2OYjRTGi9Tw8XCAwZWLpX35Yl271TlNWp6N/nROhAVsACAAAAAA0nWwYzXQ1+EkDvnGq+SMlq20z+j32Su+i/A95SggPb4AAzEwMwB9AAAABWQAIAAAAACMtPm12YtdEAvqu6Eji1yuRXnu1RJP6h0l7pH3lSH4MwVzACAAAAAAENyCFfyUAh1veQBGx+cxiB7Sasrj41jzCGflZkB5cRMFbAAgAAAAAKdI2LMqISr/T5vuJPg6ZRBm5fVi2aQCc4ra3A4+AjbDAAMxMDQAfQAAAAVkACAAAAAAvlI4lDcs6GB1cnm/Tzo014CXWqidCdyE5t2lknWQd4QFcwAgAAAAAD60SpNc4O2KT7J0llKdSpcX1/Xxs97N715a1HsTFkmBBWwAIAAAAABuuRkJWAH1CynggBt1/5sPh9PoGiqTlS24D/OE2uHXLQADMTA1AH0AAAAFZAAgAAAAAKl8zcHJRDjSjJeV/WvMxulW1zrTFtaeBy/aKKhadc6UBXMAIAAAAADBdWQl5SBIvtZZLIHszePwkO14W1mQ0izUk2Ov21cPNAVsACAAAAAAHErCYycpqiIcCZHdmPL1hi+ovLQk4TAvENpfLdTRamQAAzEwNgB9AAAABWQAIAAAAABb6LXDWqCp1beQgQjj8I3sRTtFhlrmiBi+h/+ikmrvugVzACAAAAAA9stpgTecT7uTyaGNs3K9Bp0A7R0QaIAOfscyMXHBPX8FbAAgAAAAAHUt+McyXrJ1H8SwnHNVO181Ki8vDAM1f7XI26mg95ZDAAMxMDcAfQAAAAVkACAAAAAA97NTT+81PhDhgptNtp4epzA0tP4iNb9j1AWkiiiKGM8FcwAgAAAAAKPbHg7ise16vxmdPCzksA/2Mn/qST0L9Xe8vnQugVkcBWwAIAAAAABB0EMXfvju4JU/mUH/OvxWbPEl9NJkcEp4iCbkXI41fAADMTA4AH0AAAAFZAAgAAAAAMqpayM2XotEFmm0gwQd9rIzApy0X+7HfOhNk6VU7F5lBXMAIAAAAACJR9+q5T9qFHXFNgGbZnPubG8rkO6cwWhzITQTmd6VgwVsACAAAAAAOZLQ6o7e4mVfDzbpQioa4d3RoTvqwgnbmc5Qh2wsZuoAAzEwOQB9AAAABWQAIAAAAADQnslvt6Hm2kJPmqsTVYQHE/wWeZ4bE1XSkt7TKy0r1gVzACAAAAAA8URTA4ZMrhHPvlp53TH6FDCzS+0+61qHm5XK6UiOrKEFbAAgAAAAAHQbgTCdZcbdA0avaTmZXUKnIS7Nwf1tNrcXDCw+PdBRAAMxMTAAfQAAAAVkACAAAAAAhujlgFPFczsdCGXtQ/002Ck8YWQHHzvWvUHrkbjv4rwFcwAgAAAAALbV0lLGcSGfE7mDM3n/fgEvi+ifjl7WZ5b3aqjDNvx9BWwAIAAAAACbceTZy8E3QA1pHmPN5kTlOx3EO8kJM5PUjTVftw1VpgADMTExAH0AAAAFZAAgAAAAABm/6pF96j26Jm7z5KkY1y33zcAEXLx2n0DwC03bs/ixBXMAIAAAAAD01OMvTZI/mqMgxIhA5nLs068mW+GKl3OW3ilf2D8+LgVsACAAAAAAaLvJDrqBESTNZSdcXsd+8GXPl8ZkUsGpeYuyYVv/kygAAzExMgB9AAAABWQAIAAAAACfw9/te4GkHZAapC9sDMHHHZgmlTrccyJDPFciOMSOcwVzACAAAAAAIIC1ZpHObvmMwUfqDRPl4C1aeuHwujM1G/yJbvybMNAFbAAgAAAAAAs9x1SnVpMfNv5Bm1aXGwHmbbI9keWa9HRD35XuCBK5AAMxMTMAfQAAAAVkACAAAAAAkxHJRbnShpPOylLoDdNShfILeA1hChKFQY9qQyZ5VmsFcwAgAAAAAKidrY+rC3hTY+YWu2a7fuMH2RD/XaiTIBW1hrxNCQOJBWwAIAAAAACW0kkqMIzIFMn7g+R0MI8l15fr3k/w/mHtY5n6SYTEwAADMTE0AH0AAAAFZAAgAAAAAByuYl8dBvfaZ0LO/81JW4hYypeNmvLMaxsIdvqMPrWoBXMAIAAAAABNddwobOUJzm9HOUD8BMZJqkNCUCqstHZkC76FIdNg9AVsACAAAAAAQQOkIQtkyNavqCnhQbNg3HfqrJdsAGaoxSJePJl1qXsAAzExNQB9AAAABWQAIAAAAABxMy7X5hf7AXGDz3Y/POu1ZpkMlNcSvSP92NOO/Gs7wAVzACAAAAAAHJshWo2T5wU2zvqCyJzcJQKQaHFHpCpMc9oWBXkpUPoFbAAgAAAAAGeiJKzlUXAvL0gOlW+Hz1mSa2HsV4RGmyLmCHlzbAkoAAMxMTYAfQAAAAVkACAAAAAAlqbslixl7Zw3bRlibZbe/WmKw23k8uKeIzPKYEtbIy0FcwAgAAAAAHEKwpUxkxOfef5HYvulXPmdbzTivwdwrSYIHDeNRcpcBWwAIAAAAADuPckac21Hrg/h0kt5ShJwVEZ9rx6SOHd2+HDjqxEWTQADMTE3AH0AAAAFZAAgAAAAAMXrXx0saZ+5gORmwM2FLuZG6iuO2YS+1IGPoAtDKoKBBXMAIAAAAADIQsxCr8CfFKaBcx8kIeSywnGh7JHjKRJ9vJd9x79y7wVsACAAAAAAcvBV+SykDYhmRFyVYwFYB9oBKBSHr55Jdz2cXeowsUQAAzExOAB9AAAABWQAIAAAAAAm83FA9yDUpwkbKTihe7m53u+DivS9BU2b4vQMtCVQ2AVzACAAAAAAz3m1UB/AbZPa4QSKFDnUgHaT78+6iGOFAtouiBorEgEFbAAgAAAAAIgbpyYtJj5513Z5XYqviH/HXG/5+mqR52iBbfqMmDtZAAMxMTkAfQAAAAVkACAAAAAAJRzYK0PUwr9RPG2/7yID0WgcTJPB2Xjccp5LAPDYunkFcwAgAAAAAIIh24h3DrltAzNFhF+MEmPrZtzr1PhCofhChZqfCW+jBWwAIAAAAAAzRNXtL5o9VXMk5D5ylI0odPDJDSZZry1wfN+TedH70gADMTIwAH0AAAAFZAAgAAAAAHSaHWs/dnmI9sc7nB50VB2Bzs0kHapMHCQdyVEYY30TBXMAIAAAAACkV22lhEjWv/9/DubfHBAcwJggKI5mIbSK5L2nyqloqQVsACAAAAAAS19m7DccQxgryOsBJ3GsCs37yfQqNi1G+S6fCXpEhn4AAzEyMQB9AAAABWQAIAAAAAAC/I4TQRtCl12YZmdGz17X4GqSQgfwCPgRBwdHmdwu+QVzACAAAAAAx8f3z2ut/RAZhleari4vCEE+tNIn4ikjoUwzitfQ588FbAAgAAAAAJci0w1ZB8W2spJQ+kMpod6HSCtSR2jrabOH+B0fj3A4AAMxMjIAfQAAAAVkACAAAAAADGB5yU2XT0fse/MPWgvBvZikVxrl5pf3S5K1hceKWooFcwAgAAAAAIxTmlLHMjNaVDEfJbXvRez0SEPWFREBJCT6qTHsrljoBWwAIAAAAAAlswzAl81+0DteibwHD+CG5mZJrfHXa9NnEFRtXybzzwADMTIzAH0AAAAFZAAgAAAAABmO7QD9vxWMmFjIHz13lyOeV6vHT6mYCsWxF7hb/yOjBXMAIAAAAACT9lmgkiqzuWG24afuzYiCeK9gmJqacmxAruIukd0xEAVsACAAAAAAZa0/FI/GkZR7CtX18Xg9Tn9zfxkD0UoaSt+pIO5t1t4AAzEyNAB9AAAABWQAIAAAAAAfPUoy7QyZKhIIURso+mkP9qr1izbjETqF5s22GwjCjAVzACAAAAAAvLMsIDQ/go4VUxeh50UHmsvMvfx51cwyONnRD2odvC0FbAAgAAAAAKMb+1CodEalAFnDrEL1Ndt8ztamZ+9134m9Kp3GQgd+AAMxMjUAfQAAAAVkACAAAAAAE3ZqUar0Bq2zWbARE0bAv98jBlK9UJ73/xcwdMWWlSkFcwAgAAAAAK4M+MmC+9sFiFsumMyJZQKxWmmJiuG9H7IzKw083xxkBWwAIAAAAAAqkAONzhvMhkyL1D/6h7QQxEkdhC3p2WjXH+VGq5qCqQADMTI2AH0AAAAFZAAgAAAAAMo8FJiOq63cAmyk2O7eI7GcbQh/1j4RrMTqly3rexftBXMAIAAAAADjVmpd0WiRGTw/gAqEgGolt2EI7Csv14vKdmYoMD0aAgVsACAAAAAA07XQBzBUQMNw7F2/YxJjZNuPVpHTTgbLd1oGk77+bygAAzEyNwB9AAAABWQAIAAAAACu5IGaIx7A3Jvly/kzlCsSA4s3iJwuIl8jEdRH0k93NwVzACAAAAAA9NRUyxYE+t0Xyosyt6vIfMFW/vBoYg6sR+jBNs4JAxIFbAAgAAAAAAzyZ91dx+0oMlOVAjRGiMrPySikY/U9eMEB4WJb3uWtAAMxMjgAfQAAAAVkACAAAAAALkRy0GJInXYLA+cgjs6Myb0a+Gu9hgXhHvhLNoGWfckFcwAgAAAAANbALyt9zCSvwnLaWCd2/y2eoB7qkWTvv1Ldu8r40JPuBWwAIAAAAAD4Fl5bV5sz4isIE9bX+lmAp+aAKaZgVYVZeVfrItkCZAADMTI5AH0AAAAFZAAgAAAAAGoUK/DSWhT8LZhszSUqDbTrp8cSA7rdqmADKL+MILtTBXMAIAAAAABHnEE9bVa6lvhfhEMkkV2kzSSxH/sMW/FIJuw3CzWs6wVsACAAAAAAanavcBdqZxgRGKvEK95wTmeL1K1CeDSXZsXUAs81uOgAAzEzMAB9AAAABWQAIAAAAAC922ZDQE3h2fQKibGMZ9hV0WNlmrPYYSdtaSyYxsWYqgVzACAAAAAAagMovciKK6WVjIc2cCj8nK5O/gVOFFVeVAJpRp89tmQFbAAgAAAAAKcTFfPQzaFiAtSFhqbN02sCE1BKWJSrRfGN5L6oZwzkAAMxMzEAfQAAAAVkACAAAAAAtK+JqX3K/z2txjAU15DgX4y90DS2YLfIJFolCOkJJJwFcwAgAAAAAMnR5V7gfX7MNqqUdL5AkWlkhyFXaBRVNej+Rcn8lrQkBWwAIAAAAAA2cDNRXZuiC241TGRvdFyctJnrNcdbZOP9zHio81tkngADMTMyAH0AAAAFZAAgAAAAAAeGrIMK/bac6kPczxbvRYqKMkcpeI2FjdMpD91FDWIvBXMAIAAAAAAix62z1LeS8yvSXCl5gHSIomjyx76fF3S1lp9k900hygVsACAAAAAAiYwzf2m71aWFD5ajcXyW2JX2EzQOkBroTGMg29nLPYIAAzEzMwB9AAAABWQAIAAAAACphf298InM0Us4HT8o1W1MGw0D/02vd7Jh+U0h7qaFaQVzACAAAAAAFXtk7YpqsOJxsqGWSIL+YcBE96G3Zz9D31gPqDW94y8FbAAgAAAAAAOrS1KVA94rjB1jZ1pPocpCeBG+B14RzWoHqVDpp7JbAAMxMzQAfQAAAAVkACAAAAAATLDS2cuDVM3yDMuWNgk2iGKBTzPpfJMbvxVOSY39ZfcFcwAgAAAAAPT5wRi2cLHIUflXzm6EQB/m7xdThP80ir1VV/JBBqvxBWwAIAAAAAB9lEtZS0aXCFbCtSbhnis27S5IPcfWGygHW8AHn3QqzwADMTM1AH0AAAAFZAAgAAAAAJNjExiZVX7jfFGfYpQu16qxLN0YPqVU/5CQ/Y67YSinBXMAIAAAAABMpm2+6KrkRUlXzQoMPHrQmIO6dkQz66tYdfTeA3dKqQVsACAAAAAAFXobHiMLvNZuEPr8jtewCX2J93EZG3JNeyVg92fue6YAAzEzNgB9AAAABWQAIAAAAABlFkYtLCx901X6QVVMkSn6Z7k30UF4xHaA0OZJJ9bdyQVzACAAAAAATez+F9GHcGzTp7jjv4feboUNb8JCkIp4EqcPFisnq7MFbAAgAAAAACE7JvOpBgMoZ7kRd4QbxIhxukPTUxXpzhjnBHiR7XoRAAMxMzcAfQAAAAVkACAAAAAA8NJKN0IxZnruhswGQkiruv8Ih0EMwDcSZx/Xasup9dkFcwAgAAAAAKaJZRxzA+Igeydvuk6cSwUHXcrmT4PjhuPu//FslpdnBWwAIAAAAAD53Rok1Vq/PMAnXmarqoHJ0PEyYUBmVESa9hIpCv/G9QADMTM4AH0AAAAFZAAgAAAAABHxHdEClz7hbSSgE58+dWLlSMJnoPz+jFxp4bB1GmLQBXMAIAAAAAD3nSvT6aGD+A110J/NwEfp0nPutlmuB5B+wA3CC3noGAVsACAAAAAA3Apjd+TapONB7k5wBVwTWgn8t+Sq2oyyU5/+as109RcAAzEzOQB9AAAABWQAIAAAAAC/o8qW/ifk3KuJ01VFkyNLgQafxB5/bGs2G5VyyVafOwVzACAAAAAA1bMqAFGDHSl6BYNLbxApvkAv2K1/oafywiX0MDz1dGUFbAAgAAAAAHJXLlId3edFoniLD/9K2A5973MeP2Ro31flDyqm3l5QAAMxNDAAfQAAAAVkACAAAAAAY2V8I1bz3a1AxTtmED6UhdhA09huFkuuEX8R+d/WDPUFcwAgAAAAAPTVoNRiI76tcRKqd+JBBVyy4+YcKST42p0QX2BtmQ2VBWwAIAAAAACcxt9hg14WqPNiDv1MkqVljM2e2KJEv53lA17LhV6ZigADMTQxAH0AAAAFZAAgAAAAAO2kSsW0WGN9AOtK4xK2SHrGhWiaAbMEKT4iZkRpaDN/BXMAIAAAAABKGzQcPM8LT2dwOggxoWjv/1imYWabbG/G4kBw8OWaxAVsACAAAAAAC9hLK1dScQTAqg+YAG3ObdPzg2Xet57HmOFpGmyUR9UAAzE0MgB9AAAABWQAIAAAAAAiCwzNEEaH/mDam68IdDftnhthyUFdb+ZCNSBQ91WlHQVzACAAAAAA7tHyHcxCzmbJeFYZyPm4mEgkTGKOvwY4MX82OvH0Jn8FbAAgAAAAAAb5IAbZ1hXCNegQ+S+C9i/Z8y6sS8KeU04V6hXa2ml6AAMxNDMAfQAAAAVkACAAAAAAGuCHVNJSuoVkpPOnS5s89GuA+BLi2IPBUr2Bg1sWEPIFcwAgAAAAAEl1gncS5/xO7bQ/KQSstRV3rOT2SW6nV92ZANeG2SR6BWwAIAAAAAA9LOcKmhek8F2wAh8yvT/vjp2gaouuO+Hmv10lwAeWPAADMTQ0AH0AAAAFZAAgAAAAAMfxz7gEaoCdPvXrubDhCZUS0ARLZc1svgbXgMDlVBPgBXMAIAAAAAB6a5dDA3fuT5Vz2KvAcbUEFX/+B7Nw2p1QqbPoQ5TTuAVsACAAAAAAcf/y75UOuI62A6vWH7bYr/5Jz+nirZVYK/81trN6XOQAAzE0NQB9AAAABWQAIAAAAACnYsqF/VzmjIImC9+dqrHO1TM6lJ6fRwM0mM6Wf6paOwVzACAAAAAA5tgZzch8uDCR1ky3SllVaKVpxAlbrhvlNDTazZZRZOAFbAAgAAAAALeGiLJS4z2zhgVpxzyPdRYyACP9QzQBOob34YrIZumCAAMxNDYAfQAAAAVkACAAAAAAEC0sIVmadtW4YMuRXH7RpAhXclsd+3bmqGXCMeaT014FcwAgAAAAABPpXh0uzpsJJB+IRUNajmMB9WGwswfpw5T9xk3Xj6ANBWwAIAAAAAAmf+NYh9TZ/QRu3w/GQz66n7DtfbJijN3G7KzeL8lstAADMTQ3AH0AAAAFZAAgAAAAABaIB3n49Xm9cOafSrQsE0WCcYp8rMIO/qVwIlMF5YLRBXMAIAAAAAC9EyWJV3xOu9bzgdJ/yX+ko7qLf1u3AxNMataW2C9EzQVsACAAAAAAvVbDkLxXx2DcMLifIQ3K0IIJcLcAG9DUrNfI6aoUjNcAAzE0OAB9AAAABWQAIAAAAAA5rZItA/cocRnngYqcJ3nBXQ+l688aKz3EQyLbYYunPAVzACAAAAAAwKyA+L7TgxztPClLrIMk2JXR+w7c04N3ZOqPgjvrIvsFbAAgAAAAACzvZ33h6aWEe8hmo+1f6OXJ72FY5hvWaUuha64ZV3KFAAMxNDkAfQAAAAVkACAAAAAA3htn7oHJ0YYpIrs+Mzyh85Ys67HwAdv5LQl1mCdoMWkFcwAgAAAAAEHjCtNNLenHuSIYux6ezAHsXDaj2DlTF67ToDhDDe6HBWwAIAAAAAD+P4H0sk9jOd+7vOANt2/1Ectb+4ZRGPE8GkHWNXW3MgADMTUwAH0AAAAFZAAgAAAAAEnt18Km/nqggfIJWxzTr9r3hnXNaueG6XO9A5G11LnGBXMAIAAAAAD7QxzGMN/ard5TfFLecE6uusMmXG2+RBsBR+/NCQHUwAVsACAAAAAAQEZ1ZZ8GC8rdbg7s87OM5Gr9qkTXS9+P5DuAZxj5Gl4AAzE1MQB9AAAABWQAIAAAAAAVAKK/GoY8AACu/hyMpO4hdLq6JnEyWNzkyci9sbaD/wVzACAAAAAA2HmeqpMlvvBpV2zQTYIRmsc4MFlfHRwLof0ycJgMg/MFbAAgAAAAACdltCeWi5E/q1Li1eXLChpM2D9QQSGLBZ82NklQSc0oAAMxNTIAfQAAAAVkACAAAAAAhHyq1GQC/GiMwpYjcsfkNxolJ10ARKjIjfkW1Wipzi0FcwAgAAAAAD/uaGWxTDq87F8XZ6CrFI+RNa8yMqfSZdqK00Kj833BBWwAIAAAAAD6aEdOO0CsQGagioOCvANPCEHSpJ8BSixlPBq5ERhB7AADMTUzAH0AAAAFZAAgAAAAABAJJxHoZD+MQBWqm9UM9Dd3z5ZohIZGWRaRVRsMptKQBXMAIAAAAADrE/ca+gqj/SH4oao4wE4qn2ovoTydzcMbDbrfnUs3zAVsACAAAAAAeNCIQN6hVnGJinytQRFGlQ2ocoprXNqpia+BSxzl+uwAAzE1NAB9AAAABWQAIAAAAAAv01wz7VG9mTepjXQi6Zma+7b/OVBaKVkWNbgDLr1mFgVzACAAAAAA0I5sxz8r6wkCp5Tgvr+iL4p6MxSOq5d3e1kZG+0b7NkFbAAgAAAAAIA32v6oGkAOS96HexGouNTex+tLahtx9QF2dgGClk6WAAMxNTUAfQAAAAVkACAAAAAAWXecRwxSon68xaa9THXnRDw5ZfzARKnvvjTjtbae6T0FcwAgAAAAAPh0UfUMEo7eILCMv2tiJQe1bF9qtXq7GJtC6H5Va4fIBWwAIAAAAADqFr1ThRrTXNgIOrJWScO9mk86Ufi95IDu5gi4vP+HWQADMTU2AH0AAAAFZAAgAAAAAEY5WL8/LpX36iAB1wlQrMO/xHVjoO9BePVzbUlBYo+bBXMAIAAAAABoKcpadDXUARedDvTmzUzWPe1jTuvD0z9oIcZmKuiSXwVsACAAAAAAJuJbwuaMrAFoI+jU/IYr+k4RzAqITrOjAd3HWCpJHqEAAzE1NwB9AAAABWQAIAAAAADnJnWqsfx0xqNnqfFGCxIplVu8mXjaHTViJT9+y2RuTgVzACAAAAAAWAaSCwIXDwdYxWf2NZTly/iKVfG/KDjHUcA1BokN5sMFbAAgAAAAAJVxavipE0H4/JQvhagdytXBZ8qGooeXpkbPQ1RfYMVHAAMxNTgAfQAAAAVkACAAAAAAsPG7LaIpJvcwqcbtfFUpIjj+vpNj70Zjaw3eV9T+QYsFcwAgAAAAAJQ71zi0NlCyY8ZQs3IasJ4gB1PmWx57HpnlCf3+hmhqBWwAIAAAAACD58TO6d+71GaOoS+r73rAxliAO9GMs4Uc8JbOTmC0OwADMTU5AH0AAAAFZAAgAAAAAAGiSqKaQDakMi1W87rFAhkogfRAevnwQ41onWNUJKtuBXMAIAAAAAASgiDpXfGh7E47KkOD8MAcX8+BnDShlnU5JAGdnPdqOAVsACAAAAAAI+2TTQIgbFq4Yr3lkzGwhG/tqChP7hRAx2W0fNaH6jcAAzE2MAB9AAAABWQAIAAAAAB7L4EnhjKA5xJD3ORhH2wOA1BvpnQ+7IjRYi+jjVEaJAVzACAAAAAAuhBIm0nL3FJnVJId+7CKDASEo+l2E89Z9/5aWSITK4AFbAAgAAAAALtSICOzQDfV9d+gZuYxpEj6cCeHnKTT+2G3ceP2H65kAAMxNjEAfQAAAAVkACAAAAAAaROn1NaDZFOGEWw724dsXBAm6bgmL5i0cki6QZQNrOoFcwAgAAAAANVT8R6UvhrAlyqYlxtmnvkR4uYK/hlvyQmBu/LP6/3ZBWwAIAAAAAD+aHNMP/X+jcRHyUtrCNkk1KfMtoD3GTmShS8pWGLt+AADMTYyAH0AAAAFZAAgAAAAADqSR5e0/Th59LrauDA7OnGD1Xr3H3NokfVxzDWOFaN7BXMAIAAAAACt30faNwTWRbvmykDpiDYUOCwA6QDbBBYBFWS7rdOB4AVsACAAAAAAF7SvnjjRk5v2flFOKaBAEDvjXaL1cpjsQLtK2fv9zdQAAzE2MwB9AAAABWQAIAAAAADmtb1ZgpZjSeodPG/hIVlsnS8hoRRwRbrTVx89VwL62AVzACAAAAAAi38e1g6sEyVfSDkzZbaZXGxKI/zKNbMasOl2LYoWrq8FbAAgAAAAAALACk0KcCDN/Kv8WuazY8ORtUGkOZ5Dsm0ys1oOppp/AAMxNjQAfQAAAAVkACAAAAAAf/f7AWVgBxoKjr7YsEQ4w/fqSvuQWV2HMiA3rQ7ur0sFcwAgAAAAADkkeJozP6FFhUdRIN74H4UhIHue+eVbOs1NvbdWYFQrBWwAIAAAAAB55FlHAkmTzAYj/TWrGkRJw2EhrVWUnZXDoMYjyfB/ZwADMTY1AH0AAAAFZAAgAAAAAI2WEOymtuFpdKi4ctanPLnlQud+yMKKb8p/nfKmIy56BXMAIAAAAADVKrJmhjr1rfF3p+T+tl7UFd1B7+BfJRk0e7a4im7ozgVsACAAAAAA5E7Ti3PnFiBQoCcb/DN7V1uM3Xd6VKiexPKntssFL7kAAzE2NgB9AAAABWQAIAAAAAAuHU9Qd79hjyvKOujGanSGDIQlxzsql8JytTZhEnPw+AVzACAAAAAAjF2gV/4+sOHVgDd/oR5wDi9zL7NGpGD+NsEpGXy/a4QFbAAgAAAAAJzMoyojYV6Ed/LpVN5zge93Odv3U7JgP7wxeRaJZGTdAAMxNjcAfQAAAAVkACAAAAAA7dQDkt3iyWYCT94d7yqUtPPwp4qkC0ddu+HFdHgVKEkFcwAgAAAAANuYvtvZBTEq4Rm9+5eb7VuFopowkrAuv86PGP8Q8/QvBWwAIAAAAACeqXoAOQOE4j0zRMlkVd8plaW0RX1npsFvB38Xmzv7sAADMTY4AH0AAAAFZAAgAAAAAAwnZSDhL4tNGYxlHPhKYB8s28dY5ScSwiKZm3UhT8U3BXMAIAAAAABDoY6dhivufTURQExyC9Gx3ocpl09bgbbQLChj3qVGbgVsACAAAAAAF+1nS7O0v85s3CCy+9HkdeoEfm2C6ZiNbPMMnSfsMHUAAzE2OQB9AAAABWQAIAAAAAC2VuRdaC4ZJmLdNOvD6R2tnvkyARteqXouJmI46V306QVzACAAAAAAMn1Z6B35wFTX9mEYAPM+IiJ5hauEwfD0CyIvBrxHg7IFbAAgAAAAAOG6DvDZkT9B/xZWmjao2AevN7MMbs3Oh9YJeSd/hZ+hAAMxNzAAfQAAAAVkACAAAAAAVerb7qVNy457rNOHOgDSKyWl5ojun7iWrv1uHPXrIZQFcwAgAAAAAIDcYS9j5z+gx0xdJj09L7876r/vjvKTi/d3bXDE3PhyBWwAIAAAAADuhVLqb1Bkrx8aNymS+bx2cL8GvLFNH4SAi690DUgnWQADMTcxAH0AAAAFZAAgAAAAAH/E44yLxKCJjuSmU9A8SEhbmkDOx1PqqtYcZtgOzJdrBXMAIAAAAABgLh9v2HjBbogrRoQ82LS6KjZQnzjxyJH4PH+F3jupSAVsACAAAAAAIlO46ehXp4TqpDV0t6op++KO+uWBFh8iFORZjmx2IjkAAzE3MgB9AAAABWQAIAAAAAAlNUdDL+f/SSQ5074mrq0JNh7CTXwTbbhsQyDwWeDVMwVzACAAAAAANIH2IlSNG0kUw4qz0budjcWn8mNR9cJlYUqPYdonucAFbAAgAAAAAJMrOUOyiu5Y3sV76zwEFct8L7+i8WGlQI2+8z2W2kzaAAMxNzMAfQAAAAVkACAAAAAASZ+CvUDtlk/R4HAQ3a+PHrKeY/8ifAfh0oXYFqliu80FcwAgAAAAAJelpzPgM65OZFt/mvGGpwibclQ49wH+1gbUGzd9OindBWwAIAAAAAD9qeDchteEpVXWcycmD9kl9449C1dOw0r60TBm5jK+cQADMTc0AH0AAAAFZAAgAAAAAN9fkoUVbvFV2vMNMAkak4gYfEnzwKI3eDM3pnDK5q3lBXMAIAAAAACnDkgVNVNUlbQ9RhR6Aot2nVy+U4km6+GHPkLr631jEAVsACAAAAAANzg/BnkvkmvOr8nS4omF+q9EG/4oisB+ul4YHi938hwAAzE3NQB9AAAABWQAIAAAAAASyK3b1nmNCMptVEGOjwoxYLLS9fYWm/Zxilqea0jpEQVzACAAAAAADDHsGrbqlKGEpxlvfyqOJKQJjwJrzsrB7k3HG0AUJbkFbAAgAAAAAKwx3S4XfDZh4+LuI9jf7XgUh5qiefNv87JD4qvVRfPSAAMxNzYAfQAAAAVkACAAAAAAlSP9iK31GlcG9MKGbLmq+VXMslURr+As736rrVNXcsUFcwAgAAAAAAvbj0zfq9zzi8XReheKFbCB+h9IsOLgXPPpI5vrEJNZBWwAIAAAAABXvoZhaQE7ogWjeBjceVkp03N20cKYP3TA8vuNsgpfAgADMTc3AH0AAAAFZAAgAAAAAOJNORH8Bev97gVU7y6bznOxJ+E6Qoykur1QP76hG1/7BXMAIAAAAAC+C1PtOOrSZgzBAGhr+dPe/kR0JUw9GTwLVNr61xC1aAVsACAAAAAAeA/L8MQIXkamaObtMPLpoDoi5FypA5WAPtMeMrgi0eQAAzE3OAB9AAAABWQAIAAAAAAKcHzLUomavInN6upPkyWhAqYQACP/vdVCIYpiy6U6HgVzACAAAAAATsR4KItY6R2+U7Gg6sJdaEcf58gjd1OulyWovIqfxKcFbAAgAAAAAFbm10ko67ahboAejQdAV0U2uA5OhZYdb8XUFJ8OL46LAAMxNzkAfQAAAAVkACAAAAAAqTOLiMpCdR59tLZzzIPqJvbCNvz2XQL9ust0qYaehtcFcwAgAAAAAArefox/3k5xGOeiw2m6NUdzuGxmPwcu5IFcj+jMwHgHBWwAIAAAAADLZGFJ7MQd5JXMgMXjqZO5LDLxcFClcXPlnRMWRn+1oAADMTgwAH0AAAAFZAAgAAAAAIPSqSeVzSRgNVNmrPYHmUMgykCY27NbdDUNhE5kx/SgBXMAIAAAAAAhX90nNfxyXmZe/+btZ7q6xMX4PFyj0paM1ccJ/5IUUQVsACAAAAAA419oHmD2W0SYoOMwhrhrp8jf68fg9hTkaRdCuVd3CN0AAzE4MQB9AAAABWQAIAAAAACLn5DxiqAosHGXIAY96FwFKjeqrzXWf3VJIQMwx1fl4gVzACAAAAAAindvU27nveutopdvuHmzdENBbeGFtI3Qcsr07jxmvm8FbAAgAAAAAPvl9pBStQvP4OGkN5v0MghUY6djm9n7XdKKfrW0l1sMAAMxODIAfQAAAAVkACAAAAAA7i2S6rHRSPBwZEn59yxaS7HiYBOmObIkeyCcFU42kf8FcwAgAAAAAGb3RSEyBmgarkTvyLWtOLJcPwCKbCRkESG4RZjVmY4iBWwAIAAAAADB2/wo5CSHR4ANtifY6ZRXNTO5+O8qP82DfAiAeanpZwADMTgzAH0AAAAFZAAgAAAAAFz+M+H/Z94mdPW5oP51B4HWptp1rxcMWAjnlHvWJDWrBXMAIAAAAACBFEOQyL7ZHu4Cq33QvXkmKuH5ibG/Md3RaED9CtG5HwVsACAAAAAAfggtJTprQ/yZzj7y5z9KvXsdeXMWP0yUXMMJqpOwI88AAzE4NAB9AAAABWQAIAAAAAAE7c2x3Z3aM1XGfLNk/XQ9jCazNRbGhVm7H8c2NjS5ywVzACAAAAAARJ9h8fdcwA19velF3L/Wcvi2rCzewlKZ2nA0p8bT9uwFbAAgAAAAAJtWe6b4wK2Hae2dZm/OEpYQnvoZjz4Sz5IgJC2wInecAAMxODUAfQAAAAVkACAAAAAAVoRt9B9dNVvIMGN+ea5TzRzQC+lqSZ8dd/170zU5o9cFcwAgAAAAAEwM95XZin5mv2yhCI8+ugtKuvRVmNgzzIQN0yi1+9aIBWwAIAAAAAAMGBq72n00rox3uqhxSB98mkenTGCdbbUF1gXrgottzgADMTg2AH0AAAAFZAAgAAAAAKRDkjyWv/etlYT4GyoXrmBED2FgZHnhc+l9Wsl06cH2BXMAIAAAAABohlpm3K850Vndf3NmNE0hHqDlNbSR8/IvMidQ3LnIZAVsACAAAAAAW42nGHa6q2MCAaaPVwaIDfr8QLyQwjKq23onZJYsqVsAAzE4NwB9AAAABWQAIAAAAAC3DFh5oklLCNLY90bgWm68dFXz65JpAZSp1K99MBTPAQVzACAAAAAAQgZecmxEUZVHoptEQClDwAf8smI3WynQ/i+JBP0g+kQFbAAgAAAAAEUSQGVnAPISD6voD0DiBUqyWKgt2rta0tjmoe+LNt6IAAMxODgAfQAAAAVkACAAAAAAQ5WKvWSB503qeNlOI2Tpjd5blheNr6OBO8pfJfPNstcFcwAgAAAAAKwHgQLSDJ5NwLBQbY5OnblQIsVDpGV7q3RCbFLD1U4/BWwAIAAAAACQ5nED99LnpbqXZuUOUjnO2HTphEAFBjLD4OZeDEYybgADMTg5AH0AAAAFZAAgAAAAAGfhFY3RGRm5ZgWRQef1tXxHBq5Y6fXaLAR4yJhrTBplBXMAIAAAAACKEF0ApLoB6lP2UqTFsTQYNc9OdDrs/vziPGzttGVLKQVsACAAAAAArOO6FyfNRyBi0sPT5iye7M8d16MTLcwRfodZq4uCYKEAAzE5MAB9AAAABWQAIAAAAAAIM73gPcgzgotYHLeMa2zAU4mFsr7CbILUZWfnuKSwagVzACAAAAAAJCSu98uV8xv88f2BIOWzt6p+6EjQStMBdkGPUkgN79cFbAAgAAAAAMGqPGMPxXbmYbVfSa/japvUljht1zZT33TY7ZjAiuPfAAMxOTEAfQAAAAVkACAAAAAAkWmHCUsiMy1pwZTHxVPBzPTrWFBUDqHNrVqcyyt7nO8FcwAgAAAAAMv2CebFRG/br7USELR98sIdgE9OQCRBGV5JZCO+uPMgBWwAIAAAAABt7qSmn3gxJu7aswsbUiwvO+G6lXj/Xhx+J/zQyZxzLAADMTkyAH0AAAAFZAAgAAAAAGInUYv0lP/rK7McM8taEHXRefk8Q2AunrvWqdfSV7UaBXMAIAAAAACE+WPxJ3gan7iRTbIxXXx+bKVcaf8kP4JD8DcwU0aL7wVsACAAAAAAUC4eTprX4DUZn2X+UXYU6QjtiXk+u57yoOPBbPQUmDkAAzE5MwB9AAAABWQAIAAAAACmHlg2ud3cplXlTsNTpvNnY6Qm1Fce0m899COamoDjaQVzACAAAAAArtJQeJIlepBWRU2aYar7+YGYVQ7dfDc1oxgTmA8r9q0FbAAgAAAAAOk45vg5VqZHAFCO3i0Z52SZi5RADf8NXwf68T5yad/DAAMxOTQAfQAAAAVkACAAAAAApzcWSAbZWV/Rq+ylRNqqlJqNVR4fhXrz4633/MQOQgcFcwAgAAAAAN/jz/bsEleiuCl+li83EWlG6UMHA8CyaOMRKCkXkSCPBWwAIAAAAAC3Sd+Qg+uFDKpGZHbrQgokXHQ1az1aFl4YK343OB6hcQAAEmNtAAAAAAAAAAAAABBwYXlsb2FkSWQAAAAAABBmaXJzdE9wZXJhdG9yAAEAAAASc3AAAQAAAAAAAAAQdGYAAQAAABNtbgD/////Y46NN8CHrb4J7f/fE214AP////9jjo03wIetvgnt/18A", - "subType": "06" - } - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": { - "$numberInt": "0" - }, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "rbf3AeBEv4wWFAKknqDxRW5cLNkFvbIs6iJjc6LShQY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "n+XAuFnP8Dov9TnhGFxNx0K/MnVM9WbJ7RouEu0ndO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yRXojuVdn5GQtD97qYlaCL6cOLmZ7Cvcb3wFjkLUIdM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DuIkdRPITRs55I4SZmgomAHCIsDQmXRhW8+MOznkzSk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SsBk+Et1lTbU+QRPx+xyJ/jMkmfG+QCvQEpip2YYrzA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "crCIzOd8KhHvvUlX7M1v9bhvU4pLdTc+X2SuqoKU5Ek=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YOWdCw4UrqnxkAaVjqmC4sKQDMVMHEpFGnlxpxdaU6E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "M3SShp81Ff8tQ632qKbv9MUcN6wjDaBReI0VXNu6Xh4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gzHlSPxpM0hT75kQvWFzGlOxKvDoiKQZOr19V6l2zXI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s3JnppOGYw9SL2Q1kMAZs948v2F5PrpXjGei/HioDWs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cG6+3Gk/zEH68P/uuuwiAUVCuyJwa1LeV+t29FlPPAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dupdvR3AyJtM+g9NDKiaLVOtGca387JQp8w+V03m7Ig=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JqEQc5svj2jTvZ6LLA5ivE+kTb/0aRemSEmxk4G7Zrg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "szcXXXKnob+p3SoM4yED2R920LeJ7cVsclPMFTe4CeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o1QoGVXmuBdHwHm7aCtGMlMVKrjFdYvJXpoq6uhIAZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Jfm5wPlqqLCJRGQIqRq2NGmpn7s0Vrih2H3YAOoI2YU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zMHLb8ARbsYo8Ld05bqnGFf1Usha6EGb8QKwdSAyps0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yQdtq9lh5pugL7/i0Bj/PuZUUBUIzf+7wj1rl5y736w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wGWVZdO7qIuyDg/BqDgqjgoQ02h5YYgwXQB1oCin2NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "by9HMLj6NTEpgztZ5HSN6GxImkXPcaFINYDzgZY33X8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tWo0vbasi7bXmn/MsOx13VC1IsWtpx/nYp0uj4iMzdA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tQQpndUYd5O87lOtrGjH3wl9VsOK0ray7RMasL90sBM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cQjXEDCMsOpKLLf+vlTgIHA+cbSJdzqhbSX9Wvh95aA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7yMpU48IxK9SzP2cx3VnTownGEwFmeFofuuFT97SuuY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kSOx1kz0CmBgzKQHZlo65ZUY1DIv9A99JRm+Us2y6Ew=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ubQpdPBe6/xvtr+AcXdfYLSvYCR4ot0tivehkCsupb4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xal+iCJ6FTefRQToyoNksc9NCZShyn04NDGi4IYrcoM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "d7jU4iOK50xHxlkSifcxlZFCM46TSgQzoYivxG3HNLY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJvl2nsBLBVzL3pp6sKWCL4UXeh3q/roYBJjSb74ve0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OIUCaKRvIx9t1w6Hxlz1IcQTdPNCfdRNwnnTm10W+X0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A9tvzsiElotOUVIB4CqfQp9mAwqvTM35YkmAR170aHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lI8gpK7hpb7c9x4RQugsxMnQay5LZJmwslZdvMx/dcE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dNCzh40U0XvdKnSDi3HRQOWQftEsDVqc4uUvsVFGoq8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IP+iwEBWBwVVZIdpaMu8k5+soFCz+TZkYn3drKZ9grE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnqyh6e0y5svHkJDShlN9CHV0WvMBE4QbtJpQw5ZCXc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "elEl42tbVDoRTLjAhZUFEtXiut4b3PVhg/1ZLZSQdtE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vHuu2FxwclMHqyE6JBYbTYgbEkB0dqb/JuaxsvfwsmY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xTf7NCe3Gf8QpE78HR5OknlLTKfs9J+RN9UZpH6fnso=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XiWSasRnJAulGR6+LCVD3mwRObXylqYWR9jvpywq12c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MZMxEQ5ikx0PG1YFIExv0UnTZogsvgeOEZTpzvBDn4w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yZMyMZBDrWbAhvnic7vvIYhmO9m5H2iuv0c8KNZrBzY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xxM14hTPY5j0vvcK2C7YAEjzdsfUTFHozHC0hEo1bxI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+01rqR1xVwkpGXcstbk1ItJqFVjH6Q8MGxEN3Cm9Y1A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xOpLV0Z2VTRJ3iWtnWZcsyjXubTIkYWo31cO+HV1o1k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BWUOLqgLBqc5NwxVlSV5H3KFQPXbCp7mdo+jF+8cJqY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fuQb1S6xZDGlrEbK+kI23aL53PP1PVNwqICnZNt9Yzg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfscnoibFttahLdPVC4Ee+47ewGFKpDSU7M6HX19bKE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rpSW2awybNVeKtat91VFxqbINoTfNhPfQAu+d73Xtf8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9M/CP9ccOIIj2LLFmE0GFDO0Ban2wsNalEXfM6+h+1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WrEMG49l1ye4MhXs5ZS9tz8P6h+hDvthIg/2wW9ne1Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ImNhbfeyfH8qIEeA5ic0s3dAQBdzzTBS+CPsNih9vZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dWP33YDSn04UKJN2ogh2Rui0iW/0q2y18OCDRVcfyoo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lYv0isAtfGh6H9tdp3cp2eHU7q2J+uk7QrgcxtK3w7Y=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VGMoamB/+7zTOYcY/pqJc96xlv2PdW4hwsIAEIslTDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yNeBWMF7BnD9wVwz2PgJsvWr77QiVvvWUvJF0+fqBug=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfpvObJ+tJBXSvqeN7vlOfmhYign635lciYAJIjUtY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dsen4NqjzVGjpjufiTMs3+gqeD09EbnuogPgxrJECwg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pxCWVM3sn19NsFEpgHbgLa+PmYlhN3mMiP0Wk8kJhYw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q11KNvJszjYIB9n9HcC+N4uz11a3eRj1L3BH9scKMDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A1PmkgcEToWh1JiVWE6mI5jUu7poxWWuCUt/cgRUUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qJo3Hu4PJeanL7XEaWXO/n3YsodhZyd+MJOOmB9Kpd8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BkBKLO8URFscfRY9Bav/1+L9mLohDgNr/MkZtGiraIs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rZq5WA3Hx3xthOyHAJXK//f8pE2qbz7YKu3TIMp9GFY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X07a/Lm80p5xd4RFs1dNmw+90tmPDPdGiAKVZkxd4zY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6YrBn2ofIw1b5ooakrLOwF41BWrps8OO0H9WH4/rtlE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0l86Ag5OszXpa78SlOUV3K9nff5iC1p0mRXtLg9M1s4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Hn6yuxFHodeyu7ISlhYrbSf9pTiH4TDEvbYLWjTwFO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zdf4y2etKBuIpkEU1zMwoCkCsdisfXZCh8QPamm+drY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rOQ9oMdiK5xxGH+jPzOvwVqdGGnF3+HkJXxn81s6hp4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "61aKKsE3+BJHHWYvs3xSIBvlRmKswmaOo5rygQJguUg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KuDb/GIzqDM8wv7m7m8AECiWJbae5EKKtJRugZx7kR0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Q+t8t2TmNUiCIorVr9F3AlVnX+Mpt2ZYvN+s8UGict8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJRZIpKxUgHyL83kW8cvfjkxN3z6WoNnUg+SQw+LK+k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnUsYjip8SvW0+m9mR5WWTkpK+p6uwJ6yBUAlBnFKMk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PArHlz+yPRYDycAP/PgnI/AkP8Wgmfg++Vf4UG1Bf0E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wnIh53Q3jeK8jEBe1n8kJLa89/H0BxO26ZU8SRIAs9Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4F8U59gzBLGhq58PEWQk2nch+R0Va7eTUoxMneReUIA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ihKagIW3uT1dm22ROr/g5QaCpxZVj2+Fs/YSdM2Noco=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EJtUOOwjkrPUi9mavYAi+Gom9Y2DuFll7aDwo4mq0M0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dIkr8dbaVRQFskAVT6B286BbcBBt1pZPEOcTZqk4ZcI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aYVAcZYkH/Tieoa1XOjE/zCy5AJcVTHjS0NG2QB7muA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sBidL6y8TenseetpioIAAtn0lK/7C8MoW4JXpVYi3z8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0Dd2klU/t4R86c2WJcJDAd57k/N7OjvYSO5Vf8KH8sw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I3jZ92WEVmZmgaIkLbuWhBxl7EM6bEjiEttgBJunArA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aGHoQMlgJoGvArjfIbc3nnkoc8SWBxcrN7hSmjMRzos=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "bpiWPnF/KVBQr5F6MEwc5ZZayzIRvQOLDAm4ntwOi8g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tI7QVKbE6avWgDD9h4QKyFlnTxFCwd2iLySKakxNR/I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XGsge0CnoaXgE3rcpKm8AEeku5QVfokS3kcI+JKV1lk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JQxlryW2Q5WOwfrjAnaZxDvC83Dg6sjRVP5zegf2WiM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YFuHKJOfoqp1iGVxoFjx7bLYgVdsN4GuUFxEgO9HJ5s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Z6vUdiCR18ylKomf08uxcQHeRtmyav7/Ecvzz4av3k4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SPGo1Ib5AiP/tSllL7Z5PAypvnKdwJLzt8imfIMSEJQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "m94Nh6PFFQFLIib9Cu5LAKavhXnagSHG6F5EF8lD96I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pfEkQI98mB+gm1+JbmVurPAODMFPJ4E8DnqfVyUWbSo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DNj3OVRLbr43s0vd+rgWghOL3FqeO/60npdojC8Ry/M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kAYIQrjHVu49W8FTxyxJeiLVRWWjC9fPcBn+Hx1F+Ss=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aCSO7UVOpoQvu/iridarxkxV1SVxU1i9HVSYXUAeXk4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Gh6hTP/yj1IKlXQ+Q69KTfMlGZjEcXoRLGbQHNFo/1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/gDgIFQ4tAlJk3GN48IS5Qa5IPmErwGk8CHxAbp6gs0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PICyimwPjxpusyKxNssOOwUotAUbygpyEtORsVGXT8g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4lu+cBHyAUvuxC6JUNyHLzHsCogGSWFFnUCkDwfQdgI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pSndkmoNUJwXjgkbkgOrT5f9nSvuoMEZOkwAN9ElRaE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tyW+D4i26QihNM5MuBM+wnt5AdWGSJaJ4X5ydc9iWTU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9Syjr8RoxUgPKr+O5rsCu07AvcebA4P8IVKyS1NVLWc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "67tPfDYnK2tmrioI51fOBG0ygajcV0pLo5+Zm/rEW7U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "y0EiPRxYTuS1eVTIaPQUQBBxwkyxNckbePvKgChwd0M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NWd+2veAaeXQgR3vCvzlI4R1WW67D5YsVLdoXfdb8qg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PY5RQqKQsL2GqBBSPNOEVpojNFRX/NijCghIpxD6CZk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lcvwTyEjFlssCJtdjRpdN6oY+C7bxZY+WA+QAqzj9zg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWE7XRNylvTwO/9Fv56dNqUaQWMmESNS/GNIwgBaEI0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ijwlrUeS8nRYqK1F8kiCYF0mNDolEZS+/lJO1Lg93C8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8KzV+qYGYuIjoNj8eEpnTuHrMYuhzphl80rS6wrODuU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wDyTLjSEFF895hSQsHvmoEQVS6KIkZOtq1c9dVogm9I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SGrtPuMYCjUrfKF0Pq/thdaQzmGBMUvlwN3ORIu9tHU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KySHON3hIoUk4xWcwTqk6IL0kgjzjxgMBObVIkCGvk4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hBIdS9j0XJPeT4ot73ngELkpUoSixvRBvdOL9z48jY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Tx6um0q9HjS5ZvlFhvukpI6ORnyrXMWVW1OoxvgqII0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zFKlyfX5H81+d4A4J3FKn4T5JfG+OWtR06ddyX4Mxas=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cGgCDuPV7MeMMYEDpgOupqyNP4BQ4H7rBnd2QygumgM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IPaUoy98v11EoglTpJ4kBlEawoZ8y7BPwzjLYBpkvHQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Pfo4Am6tOWAyZNn8G9W5HWWGC3ZWmX0igI/RRB870Ro=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fnTSjd7bC1Udoq6iM7UDnHAC/lsIXSHp/Gy332qw+/I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fApBgVRrTDyEumkeWs5p3ag9KB48SbU4Si0dl7Ns9rc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QxudfBItgoCnUj5NXVnSmWH3HK76YtKkMmzn4lyyUYY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sSOvwhKa29Wq94bZ5jGIiJQGbG1uBrKSBfOYBz/oZeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FdaMgwwJ0NKsqmPZLC5oE+/0D74Dfpvig3LaI5yW5Fs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sRWBy12IERN43BSZIrnBfC9+zFBUdvjTlkqIH81NGt4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/4tIRpxKhoOwnXAiFn1Z7Xmric4USOIfKvTYQXk3QTc=", - "subType": "00" - } - } - ] - }, - { - "_id": { - "$numberInt": "1" - }, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RGTjNVEsNJb+DG7DpPOam8rQWD5HZAMpRyiTQaw7tk8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I93Md7QNPGmEEGYU1+VVCqBPBEvXdqHPtTJtMOn06Yk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "GecBFQ1PemlECWZWCl7f74vmsL6eB6mzQ9n6tK6FYfs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QpjhZl+O1ORifgtCZuWAdcP6OKL7IZ2cA46v8FJcV28=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RlQWwhU+uVv0a+9IB5cUkEfvHBvOw3B1Sx6WfPWMqes=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ubb81XTC7U+4tcNzf1oYvOY6gR5hC2Izqx54f4GuJ0E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6M4Q5NMQ9TqNnjzGOxIkiUIY8TEL0I3XD1QnhefQUqU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BtInzk9t2FFMCEY6AQ7zN8jwrrZEs2irSv6q0Q4NaIw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6vxXfETu9cuBIpRBo3jUUU04mJIH/aAhLX8K6VI5Xv0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wXPCdS+q23zi1bkPnaVG2j0PsVtxdeSLJ//h6J1x8RU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KY3KkfBAsN2l80wbpj41G0gwBR5KmmFnZcagg7D3ENk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tI8NFAxXCX4VOnY5X73K6KI/Yspd3aR94KV39MhJlAw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "nFxH0UC3mATKA6Vboz+QX/hAjj19kF/SH6H5Cne7qC0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q8hYqIYaIi7nOdG/7qQZYnz8Bsacfi66M1nVku4SH08=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4saA92R4arp4anvD9xFtze+sNcQqTEhPHyl1h70A8NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DbIziOBRRyeQS6RtBR09E37LV+CTKrEjGoRMLSpG6eE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Fv80Plp/7w2gnVqrwawLd6qhJ10G4NCDm3re67cNq4Y=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "T/T2oiQCBBES4YN7EodzPRdabZSFlYIClHBym+bQUZE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ZQgHD3l46Ujqtbnj1VbbeM29C9wJzOhz+yZ/7XdSrxk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ltlFKzWvyZvHxDFOYDd/XXJ6kUiJj0ln2HTCEz2o4Z4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "flW8A7bltC1u8bzx0WJtxosGJdOVsJFfbx33jxnpFGg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SXO+92QbMKwUSG2t27ciunV1c3VvFkUuDmSczpRe008=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+KioGs1GM+xRBzFE67ePTWj04KMSE5/Y6qUF7nJ5kvU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L3xNVbh6YH+RzqABN+5Jgb7T234Efpn766DmUvxIxgg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hPF+60mBYPjh21dEmPlBhKgyc9S2qLtTkypYvnqP2Fc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EletRsETy2HcjaPIm2c8CkT7ch/P3pJJDC8hasepcSU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "r5bMXUaNKqLPxZ+TG9HYTG4aSDgcpim27rN8rQFkM0w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0Q7Erdr8+/S0wUEDDIqlS5XjBVWvhZY65K0uUDb6+Ns=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xEcnhXy35hbXNVBPOOt3TUHbxvKfQ48KjA9b6/rbMqQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "T8bEpiQNgsEudXvyKE9SZlSvbpV/LUaslsdqgSFltyo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hIoiaF2YjnxDbODfhFEB+JGZ5nf8suD3Shck5bwQ3N0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qnA6qzejeRJ0rsZaZ0zOvKAaXyxt5lpscKQNYFZNl4k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "anAKCL2DN/le2VaP0n2ucYSEH/DaaEH/8Sa4OqTZsRA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JCZlBJaFm618oWYSnT9Jr1MtwFVw4BZjOzO+5yWgR90=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yxyk4n9762WzcDVGnTn4jCqUnSMIVCrLDIjCX1QVj34=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fDI6fdKvDJwim5/CQwWZEzcrXE3LHgy7FTtffcC7tXE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Vex+gcz5T+WkzsVZQrkqUR2ryyZbnaOGuWpYvjN0zCw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8TLEXz+Gbbp6llHpZXVjLsdlYY9f6hrKpHVpyfDe0RY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7fTyt5BrunypS65TfOzFW2E2qdIuT4SLeDeGlbQoJCs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8fKGrkqN0/KuSjyXgDBmRauDKrSa//JBKRWHEB9xBf4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s4codmG7uN4ss6P357jL21lazEe90M9GOK5WrOknSV0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RkSpua8XF+NUdxVDU90EbLUTTyZFX3tt3atBTroFaRk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "LnTCuCDyAHK5B9KXzjtwGmWB+qergQk2OCjnIx9MI2A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cBFh0virAX4pVXf/udIGI2951i0+0aZAdJcBVGtYnT4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "G54X6myQXWZ5fw/G31en3QbdgfXzL9+hFTtJpnWMqDI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EdsiiuezcsFJFnYIyGjCOhnqMj1BOwTB5EFxN+ERUkg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dVH9MXLtk0WTwGQ3xmrhOqfropMUkDW3o6paNPGl3NU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sB3HqXKWY3pKbuEH8BTbfNIGfbY+7/ZbOc3XC+JRNNI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WHyDk62Xhqbo4/iie2aLIM4x2uuAjv6102dJSHI58oM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pNUFuHpeNRDUZ/NrtII2c6sNc9eGR1lIUlIyXKERA+0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UPa+pdCqnN0bfAptdzldQOSd01gidrDKy8KhWrpSKAI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "l+7dOAlo+HUffMqFYXL6pgUFeTbwOM9CjKQLxEoLtc4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SRnDXV/rN6C8xwMutv9E1luv3DOUio3VkgPr8Cpm7Ew=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QcH6gl+gX7xZ7OWhUNQMbndJy0Piz49pDo6RsnLkVSA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "t+uL4DnfsI/Zll/KXWW1cOKX3Hu8WIkm3pt9efCVSAQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "myutHDctku/+Uug/nD8gRbYvmx/IovtoAAC2/fz2oHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6C+cjD0e0nSCP6cPqQYbNG7SlOd6Mfvi8hyfm7Ng+D8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zg01JSoOj9oBKT0S1ldJucXzY5AKgreS+h2xJreWTOs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7qQ80/FjodHl1m1py/Oii0/9C/xWbLdhaRXQ+kkCP10=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YwWMNH07vL6c5Nhg+MRnVByhzUunu8y0VLM9z/XvR5U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Dle8bU98+fudAbc14SToZFkwvV3tcYVsjDug0NWljpc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "J+eKL1vPJmlzltvhI6Li5Fz/TJmi3Ng+ehRTcs46API=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zB3XzfFygLwC3WHkj0up+VbEd25KKoce1vOpG/5bwK4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vnVnmOnL+z2pqwE+A6cVKS0Iwy4F4/2IiElJca9bUQM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+lG5r/Fpqry3BtFuvY67+RntmHAMDoLVOSGc6ZoXPb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L5MXQertqc6uj7ADe8aWKbd1sYHPCE7P1VYVg9Zc3VI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "imKONuZgopt0bhM3GMX2WVPwQYMTobuUUEdhcLfHs4c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "eOkU1J1uVbiVFWBerbXsSIVcF2nqiicTkFy4x7kFHB8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gI0uDhXeoH/UatDQKEf4qo8FHzWZDhb/wuWTqbq/ID4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cOkd5Aa3btYhtojE/smsF/PJnULqQ4NNqTkU6KXTFmo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "AWNJMs1MTe294oFipp8Y6P0CjpkZ4qCZoClQF3XcHq8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6gJtlzXOFhGYrVbTuRMmvMlDTwXdNtR9aGBlHZPwIMw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "LEmwVGA/xsEG7UrcOoYLFu6KCXgijzFznenknuDacm8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "mIRFPTXRrGaPtp/Ydij2jgkRe4uoUvAKxW2d8b9zYL0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "B+Uv2u48WALOO0L311z+eryjYQzKJVMfdHMZPhOAFmY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "INXXp0wDyVCq+NtfIrrC2ciETmyW/dWB/48/u4yLEZ4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "se7DGo8XrlrQDLEcco1tZrQt9kDe+0RTyl2bw/quG4w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vr0m2+Zk9lbN6UgWCyn8xJWJOokU3IDYab5U5q1+CgQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XI+eJ8Gy2JktG1gICgoj1qpsfy1tKmH0kglWbaQH6DA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A+UCuNnuAUqnQzspA6TVqUPRmtZmpSex5HFw7THRxs0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xaH2Ehfljd19uo0Fvb3iwkdaiWEVQd2YPoitgEPkhSM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "S/iZBJGcc8+qZxyMtab65MMBoSglybwk3x58Nb86gnY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "w14ZE5qqY5YgkS4Zcs9YNbrQbY1XfGOOHNn9bOYnFVQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0MhGd/jEF1vjkKGp+ZMn9SjLK54jkp9W4Hg+Sp/oxaI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "92QZ73e/NRTYgCm4aifaKth6aAsKnLLccBc0zx/qUTY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WOjzemCgFJOiGIp81RSVh/tFlzSTj9eFWcBnsiv2Ycs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DrsP9CmfKPjw5yLL8bnSeAxfNzAwlb+Z8OqCiKgBY7o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lMogqg8veBv6mri3/drMe9afJiKMvevkmGcw9BedfLo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "TxqwNcY8Tg2MPpNdkPBwvfpuTttSYRHU26DGECKYQ9o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "l0u1b4b4vYACWIwfnB7PZac4oDEgjQZCzHruNPTgAIY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "iVSGQ+cCfhbWIrY/v/WBORK92elu9gfRKyGhr6r/k00=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yK1forG50diEXte8ECzjfpHeYsPyuQ/dgxbxn/nzY5k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gIfTLCD3VwnOwkC0zPXWTqaITxX6ZplA69PO2a6zolc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "O/Zxlgh3WqpzJ7+Sd8XWMVID4/GXJUUWaSqfgDUi3b0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ZQ6yv368zwahUqSUYH/StL0Qgz/TwS1CzlMjVDvCciI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "m2rPEYkjwyiKdonMrKlcF7hya4lFOAUwEePJ3SgrNx8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Mq0yl5iVKlq71bT/dT/fXOWf2n90bTnXFnOdGDN0JOc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6qDGMXipPLC2O6EAAMjO2F9xx4rdqZso4IkPpH2304U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jvQHRQQa2RIszE2LX2Hv2LbRhYawJ6qmtRt8HZzFQXg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ovJXQrkZlpeHRciKyE/WWNm5O389gRgzx1W+Dw596X4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "a4kgRNvYctGYqyQv9qScL/WkljTYVylJ9pE9KDULlxU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qV4Q48vPiCJMTjljotzYKI/zfExWpkKOSHGcAjGyDig=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jtI7zbBF+QW/aYYTkn90zzyHLXLgmy7l1bzgMb2oqic=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q0KmJl9txPdn962UNvnfe6UFhdk9YaFZuTm33F+csso=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ULNdEqeZJgtmNOhN/Y9INzsE9AnxWYwOMn+pIbRXIFs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "R4oz9+wkdjpKe5tE1jpG7IURAnfvS5fLP4LrD5cZfTE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qG5Z7VhwSu/HT/YFTgDzyAAzJKq51xPw2HeEV5btYC4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OM/1DmIIZ5Qyhtq8TGkHTBEMVKjAnKRZMRXYtTG8ctc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2R5vZbljLXnDFA99YfGuRB7pAdPJVKsT25zLNMC0fUk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OMbavF2EmdAz1fHkLV3ctFEUDfriKhoT2gidwHZ9z1o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MWT4Zrw3/vVvTYMa1Is5Pjr3wEwnBfnEAPPUAHKQhNU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tBkRPfG9yxfKocQx5pAJX0oEHKPL0Tgtr+0UYe09InE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lqxpnDR/H0YgH7RcfKoNoaaRhe1SIazIeMbQ1fu9y3Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "utT1UdR22PWOTrOkZauztX613lAplV4eh/ejTRb7ZSk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "S+Y2yFyKi/a6FXhih4yGo29X8I8OT6/zwEoX6NMKT4o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QSjVppg29x6oS5yBg8OFjrFt0tuTpWCuKxfIy0k8YnE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "y3r6/Xsfvsl3HksXlVYkJgHUqpQGfICxg3x9f8Zw1qM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BSltHzEwDjFN4du9rDHAPvl22atlcTioEtt+gC5L1tk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0arGXjSN0006UnXbrWsGqhvBair569DeFDUME3Df3rA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s/DumaMad08S+PBUUcrS+v42K0z8HgcdiQtrFAEu2Qs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EzJ8Y8N0OQBTlnvrK82PdevDNZZO4E6CNgYVu8Cj6Ks=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VA4vr8jBPI5QdiPrULzzZjBMIUbG3V7Slg5zm0bFcKc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YAOvEB2ZLtq9LQiFViBHWaxxWVVonC2rNYj9tN9s3L0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hgaHMo9aAGS+nBwvqnTjZO+YkiQPY1c1XcIYeaYKHyI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YvaoLt3ZpH0atB0tNzwMjpoxRYJXl0DqSjisMJiGVBE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EMmW6CptFsiLoPOi5/uAJQ2FmeLg6mCpuVLLrRWk7Mc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1jQsNMarSnarlYmXEuoFokeBMg/090qUD9wqo1Zn8Gs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hupXNKhRpJxpyDAAP1TgJ5JMZh9lhbMk6s7D7dMS3C8=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-Update.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-Update.json deleted file mode 100644 index b840d38347a..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Decimal-Update.json +++ /dev/null @@ -1,1910 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Decimal. Update.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$numberDecimal": "1" - } - } - } - }, - { - "name": "updateOne", - "arguments": { - "filter": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$numberDecimal": "0" - } - } - }, - "update": { - "$set": { - "encryptedDecimalNoPrecision": { - "$numberDecimal": "2" - } - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command_name": "update", - "command": { - "update": "default", - "ordered": true, - "updates": [ - { - "q": { - "encryptedDecimalNoPrecision": { - "$gt": { - "$binary": { - "base64": "DR1jAAADcGF5bG9hZACxYgAABGcAnWIAAAMwAH0AAAAFZAAgAAAAAJu2KgiI8vM+kz9qD3ZQzFQY5qbgYqCqHG5R4jAlnlwXBXMAIAAAAAAAUXxFXsz764T79sGCdhxvNd5b6E/9p61FonsHyEIhogVsACAAAAAAt19RL3Oo5ni5L8kcvgOJYLgVYyXJExwP8pkuzLG7f/kAAzEAfQAAAAVkACAAAAAAPQPvL0ARjujSv2Rkm8r7spVsgeC1K3FWcskGGZ3OdDIFcwAgAAAAACgNn660GmefR8jLqzgR1u5O+Uocx9GyEHiBqVGko5FZBWwAIAAAAADflr+fsnZngm6KRWYgHa9JzK+bXogWl9evBU9sQUHPHQADMgB9AAAABWQAIAAAAAD2Zi6kcxmaD2mY3VWrP+wYJMPg6cSBIYPapxaFQxYFdQVzACAAAAAAM/cV36BLBY3xFBXsXJY8M9EHHOc/qrmdc2CJmj3M89gFbAAgAAAAAOpydOrKxx6m2gquSDV2Vv3w10GocmNCFeOo/fRhRH9JAAMzAH0AAAAFZAAgAAAAAOaNqI9srQ/mI9gwbk+VkizGBBH/PPWOVusgnfPk3tY1BXMAIAAAAAAc96O/pwKCmHCagT6T/QV/wz4vqO+R22GsZ1dse2Vg6QVsACAAAAAAgzIak+Q3UFLTHXPmJ+MuEklFtR3eLtvM+jdKkmGCV/YAAzQAfQAAAAVkACAAAAAA0XlQgy/Yu97EQOjronl9b3dcR1DFn3deuVhtTLbJZHkFcwAgAAAAACoMnpVl6EFJak8A+t5N4RFnQhkQEBnNAx8wDqmq5U/dBWwAIAAAAACR26FJif673qpwF1J1FEkQGJ1Ywcr/ZW6JQ7meGqzt1QADNQB9AAAABWQAIAAAAAAOtpNexRxfv0yRFvZO9DhlkpU4mDuAb8ykdLnE5Vf1VAVzACAAAAAAeblFKm/30orP16uQpZslvsoS8s0xfNPIBlw3VkHeekYFbAAgAAAAAPEoHj87sYE+nBut52/LPvleWQBzB/uaJFnosxp4NRO2AAM2AH0AAAAFZAAgAAAAAIr8xAFm1zPmrvW4Vy5Ct0W8FxMmyPmFzdWVzesBhAJFBXMAIAAAAABYeeXjJEzTHwxab6pUiCRiZjxgtN59a1y8Szy3hfkg+gVsACAAAAAAJuoY4rF8mbI+nKb+5XbZShJ8191o/e8ZCRHE0O4Ey8MAAzcAfQAAAAVkACAAAAAAl+ibLk0/+EwoqeC8S8cGgAtjtpQWGEZDsybMPnrrkwEFcwAgAAAAAHPPBudWgQ+HUorLDpJMqhS9VBF2VF5aLcxgrM1s+yU7BWwAIAAAAAAcCcBR2Vyv5pAFbaOU97yovuOi1+ATDnLLcAUqHecXcAADOAB9AAAABWQAIAAAAACR9erwLTb+tcWFZgJ2MEfM0PKI9uuwIjDTHADRFgD+SQVzACAAAAAAcOop8TXsGUVQoKhzUllMYWxL93xCOkwtIpV8Q6hiSYYFbAAgAAAAAKXKmh4V8veYwob1H03Q3p3PN8SRAaQwDT34KlNVUjiDAAM5AH0AAAAFZAAgAAAAALv0vCPgh7QpmM8Ug6ad5ioZJCh7pLMdT8FYyQioBQ6KBXMAIAAAAADsCPyIG8t6ApQkRk1fX/sfc1kpuWCWP8gAEpnYoBSHrQVsACAAAAAAJe/r67N6d8uTiogvfoR9rEXbIDjyLb9EVdqkayFFGaYAAzEwAH0AAAAFZAAgAAAAAIW4AxJgYoM0pcNTwk1RSbyjZGIqgKL1hcTJmNrnZmoPBXMAIAAAAAAZpfx3EFO0vY0f1eHnE0PazgqeNDTaj+pPJMUNW8lFrAVsACAAAAAAP+Um2vwW6Bj6vuz9DKz6+6aWkoKoEmFNoiz/xXm7lOsAAzExAH0AAAAFZAAgAAAAAKliO6L9zgeuufjj174hvmQGNRbmYYs9yAirL7OxwEW3BXMAIAAAAAAqU7vs3DWUQ95Eq8OejwWnD0GuXd+ASi/uD6S0l8MM1QVsACAAAAAAb9legYzsfctBPpHyl7YWpPmLr5QiNZFND/50N1vv2MUAAzEyAH0AAAAFZAAgAAAAAOGQcCBkk+j/Kzjt/Cs6g3BZPJG81wIHBS8JewHGpgk+BXMAIAAAAABjrxZXWCkdzrExwCgyHaafuPSQ4V4x2k9kUCAqUaYKDQVsACAAAAAADBU6KefT0v8zSmseaMNmQxKjJar72y7MojLFhkEHqrUAAzEzAH0AAAAFZAAgAAAAAPmCNEt4t97waOSd5hNi2fNCdWEkmcFJ37LI9k4Az4/5BXMAIAAAAABX7DuDPNg+duvELf3NbLWkPMFw2HGLgWGHyVWcPvSNCAVsACAAAAAAS7El1FtZ5STh8Q1FguvieyYX9b2DF1DFVsb9hzxXYRsAAzE0AH0AAAAFZAAgAAAAAD4vtVUYRNB+FD9yoQ2FVJH3nMeJeKbi6eZfth638YqbBXMAIAAAAAANCuUB4OdmuD6LaDK2f3vaqfgYYvg40wDXOBbcFjTqLwVsACAAAAAA9hqC2VoJBjwR7hcQ45xO8ZVojwC83jiRacCaDj6Px2gAAzE1AH0AAAAFZAAgAAAAAJPIRzjmTjbdIvshG6UslbEOd797ZSIdjGAhGWxVQvK1BXMAIAAAAABgmJ0Jh8WLs9IYs/a7DBjDWd8J3thW/AGJK7zDnMeYOAVsACAAAAAAi9zAsyAuou2oiCUHGc6QefLUkACa9IgeBhGu9W/r0X8AAzE2AH0AAAAFZAAgAAAAAABQyKQPoW8wGPIqnsTv69+DzIdRkohRhOhDmyVHkw9WBXMAIAAAAAAqWA2X4tB/h3O1Xlawtz6ndI6WaTwgU1QYflL35opu5gVsACAAAAAAWI/Gj5aZMwDIxztqmVL0g5LBcI8EdKEc2UA28pnekQoAAzE3AH0AAAAFZAAgAAAAACB7NOyGQ1Id3MYnxtBXqyZ5Ul/lHH6p1b10U63DfT6bBXMAIAAAAADpOryIcndxztkHSfLN3Kzq29sD8djS0PspDSqERMqokQVsACAAAAAADatsMW4ezgnyi1PiP7xk+gA4AFIN/fb5uJqfVkjg4UoAAzE4AH0AAAAFZAAgAAAAAKVfXLfs8XA14CRTB56oZwV+bFJN5BHraTXbqEXZDmTkBXMAIAAAAAASRWTsfGOpqdffiOodoqIgBzG/yzFyjR5CfUsIUIWGpgVsACAAAAAAkgCHbCwyX640/0Ni8+MoYxeHUiC+FSU4Mn9jTLYtgZgAAzE5AH0AAAAFZAAgAAAAAH/aZr4EuS0/noQR9rcF8vwoaxnxrwgOsSJ0ys8PkHhGBXMAIAAAAACd7ObGQW7qfddcvyxRTkPuvq/PHu7+6I5dxwS1Lzy5XAVsACAAAAAA3q0eKdV7KeU3pc+CtfypKR7BPxwaf30yu0j9FXeOOboAAzIwAH0AAAAFZAAgAAAAAKvlcpFFNq0oA+urq3w6d80PK1HHHw0H0yVWvU9aHijXBXMAIAAAAADWnAHQ5Fhlcjawki7kWzdqjM2f6IdGJblojrYElWjsZgVsACAAAAAAO0wvY66l24gx8nRxyVGC0QcTztIi81Kx3ndRhuZr6W4AAzIxAH0AAAAFZAAgAAAAAH/2aMezEOddrq+dNOkDrdqf13h2ttOnexZsJxG1G6PNBXMAIAAAAABNtgnibjC4VKy5poYjvdsBBnVvDTF/4mmEAxsXVgZVKgVsACAAAAAAqvadzJFLqQbs8WxgZ2D2X+XnaPSDMLCVVgWxx5jnLcYAAzIyAH0AAAAFZAAgAAAAAF2wZoDL6/V59QqO8vdRZWDpXpkV4h4KOCSn5e7x7nmzBXMAIAAAAADLZBu7LCYjbThaVUqMK14H/elrVOYIKJQCx4C9Yjw37gVsACAAAAAAEh6Vs81jLU204aGpL90fmYTm5i5R8/RT1uIbg6VU3HwAAzIzAH0AAAAFZAAgAAAAAH27yYaLn9zh2CpvaoomUPercSfJRUmBY6XFqmhcXi9QBXMAIAAAAAAUwumVlIYIs9JhDhSj0R0+59psCMsFk94E62VxkPt42QVsACAAAAAAT5x2hCCd2bpmpnyWaxas8nSxTc8e4C9DfKaqr0ABEysAAzI0AH0AAAAFZAAgAAAAALMg2kNAO4AFFs/mW3In04yFeN4AP6Vo0klyUoT06RquBXMAIAAAAAAgGWJbeIdwlpqXCyVIYSs0dt54Rfc8JF4b8uYc+YUj0AVsACAAAAAAWHeWxIkyvXTOWvfZzqtPXjfGaWWKjGSIQENTU3zBCrsAAzI1AH0AAAAFZAAgAAAAALas/i1T2DFCEmrrLEi7O2ngJZyFHialOoedVXS+OjenBXMAIAAAAAA1kK0QxY4REcGxHeMkgumyF7iwlsRFtw9MlbSSoQY7uAVsACAAAAAAUNlpMJZs1p4HfsD4Q4WZ4TBEi6Oc2fX34rzyynqWCdwAAzI2AH0AAAAFZAAgAAAAAP1TejmWg1CEuNSMt6NUgeQ5lT+oBoeyF7d2l5xQrbXWBXMAIAAAAABPX0kj6obggdJShmqtVfueKHplH4ZrXusiwrRDHMOKeQVsACAAAAAAIYOsNwC3DA7fLcOzqdr0bOFdHCfmK8tLwPoaE9uKOosAAzI3AH0AAAAFZAAgAAAAAMrKn+QPa/NxYezNhlOX9nyEkN1kE/gW7EuZkVqYl0b8BXMAIAAAAABUoZMSPUywRGfX2EEencJEKH5x/P9ySUVrhStAwgR/LgVsACAAAAAAMgZFH6lQIIDrgHnFeslv3ld20ynwQjQJt3cAp4GgrFkAAzI4AH0AAAAFZAAgAAAAAMmD1+a+oVbiUZd1HuZqdgtdVsVKwuWAn3/M1B6QGBM3BXMAIAAAAACLyytOYuZ9WEsIrrtJbXUx4QgipbaAbmlJvSZVkGi0CAVsACAAAAAA4v1lSp5H9BB+HYJ4bH43tC8aeuPZMf78Ng1JOhJh190AAzI5AH0AAAAFZAAgAAAAAOVKV7IuFwmYP1qVv8h0NvJmfPICu8yQhzjG7oJdTLDoBXMAIAAAAABL70XLfQLKRsw1deJ2MUvxSWKxpF/Ez73jqtbLvqbuogVsACAAAAAAvfgzIorXxE91dDt4nQxYfntTsx0M8Gzdsao5naQqcRUAAzMwAH0AAAAFZAAgAAAAAKS/1RSAQma+xV9rz04IcdzmavtrBDjOKPM+Z2NEyYfPBXMAIAAAAAAOJDWGORDgfRv8+w5nunh41wXb2hCA0MRzwnLnQtIqPgVsACAAAAAAf42C1+T7xdHEFF83+c2mF5S8PuuL22ogXXELnRAZ4boAAzMxAH0AAAAFZAAgAAAAAFeq8o82uNY1X8cH6OhdTzHNBUnCChsEDs5tm0kPBz3qBXMAIAAAAABaxMBbsaeEj/EDtr8nZfrhhhirBRPJwVamDo5WwbgvTQVsACAAAAAAMbH453A+BYAaDOTo5kdhV1VdND1avNwvshEG/4MIJjQAAzMyAH0AAAAFZAAgAAAAAI8IKIfDrohHh2cjspJHCovqroSr5N3QyVtNzFvT5+FzBXMAIAAAAABXHXteKG0DoOMmECKp6ro1MZNQvXGzqTDdZ0DUc8QfFAVsACAAAAAA/w5s++XYmO+9TWTbtGc3n3ndV4T9JUribIbF4jmDLSMAAzMzAH0AAAAFZAAgAAAAAJkHvm15kIu1OtAiaByj5ieWqzxiu/epK6c/9+KYIrB0BXMAIAAAAACzg5TcyANk0nes/wCJudd1BwlkWWF6zw3nGclq5v3SJQVsACAAAAAAvruXHTT3irPJLyWpI1j/Xwf2FeIE/IV+6Z49pqRzISoAAzM0AH0AAAAFZAAgAAAAAAYSOvEWWuSg1Aym7EssNLR+xsY7e9BcwsX4JKlnSHJcBXMAIAAAAABT48eY3PXVDOjw7JpNjOe1j2JyI3LjDnQoqZ8Je5B2KgVsACAAAAAAU2815RR57TQ9uDg0XjWjBkAKvf8yssxDMzrM4+FqP6AAAzM1AH0AAAAFZAAgAAAAAGQxC9L1e9DfO5XZvX1yvc3hTLtQEdKO9FPMkyg0Y9ZABXMAIAAAAADtmcMNJwdWLxQEArMGZQyzpnu+Z5yMmPAkvgq4eAKwNQVsACAAAAAAJ88zt4Y/Hoqh+zrf6KCOiUwHbOzCxSfp6k/qsZaYGEgAAzM2AH0AAAAFZAAgAAAAADLHK2LNCNRO0pv8n4fAsxwtUqCNnVK8rRgNiQfXpHSdBXMAIAAAAACf16EBIHRKD3SzjRW+LMOl+47QXA3CJhMzlcqyFRW22AVsACAAAAAAMGz4fAOa0EoVv90fUffwLjBrQhHATf+NdlgCR65vujAAAzM3AH0AAAAFZAAgAAAAAHiZJiXKNF8bbukQGsdYkEi95I+FSBHy1I5/hK2uEZruBXMAIAAAAADE+lZBa8HDUJPN+bF6xI9x4N7GF9pj3vBR7y0BcfFhBAVsACAAAAAAGIEN6sfqq30nyxW4dxDgXr/jz5HmvA9T1jx/pKCn4zgAAzM4AH0AAAAFZAAgAAAAAI1oa2OIw5TvhT14tYCGmhanUoYcCZtNbrVbeoMldHNZBXMAIAAAAAAx2nS0Ipblf2XOgBiUOuJFBupBhe7nb6QPLZlA4aMPCgVsACAAAAAA9xu828hugIgo0E3de9dZD+gTpVUGlwtDba+tw/WcbUoAAzM5AH0AAAAFZAAgAAAAABgTWS3Yap7Q59hii/uPPimHWXsr+DUmsqfwt/X73qsOBXMAIAAAAACKK05liW5KrmEAvtpCB1WUltruzUylDDpjea//UlWoOAVsACAAAAAAcgN4P/wakJ5aJK5c1bvJBqpVGND221dli2YicPFfuAYAAzQwAH0AAAAFZAAgAAAAABOAnBPXDp6i9TISQXvcNKwGDLepZTu3cKrB4vKnSCjBBXMAIAAAAADjjzZO7UowAAvpwyG8BNOVqLCccMFk3aDK4unUeft5ywVsACAAAAAA4zkCd4k9gvfXoD1C7vwTjNcdVJwEARh8h/cxZ4PNMfgAAzQxAH0AAAAFZAAgAAAAAHN8hyvT1lYrAsdiV5GBdd5jhtrAYE/KnSjw2Ka9hjz9BXMAIAAAAAD794JK7EeXBs+D7yOVK7nWF8SbZ/7U8gZ7nnT9JFNwTAVsACAAAAAAg8Wt1HO3NhByq2ggux2a4Lo6Gryr24rEFIqh2acrwWMAAzQyAH0AAAAFZAAgAAAAAO93bPrq8bsnp1AtNd9ETnXIz0lH/2HYN/vuw9wA3fyFBXMAIAAAAABHlls5fbaF2oAGqptC481XQ4eYxInTC29aElfmVZgDUgVsACAAAAAANoQXEWpXJpgrSNK/cKi/m7oYhuSRlp1IZBF0bqTEATcAAzQzAH0AAAAFZAAgAAAAAL1YsAZm1SA0ztU6ySIrQgCCA74V6rr0/4iIygCcaJL6BXMAIAAAAADTXWTHWovGmUR1Zg9l/Aqq9H5mOCJQQrb/Dfae7e3wKAVsACAAAAAA5dunyJK6/SVfDD0t9QlNBcFqoZnf9legRjHaLSKAoQMAAzQ0AH0AAAAFZAAgAAAAAEoFAeHk0RZ9kD+cJRD3j7PcE5gzWKnyBrF1I/MDNp5mBXMAIAAAAACgHtc2hMBRSZjKw8RAdDHK+Pi1HeyjiBuAslGVNcW5tAVsACAAAAAAXzBLfq+GxRtX4Wa9fazA49DBLG6AjZm2XODStJKH8D0AAzQ1AH0AAAAFZAAgAAAAAAW+7DmSN/LX+/0uBVJDHIc2dhxAGz4+ehyyz8fAnNGoBXMAIAAAAAA6Ilw42EvvfLJ3Eq8Afd+FjPoPcQutZO6ltmCLEr8kxQVsACAAAAAAbbZalyo07BbFjPFlYmbmv0z023eT9eLkHqeVUnfUAUAAAzQ2AH0AAAAFZAAgAAAAANBdV7M7kuYO3EMoQItAbXv4t2cIhfaT9V6+s4cg9djlBXMAIAAAAABvz4MIvZWxxrcJCL5qxLfFhXiUYB1OLHdKEjco94SgDgVsACAAAAAAK2GVGvyPIKolF/ECcmfmkVcf1/IZNcaTv96N92yGrkEAAzQ3AH0AAAAFZAAgAAAAAMoAoiAn1kc79j5oPZtlMWHMhhgwNhLUnvqkqIFvcH1NBXMAIAAAAADcJTW7WiCyW0Z9YDUYwppXhLj4Ac1povpJvcAq+i48MQVsACAAAAAAIGxGDzoeB3PTmudl4+j6piQB++e33EEzuzAiXcqGxvUAAzQ4AH0AAAAFZAAgAAAAACI3j5QP7dWHpcT6WO/OhsWwRJNASBYqIBDNzW8IorEyBXMAIAAAAABxUpBSjXwCKDdGP9hYU+RvyR+96kChfvyyRC4jZmztqAVsACAAAAAAvBCHguWswb4X0xdcAryCvZgQuthXzt7597bJ5VxAMdgAAzQ5AH0AAAAFZAAgAAAAAKsbycEuQSeNrF8Qnxqw3x3og8JmQabwGqnDbqzFRVrrBXMAIAAAAACno/3ef2JZJS93SVVzmOZSN+jjJHT8s0XYq2M46d2sLAVsACAAAAAAAt5zLJG+/j4K8rnkFtAn8IvdUVNefe6utJ3rdzgwudIAAzUwAH0AAAAFZAAgAAAAAPXIcoO8TiULqlxzb74NFg+I8kWX5uXIDUPnh2DobIoMBXMAIAAAAADR6/drkdTpnr9g1XNvKDwtBRBdKn7c2c4ZNUVK5CThdQVsACAAAAAAJqOA1c6KVog3F4Hb/GfDb3jCxXDRTqpXWSbMH4ePIJsAAzUxAH0AAAAFZAAgAAAAAEa03ZOJmfHT6/nVadvIw71jVxEuIloyvxXraYEW7u7pBXMAIAAAAADzRlBJK75FLiKjz3djqcgjCLo/e3yntI3MnPS48OORhgVsACAAAAAAnQhx4Rnyj081XrLRLD5NLpWmRWCsd0M9Hl7Jl19R0h8AAzUyAH0AAAAFZAAgAAAAAKx8NLSZUU04pSSGmHa5fh2oLHsEN5mmNMNHL95/tuC9BXMAIAAAAAA59hcXVaN3MNdHoo11OcH1aPRzHCwpVjO9mGfMz4xh3QVsACAAAAAAYIPdjV2XbPj7dBeHPwnwhVU7zMuJ+xtMUW5mIOYtmdAAAzUzAH0AAAAFZAAgAAAAAHNKAUxUqBFNS9Ea9NgCZoXMWgwhP4x0/OvoaPRWMquXBXMAIAAAAABUZ551mnP4ZjX+PXU9ttomzuOpo427MVynpkyq+nsYCQVsACAAAAAALnVK5p2tTTeZEh1zYt4iqKIQT9Z0si//Hy1L85oF+5IAAzU0AH0AAAAFZAAgAAAAALfGXDlyDVcGaqtyHkLT0qpuRhJQLgCxtznazhFtuyn/BXMAIAAAAABipxlXDq14C62pXhwAeen5+syA+/C6bN4rtZYcO4zKwAVsACAAAAAAXUf0pzUq0NhLYagWDap4uEiwq5rLpcx29rWbt1NYMsMAAzU1AH0AAAAFZAAgAAAAANoEr8sheJjg4UCfBkuUzarU9NFoy1xwbXjs5ifVDeA9BXMAIAAAAABPoyTf6M+xeZVGES4aNzVlq7LgjqZXJ/QunjYVusGUEAVsACAAAAAA1hA2gMeZZPUNytk9K+lB1RCqWRudRr7GtadJlExJf8oAAzU2AH0AAAAFZAAgAAAAAKvDiK+xjlBe1uQ3SZTNQl2lClIIvpP/5CHwY6Kb3WlgBXMAIAAAAAANnxImq5MFbWaRBHdJp+yD09bVlcFtiFDYsy1eDZj+iQVsACAAAAAAWtsyO+FxMPSIezwsV1TJD8ZrXAdRnQM6DJ+f+1V3qEkAAzU3AH0AAAAFZAAgAAAAAF49IlFH9RmSUSvUQpEPUedEksrQUcjsOv44nMkwXhjzBXMAIAAAAADJtWGbk0bZzmk20obz+mNsp86UCu/nLLlbg7ppxYn7PgVsACAAAAAA3k0Tj/XgPQtcYijH8cIlQoe/VXf15q1nrZNmg7yWYEgAAzU4AH0AAAAFZAAgAAAAAOuSJyuvz50lp3BzXlFKnq62QkN2quNU1Gq1IDsnFoJCBXMAIAAAAAAqavH1d93XV3IzshWlMnzznucadBF0ND092/2ApI1AcAVsACAAAAAAzUrK4kpoKCmcpdZlZNI13fddjdoAseVe67jaX1LobIIAAzU5AH0AAAAFZAAgAAAAALtgC4Whb4ZdkCiI30zY6fwlsxSa7lEaOAU3SfUXr02XBXMAIAAAAACgdZ6U1ZVgUaZZwbIaCdlANpCw6TZV0bwg3DS1NC/mnAVsACAAAAAAzI49hdpp0PbO7S2KexISxC16sE73EUAEyuqUFAC/J48AAzYwAH0AAAAFZAAgAAAAAF6PfplcGp6vek1ThwenMHVkbZgrc/dHgdsgx1VdPqZ5BXMAIAAAAACha3qhWkqmuwJSEXPozDO8y1ZdRLyzt9Crt2vjGnT7AAVsACAAAAAA7nvcU59+LwxGupSF21jAeAE0x7JE94tjRkJfgM1yKU8AAzYxAH0AAAAFZAAgAAAAAKoLEhLvLjKc7lhOJfx+VrGJCx9tXlOSa9bxQzGR6rfbBXMAIAAAAAAIDK5wNnjRMBzET7x/KAMExL/zi1IumJM92XTgXfoPoAVsACAAAAAAFkUYWFwNr815dEdFqp+TiIozDcq5IBNVkyMoDjharDQAAzYyAH0AAAAFZAAgAAAAADoQv6lutRmh5scQFvIW6K5JBquLxszuygM1tzBiGknIBXMAIAAAAADAD+JjW7FoBQ76/rsECmmcL76bmyfXpUU/awqIsZdO+wVsACAAAAAAPFHdLw3jssmEXsgtvl/RBNaUCRA1kgSwsofG364VOvQAAzYzAH0AAAAFZAAgAAAAAJNHUGAgn56KekghO19d11nai3lAh0JAlWfeP+6w4lJBBXMAIAAAAAD9XGJlvz59msJvA6St9fKW9CG4JoHV61rlWWnkdBRLzwVsACAAAAAAxwP/X/InJJHmrjznvahIMgj6pQR30B62UtHCthSjrP0AAzY0AH0AAAAFZAAgAAAAAHgYoMGjEE6fAlAhICv0+doHcVX8CmMVxyq7+jlyGrvmBXMAIAAAAAC/5MQZgTHuIr/O5Z3mXPvqrom5JTQ8IeSpQGhO9sB+8gVsACAAAAAAuPSXVmJUAUpTQg/A9Bu1hYczZF58KEhVofakygbsvJQAAzY1AH0AAAAFZAAgAAAAANpIljbxHOM7pydY877gpRQvYY2TGK7igqgGsavqGPBABXMAIAAAAAAqHyEu9gpurPOulApPnr0x9wrygY/7mXe9rAC+tPK80wVsACAAAAAA7gkPzNsS3gCxdFBWbSW9tkBjoR5ib+saDvpGSB3A3ogAAzY2AH0AAAAFZAAgAAAAAGR+gEaZTeGNgG9BuM1bX2R9ed4FCxBA9F9QvdQDAjZwBXMAIAAAAABSkrYFQ6pf8MZ1flgmeIRkxaSh/Eep4Btdx4QYnGGnwAVsACAAAAAApRovMiV00hm/pEcT4XBsyPNw0eo8RLAX/fuabjdU+uwAAzY3AH0AAAAFZAAgAAAAAFNprhQ3ZwIcYbuzLolAT5n/vc14P9kUUQComDu6eFyKBXMAIAAAAAAcx9z9pk32YbPV/sfPZl9ALIEVsqoLXgqWLVK/tP+heAVsACAAAAAA/qxvuvJbAHwwhfrPVpmCFzNvg2cU/NXaWgqgYUZpgXwAAzY4AH0AAAAFZAAgAAAAADgyPqQdqQrgfmJjRFAILTHzXbdw5kpKyfeoEcy6YYG/BXMAIAAAAAAE+3XsBQ8VAxAkN81au+f3FDeCD/s7KoZD+fnM1MJSSAVsACAAAAAAhRnjrXecwV0yeCWKJ5J/x12Xx4qVJahsCEVHB/1U2rcAAzY5AH0AAAAFZAAgAAAAAI0CT7JNngTCTUSei1Arw7eHWCD0jumv2rb7imjWIlWABXMAIAAAAABSP8t6ya0SyCphXMwnru6ZUDXWElN0NfBvEOhDvW9bJQVsACAAAAAAGWeGmBNDRaMtvm7Rv+8TJ2sJ4WNXKcp3tqpv5Se9Ut4AAzcwAH0AAAAFZAAgAAAAAD/FIrGYFDjyYmVb7oTMVwweWP7A6F9LnyIuNO4MjBnXBXMAIAAAAACIZgJCQRZu7NhuNMyOqCn1tf+DfU1qm10TPCfj5JYV3wVsACAAAAAA5hmY4ptuNxULGf87SUFXQWGAONsL9U29duh8xqsHtxoAAzcxAH0AAAAFZAAgAAAAAHIkVuNDkSS1cHIThKc/O0r2/ubaABTOi8Q1r/dvBAsEBXMAIAAAAADdHYqchEiJLM340c3Q4vJABmmth3+MKzwLYlsG6GS7sQVsACAAAAAADa+KP/pdTiG22l+ZWd30P1iHjnBF4zSNRdFm0oEK82kAAzcyAH0AAAAFZAAgAAAAAJmoDILNhC6kn3masElfnjIjP1VjsjRavGk1gSUIjh1NBXMAIAAAAAD97Ilvp3XF8T6MmVVcxMPcdL80RgQ09UoC6PnoOvZ1IQVsACAAAAAA2RK3Xng6v8kpvfVW9tkVXjpE+BSnx9/+Fw85Evs+kUEAAzczAH0AAAAFZAAgAAAAAI5bm3YO0Xgf0VT+qjVTTfvckecM3Cwqj7DTKZXf8/NXBXMAIAAAAAD/m+h8fBhWaHm6Ykuz0WX1xL4Eme3ErLObyEVJf8NCywVsACAAAAAAfb1VZZCqs2ivYbRzX4p5CtaCkKW+g20Pr57FWXzEZi8AAzc0AH0AAAAFZAAgAAAAANqo4+p6qdtCzcB4BX1wQ6llU7eFBnuu4MtZwp4B6mDlBXMAIAAAAAAGiz+VaukMZ+6IH4jtn4KWWdKK4/W+O+gRioQDrfzpMgVsACAAAAAAG4YYkTp80EKo59mlHExDodRQFR7njhR5dmISwUJ6ukAAAzc1AH0AAAAFZAAgAAAAAPrFXmHP2Y4YAm7b/aqsdn/DPoDkv7B8egWkfe23XsM1BXMAIAAAAAAGhwpKAr7skeqHm3oseSbO7qKNhmYsuUrECBxJ5k+D2AVsACAAAAAAAqPQi9luYAu3GrFCEsVjd9z2zIDcp6SPTR2w6KQEr+IAAzc2AH0AAAAFZAAgAAAAABzjYxwAjXxXc0Uxv18rH8I3my0Aguow0kTwKyxbrm+cBXMAIAAAAADVbqJVr6IdokuhXkEtXF0C2gINLiAjMVN20lE20Vmp2QVsACAAAAAAD7K1Fx4gFaaizkIUrf+EGXQeG7QX1jadhGc6Ji471H8AAzc3AH0AAAAFZAAgAAAAAFMm2feF2fFCm/UC6AfIyepX/xJDSmnnolQIBnHcPmb5BXMAIAAAAABLI11kFrQoaNVZFmq/38aRNImPOjdJh0Lo6irI8M/AaAVsACAAAAAAOWul0oVqJ9CejD2RqphhTC98DJeRQy5EwbNerU2+4l8AAzc4AH0AAAAFZAAgAAAAAJvXB3KyNiNtQko4SSzo/9b2qmM2zU9CQTTDfLSBWMgRBXMAIAAAAAAvjuVP7KsLRDeqVqRziTKpBrjVyqKiIbO9Gw8Wl2wFTAVsACAAAAAADlE+oc1ins+paNcaOZJhBlKlObDJ4VQORWjFYocM4LgAAzc5AH0AAAAFZAAgAAAAAPGdcxDiid8z8XYnfdDivNMYVPgBKdGOUw6UStU+48CdBXMAIAAAAAARj6g1Ap0eEfuCZ4X2TsEw+Djrhto3fA5nLwPaY0vCTgVsACAAAAAAoHqiwGOUkBu8SX5U1yHho+UIFdSN2MdQN5s6bQ0EsJYAAzgwAH0AAAAFZAAgAAAAAP5rGPrYGt3aKob5f/ldP0qrW7bmWvqnKY4QwdDWz400BXMAIAAAAADTQkW2ymaaf/bhteOOGmSrIR97bAnJx+yN3yMj1bTeewVsACAAAAAADyQnHGH2gF4w4L8axUsSTf6Ubk7L5/eoFOJk12MtZAoAAzgxAH0AAAAFZAAgAAAAAAlz6wJze5UkIxKpJOZFGCOf3v2KByWyI6NB6JM9wNcBBXMAIAAAAABUC7P/neUIHHoZtq0jFVBHY75tSFYr1Y5S16YN5XxC1QVsACAAAAAAgvxRbXDisNnLY3pfsjDdnFLtkvYUC4lhA68eBXc7KAwAAzgyAH0AAAAFZAAgAAAAAFJ8AtHcjia/9Y5pLEc3qVgH5xKiXw12G9Kn2A1EY8McBXMAIAAAAAAxe7Bdw7eUSBk/oAawa7uicTEDgXLymRNhBy1LAxhDvwVsACAAAAAAxKPaIBKVx3jTA+R/el7P7AZ7efrmTGjJs3Hj/YdMddwAAzgzAH0AAAAFZAAgAAAAAO8uwQUaKFb6vqR3Sv3Wn4QAonC2exOC9lGG1juqP5DtBXMAIAAAAABZf1KyJgQg8/Rf5c02DgDK2aQu0rNCOvaL60ohDHyY+gVsACAAAAAAqyEjfKC8lYoIfoXYHUqHZPoaA6EK5BAZy5dxXZmay4kAAzg0AH0AAAAFZAAgAAAAAE8YtqyRsGCeiR6hhiyisR/hccmK4nZqIMzO4lUBmEFzBXMAIAAAAAC1UYOSKqAeG1UJiKjWFVskRhuFKpj9Ezy+lICZvFlN5AVsACAAAAAA6Ct9nNMKyRazn1OKnRKagm746CGu+jyhbL1qJnZxGi0AAzg1AH0AAAAFZAAgAAAAAPhCrMausDx1QUIEqp9rUdRKyM6a9AAx7jQ3ILIu8wNIBXMAIAAAAACmH8lotGCiF2q9VQxhsS+7LAZv79VUAsOUALaGxE/EpAVsACAAAAAAnc1xCKfdvbUEc8F7XZqlNn1C+hZTtC0I9I3LL06iaNkAAzg2AH0AAAAFZAAgAAAAAOBi/GAYFcstMSJPgp3VkMiuuUUCrZytvqYaU8dwm8v2BXMAIAAAAACEZSZVyD3pKzGlbdwlYmWQhHHTV5SnNLknl2Gw8IaUTQVsACAAAAAAfsLZsEDcWSuNsIo/TD1ReyQW75HPMgmuKZuWFOLKRLoAAzg3AH0AAAAFZAAgAAAAAIQuup+YGfH3mflzWopN8J1X8o8a0d9CSGIvrA5HOzraBXMAIAAAAADYvNLURXsC2ITMqK14LABQBI+hZZ5wNf24JMcKLW+84AVsACAAAAAACzfjbTBH7IwDU91OqLAz94RFkoqBOkzKAqQb55gT4/MAAzg4AH0AAAAFZAAgAAAAAKsh0ADyOnVocFrOrf6MpTrNvAj8iaiE923DPryu124gBXMAIAAAAADg24a8NVE1GyScc6tmnTbmu5ulzO+896fE92lN08MeswVsACAAAAAAaPxcOIxnU7But88/yadOuDJDMcCywwrRitaxMODT4msAAzg5AH0AAAAFZAAgAAAAAKkVC2Y6HtRmv72tDnPUSjJBvse7SxLqnr09/Uuj9sVVBXMAIAAAAABYNFUkH7ylPMN+Bc3HWX1e0flGYNbtJNCY9SltJCW/UAVsACAAAAAAZYK/f9H4OeihmpiFMH7Wm7uLvs2s92zNA8wyrNZTsuMAAzkwAH0AAAAFZAAgAAAAADDggcwcb/Yn1Kk39sOHsv7BO/MfP3m/AJzjGH506Wf9BXMAIAAAAAAYZIsdjICS0+BDyRUPnrSAZfPrwtuMaEDEn0/ijLNQmAVsACAAAAAAGPnYVvo2ulO9z4LGd/69NAklfIcZqZvFX2KK0s+FcTUAAzkxAH0AAAAFZAAgAAAAAEWY7dEUOJBgjOoWVht1wLehsWAzB3rSOBtLgTuM2HC8BXMAIAAAAAAAoswiHRROurjwUW8u8D5EUT+67yvrgpB/j6PzBDAfVwVsACAAAAAA6NhRTYFL/Sz4tao7vpPjLNgAJ0FX6P/IyMW65qT6YsMAAzkyAH0AAAAFZAAgAAAAAPZaapeAUUFPA7JTCMOWHJa9lnPFh0/gXfAPjA1ezm4ZBXMAIAAAAACmJvLY2nivw7/b3DOKH/X7bBXjJwoowqb1GtEFO3OYgAVsACAAAAAA/JcUoyKacCB1NfmH8vYqC1f7rd13KShrQqV2r9QBP44AAzkzAH0AAAAFZAAgAAAAAK00u6jadxCZAiA+fTsPVDsnW5p5LCr4+kZZZOTDuZlfBXMAIAAAAAAote4zTEYMDgaaQbAdN8Dzv93ljPLdGjJzvnRn3KXgtQVsACAAAAAAxXd9Mh6R3mnJy8m7UfqMKi6oD5DlZpkaOz6bEjMOdiwAAzk0AH0AAAAFZAAgAAAAAFbgabdyymiEVYYwtJSWa7lfl/oYuj/SukzJeDOR6wPVBXMAIAAAAADAFGFjS1vPbN6mQEhkDYTD6V2V23Ys9gUEUMGNvMPkaAVsACAAAAAAL/D5Sze/ZoEanZLK0IeEkhgVkxEjMWVCfmJaD3a8uNIAAzk1AH0AAAAFZAAgAAAAABNMR6UBv2E627CqLtQ/eDYx7OEwQ7JrR4mSHFa1N8tLBXMAIAAAAAAxH4gucI4UmNVB7625C6hFSVCuIpJO3lusJlPuL8H5EQVsACAAAAAAVLHNg0OUVqZ7WGOP53BkTap9FOw9dr1P4J8HxqFqU04AAzk2AH0AAAAFZAAgAAAAAG8cd6WBneNunlqrQ2EmNf35W7OGObGq9WL4ePX+LUDmBXMAIAAAAAAjJ2+sX87NSis9hBsgb1QprVRnO7Bf+GObCGoUqyPE4wVsACAAAAAAs9c9SM49/pWmyUQKslpt3RTMBNSRppfNO0JBvUqHPg0AAzk3AH0AAAAFZAAgAAAAAFWOUGkUpy8yf6gB3dio/aOfRKh7XuhvsUj48iESFJrGBXMAIAAAAAAY7sCDMcrUXvNuL6dO0m11WyijzXZvPIcOKob6IpC4PQVsACAAAAAAJOP+EHz6awDb1qK2bZQ3kTV7wsj5Daj/IGAWh4g7omAAAzk4AH0AAAAFZAAgAAAAAGUrIdKxOihwNmo6B+aG+Ag1qa0+iqdksHOjQj+Oy9bZBXMAIAAAAABwa5dbI2KmzBDNBTQBEkjZv4sPaeRkRNejcjdVymRFKQVsACAAAAAA4ml/nm0gJNTcJ4vuD+T2Qfq2fQZlibJp/j6MOGDrbHMAAzk5AH0AAAAFZAAgAAAAAOx89xV/hRk64/CkM9N2EMK6aldII0c8smdcsZ46NbP8BXMAIAAAAADBF6tfQ+7q9kTuLyuyrSnDgmrdmrXkdhl980i1KHuGHgVsACAAAAAACUqiFqHZdGbwAA+hN0YUE5zFg+H+dabIB4dj5/75W/YAAzEwMAB9AAAABWQAIAAAAADJDdC9aEFl4Y8J/awHbnXGHjfP+VXQilPHJg7ewaJI7AVzACAAAAAAE+tqRl6EcBMXvbr4GDiNIYObTsYpa1n6BJk9EjIJVicFbAAgAAAAAJVc+HYYqa0m1Hq6OiRX8c0iRnJYOt6AJAJoG0sG3GMSAAMxMDEAfQAAAAVkACAAAAAA3F9rjEKhpoHuTULVGgfUsGGwJs3bISrXkFP1v6KoQLgFcwAgAAAAAIBf0tXw96Z/Ds0XSIHX/zk3MzUR/7WZR/J6FpxRWChtBWwAIAAAAABWrjGlvKYuTS2s8L9rYy8Hf0juFGJfwQmxVIjkTmFIGQADMTAyAH0AAAAFZAAgAAAAAOYIYoWkX7dGuyKfi3XssUlc7u/gWzqrR9KMkikKVdmSBXMAIAAAAABVF2OYjRTGi9Tw8XCAwZWLpX35Yl271TlNWp6N/nROhAVsACAAAAAA0nWwYzXQ1+EkDvnGq+SMlq20z+j32Su+i/A95SggPb4AAzEwMwB9AAAABWQAIAAAAACMtPm12YtdEAvqu6Eji1yuRXnu1RJP6h0l7pH3lSH4MwVzACAAAAAAENyCFfyUAh1veQBGx+cxiB7Sasrj41jzCGflZkB5cRMFbAAgAAAAAKdI2LMqISr/T5vuJPg6ZRBm5fVi2aQCc4ra3A4+AjbDAAMxMDQAfQAAAAVkACAAAAAAvlI4lDcs6GB1cnm/Tzo014CXWqidCdyE5t2lknWQd4QFcwAgAAAAAD60SpNc4O2KT7J0llKdSpcX1/Xxs97N715a1HsTFkmBBWwAIAAAAABuuRkJWAH1CynggBt1/5sPh9PoGiqTlS24D/OE2uHXLQADMTA1AH0AAAAFZAAgAAAAAKl8zcHJRDjSjJeV/WvMxulW1zrTFtaeBy/aKKhadc6UBXMAIAAAAADBdWQl5SBIvtZZLIHszePwkO14W1mQ0izUk2Ov21cPNAVsACAAAAAAHErCYycpqiIcCZHdmPL1hi+ovLQk4TAvENpfLdTRamQAAzEwNgB9AAAABWQAIAAAAABb6LXDWqCp1beQgQjj8I3sRTtFhlrmiBi+h/+ikmrvugVzACAAAAAA9stpgTecT7uTyaGNs3K9Bp0A7R0QaIAOfscyMXHBPX8FbAAgAAAAAHUt+McyXrJ1H8SwnHNVO181Ki8vDAM1f7XI26mg95ZDAAMxMDcAfQAAAAVkACAAAAAA97NTT+81PhDhgptNtp4epzA0tP4iNb9j1AWkiiiKGM8FcwAgAAAAAKPbHg7ise16vxmdPCzksA/2Mn/qST0L9Xe8vnQugVkcBWwAIAAAAABB0EMXfvju4JU/mUH/OvxWbPEl9NJkcEp4iCbkXI41fAADMTA4AH0AAAAFZAAgAAAAAMqpayM2XotEFmm0gwQd9rIzApy0X+7HfOhNk6VU7F5lBXMAIAAAAACJR9+q5T9qFHXFNgGbZnPubG8rkO6cwWhzITQTmd6VgwVsACAAAAAAOZLQ6o7e4mVfDzbpQioa4d3RoTvqwgnbmc5Qh2wsZuoAAzEwOQB9AAAABWQAIAAAAADQnslvt6Hm2kJPmqsTVYQHE/wWeZ4bE1XSkt7TKy0r1gVzACAAAAAA8URTA4ZMrhHPvlp53TH6FDCzS+0+61qHm5XK6UiOrKEFbAAgAAAAAHQbgTCdZcbdA0avaTmZXUKnIS7Nwf1tNrcXDCw+PdBRAAMxMTAAfQAAAAVkACAAAAAAhujlgFPFczsdCGXtQ/002Ck8YWQHHzvWvUHrkbjv4rwFcwAgAAAAALbV0lLGcSGfE7mDM3n/fgEvi+ifjl7WZ5b3aqjDNvx9BWwAIAAAAACbceTZy8E3QA1pHmPN5kTlOx3EO8kJM5PUjTVftw1VpgADMTExAH0AAAAFZAAgAAAAABm/6pF96j26Jm7z5KkY1y33zcAEXLx2n0DwC03bs/ixBXMAIAAAAAD01OMvTZI/mqMgxIhA5nLs068mW+GKl3OW3ilf2D8+LgVsACAAAAAAaLvJDrqBESTNZSdcXsd+8GXPl8ZkUsGpeYuyYVv/kygAAzExMgB9AAAABWQAIAAAAACfw9/te4GkHZAapC9sDMHHHZgmlTrccyJDPFciOMSOcwVzACAAAAAAIIC1ZpHObvmMwUfqDRPl4C1aeuHwujM1G/yJbvybMNAFbAAgAAAAAAs9x1SnVpMfNv5Bm1aXGwHmbbI9keWa9HRD35XuCBK5AAMxMTMAfQAAAAVkACAAAAAAkxHJRbnShpPOylLoDdNShfILeA1hChKFQY9qQyZ5VmsFcwAgAAAAAKidrY+rC3hTY+YWu2a7fuMH2RD/XaiTIBW1hrxNCQOJBWwAIAAAAACW0kkqMIzIFMn7g+R0MI8l15fr3k/w/mHtY5n6SYTEwAADMTE0AH0AAAAFZAAgAAAAAByuYl8dBvfaZ0LO/81JW4hYypeNmvLMaxsIdvqMPrWoBXMAIAAAAABNddwobOUJzm9HOUD8BMZJqkNCUCqstHZkC76FIdNg9AVsACAAAAAAQQOkIQtkyNavqCnhQbNg3HfqrJdsAGaoxSJePJl1qXsAAzExNQB9AAAABWQAIAAAAABxMy7X5hf7AXGDz3Y/POu1ZpkMlNcSvSP92NOO/Gs7wAVzACAAAAAAHJshWo2T5wU2zvqCyJzcJQKQaHFHpCpMc9oWBXkpUPoFbAAgAAAAAGeiJKzlUXAvL0gOlW+Hz1mSa2HsV4RGmyLmCHlzbAkoAAMxMTYAfQAAAAVkACAAAAAAlqbslixl7Zw3bRlibZbe/WmKw23k8uKeIzPKYEtbIy0FcwAgAAAAAHEKwpUxkxOfef5HYvulXPmdbzTivwdwrSYIHDeNRcpcBWwAIAAAAADuPckac21Hrg/h0kt5ShJwVEZ9rx6SOHd2+HDjqxEWTQADMTE3AH0AAAAFZAAgAAAAAMXrXx0saZ+5gORmwM2FLuZG6iuO2YS+1IGPoAtDKoKBBXMAIAAAAADIQsxCr8CfFKaBcx8kIeSywnGh7JHjKRJ9vJd9x79y7wVsACAAAAAAcvBV+SykDYhmRFyVYwFYB9oBKBSHr55Jdz2cXeowsUQAAzExOAB9AAAABWQAIAAAAAAm83FA9yDUpwkbKTihe7m53u+DivS9BU2b4vQMtCVQ2AVzACAAAAAAz3m1UB/AbZPa4QSKFDnUgHaT78+6iGOFAtouiBorEgEFbAAgAAAAAIgbpyYtJj5513Z5XYqviH/HXG/5+mqR52iBbfqMmDtZAAMxMTkAfQAAAAVkACAAAAAAJRzYK0PUwr9RPG2/7yID0WgcTJPB2Xjccp5LAPDYunkFcwAgAAAAAIIh24h3DrltAzNFhF+MEmPrZtzr1PhCofhChZqfCW+jBWwAIAAAAAAzRNXtL5o9VXMk5D5ylI0odPDJDSZZry1wfN+TedH70gADMTIwAH0AAAAFZAAgAAAAAHSaHWs/dnmI9sc7nB50VB2Bzs0kHapMHCQdyVEYY30TBXMAIAAAAACkV22lhEjWv/9/DubfHBAcwJggKI5mIbSK5L2nyqloqQVsACAAAAAAS19m7DccQxgryOsBJ3GsCs37yfQqNi1G+S6fCXpEhn4AAzEyMQB9AAAABWQAIAAAAAAC/I4TQRtCl12YZmdGz17X4GqSQgfwCPgRBwdHmdwu+QVzACAAAAAAx8f3z2ut/RAZhleari4vCEE+tNIn4ikjoUwzitfQ588FbAAgAAAAAJci0w1ZB8W2spJQ+kMpod6HSCtSR2jrabOH+B0fj3A4AAMxMjIAfQAAAAVkACAAAAAADGB5yU2XT0fse/MPWgvBvZikVxrl5pf3S5K1hceKWooFcwAgAAAAAIxTmlLHMjNaVDEfJbXvRez0SEPWFREBJCT6qTHsrljoBWwAIAAAAAAlswzAl81+0DteibwHD+CG5mZJrfHXa9NnEFRtXybzzwADMTIzAH0AAAAFZAAgAAAAABmO7QD9vxWMmFjIHz13lyOeV6vHT6mYCsWxF7hb/yOjBXMAIAAAAACT9lmgkiqzuWG24afuzYiCeK9gmJqacmxAruIukd0xEAVsACAAAAAAZa0/FI/GkZR7CtX18Xg9Tn9zfxkD0UoaSt+pIO5t1t4AAzEyNAB9AAAABWQAIAAAAAAfPUoy7QyZKhIIURso+mkP9qr1izbjETqF5s22GwjCjAVzACAAAAAAvLMsIDQ/go4VUxeh50UHmsvMvfx51cwyONnRD2odvC0FbAAgAAAAAKMb+1CodEalAFnDrEL1Ndt8ztamZ+9134m9Kp3GQgd+AAMxMjUAfQAAAAVkACAAAAAAE3ZqUar0Bq2zWbARE0bAv98jBlK9UJ73/xcwdMWWlSkFcwAgAAAAAK4M+MmC+9sFiFsumMyJZQKxWmmJiuG9H7IzKw083xxkBWwAIAAAAAAqkAONzhvMhkyL1D/6h7QQxEkdhC3p2WjXH+VGq5qCqQADMTI2AH0AAAAFZAAgAAAAAMo8FJiOq63cAmyk2O7eI7GcbQh/1j4RrMTqly3rexftBXMAIAAAAADjVmpd0WiRGTw/gAqEgGolt2EI7Csv14vKdmYoMD0aAgVsACAAAAAA07XQBzBUQMNw7F2/YxJjZNuPVpHTTgbLd1oGk77+bygAAzEyNwB9AAAABWQAIAAAAACu5IGaIx7A3Jvly/kzlCsSA4s3iJwuIl8jEdRH0k93NwVzACAAAAAA9NRUyxYE+t0Xyosyt6vIfMFW/vBoYg6sR+jBNs4JAxIFbAAgAAAAAAzyZ91dx+0oMlOVAjRGiMrPySikY/U9eMEB4WJb3uWtAAMxMjgAfQAAAAVkACAAAAAALkRy0GJInXYLA+cgjs6Myb0a+Gu9hgXhHvhLNoGWfckFcwAgAAAAANbALyt9zCSvwnLaWCd2/y2eoB7qkWTvv1Ldu8r40JPuBWwAIAAAAAD4Fl5bV5sz4isIE9bX+lmAp+aAKaZgVYVZeVfrItkCZAADMTI5AH0AAAAFZAAgAAAAAGoUK/DSWhT8LZhszSUqDbTrp8cSA7rdqmADKL+MILtTBXMAIAAAAABHnEE9bVa6lvhfhEMkkV2kzSSxH/sMW/FIJuw3CzWs6wVsACAAAAAAanavcBdqZxgRGKvEK95wTmeL1K1CeDSXZsXUAs81uOgAAzEzMAB9AAAABWQAIAAAAAC922ZDQE3h2fQKibGMZ9hV0WNlmrPYYSdtaSyYxsWYqgVzACAAAAAAagMovciKK6WVjIc2cCj8nK5O/gVOFFVeVAJpRp89tmQFbAAgAAAAAKcTFfPQzaFiAtSFhqbN02sCE1BKWJSrRfGN5L6oZwzkAAMxMzEAfQAAAAVkACAAAAAAtK+JqX3K/z2txjAU15DgX4y90DS2YLfIJFolCOkJJJwFcwAgAAAAAMnR5V7gfX7MNqqUdL5AkWlkhyFXaBRVNej+Rcn8lrQkBWwAIAAAAAA2cDNRXZuiC241TGRvdFyctJnrNcdbZOP9zHio81tkngADMTMyAH0AAAAFZAAgAAAAAAeGrIMK/bac6kPczxbvRYqKMkcpeI2FjdMpD91FDWIvBXMAIAAAAAAix62z1LeS8yvSXCl5gHSIomjyx76fF3S1lp9k900hygVsACAAAAAAiYwzf2m71aWFD5ajcXyW2JX2EzQOkBroTGMg29nLPYIAAzEzMwB9AAAABWQAIAAAAACphf298InM0Us4HT8o1W1MGw0D/02vd7Jh+U0h7qaFaQVzACAAAAAAFXtk7YpqsOJxsqGWSIL+YcBE96G3Zz9D31gPqDW94y8FbAAgAAAAAAOrS1KVA94rjB1jZ1pPocpCeBG+B14RzWoHqVDpp7JbAAMxMzQAfQAAAAVkACAAAAAATLDS2cuDVM3yDMuWNgk2iGKBTzPpfJMbvxVOSY39ZfcFcwAgAAAAAPT5wRi2cLHIUflXzm6EQB/m7xdThP80ir1VV/JBBqvxBWwAIAAAAAB9lEtZS0aXCFbCtSbhnis27S5IPcfWGygHW8AHn3QqzwADMTM1AH0AAAAFZAAgAAAAAJNjExiZVX7jfFGfYpQu16qxLN0YPqVU/5CQ/Y67YSinBXMAIAAAAABMpm2+6KrkRUlXzQoMPHrQmIO6dkQz66tYdfTeA3dKqQVsACAAAAAAFXobHiMLvNZuEPr8jtewCX2J93EZG3JNeyVg92fue6YAAzEzNgB9AAAABWQAIAAAAABlFkYtLCx901X6QVVMkSn6Z7k30UF4xHaA0OZJJ9bdyQVzACAAAAAATez+F9GHcGzTp7jjv4feboUNb8JCkIp4EqcPFisnq7MFbAAgAAAAACE7JvOpBgMoZ7kRd4QbxIhxukPTUxXpzhjnBHiR7XoRAAMxMzcAfQAAAAVkACAAAAAA8NJKN0IxZnruhswGQkiruv8Ih0EMwDcSZx/Xasup9dkFcwAgAAAAAKaJZRxzA+Igeydvuk6cSwUHXcrmT4PjhuPu//FslpdnBWwAIAAAAAD53Rok1Vq/PMAnXmarqoHJ0PEyYUBmVESa9hIpCv/G9QADMTM4AH0AAAAFZAAgAAAAABHxHdEClz7hbSSgE58+dWLlSMJnoPz+jFxp4bB1GmLQBXMAIAAAAAD3nSvT6aGD+A110J/NwEfp0nPutlmuB5B+wA3CC3noGAVsACAAAAAA3Apjd+TapONB7k5wBVwTWgn8t+Sq2oyyU5/+as109RcAAzEzOQB9AAAABWQAIAAAAAC/o8qW/ifk3KuJ01VFkyNLgQafxB5/bGs2G5VyyVafOwVzACAAAAAA1bMqAFGDHSl6BYNLbxApvkAv2K1/oafywiX0MDz1dGUFbAAgAAAAAHJXLlId3edFoniLD/9K2A5973MeP2Ro31flDyqm3l5QAAMxNDAAfQAAAAVkACAAAAAAY2V8I1bz3a1AxTtmED6UhdhA09huFkuuEX8R+d/WDPUFcwAgAAAAAPTVoNRiI76tcRKqd+JBBVyy4+YcKST42p0QX2BtmQ2VBWwAIAAAAACcxt9hg14WqPNiDv1MkqVljM2e2KJEv53lA17LhV6ZigADMTQxAH0AAAAFZAAgAAAAAO2kSsW0WGN9AOtK4xK2SHrGhWiaAbMEKT4iZkRpaDN/BXMAIAAAAABKGzQcPM8LT2dwOggxoWjv/1imYWabbG/G4kBw8OWaxAVsACAAAAAAC9hLK1dScQTAqg+YAG3ObdPzg2Xet57HmOFpGmyUR9UAAzE0MgB9AAAABWQAIAAAAAAiCwzNEEaH/mDam68IdDftnhthyUFdb+ZCNSBQ91WlHQVzACAAAAAA7tHyHcxCzmbJeFYZyPm4mEgkTGKOvwY4MX82OvH0Jn8FbAAgAAAAAAb5IAbZ1hXCNegQ+S+C9i/Z8y6sS8KeU04V6hXa2ml6AAMxNDMAfQAAAAVkACAAAAAAGuCHVNJSuoVkpPOnS5s89GuA+BLi2IPBUr2Bg1sWEPIFcwAgAAAAAEl1gncS5/xO7bQ/KQSstRV3rOT2SW6nV92ZANeG2SR6BWwAIAAAAAA9LOcKmhek8F2wAh8yvT/vjp2gaouuO+Hmv10lwAeWPAADMTQ0AH0AAAAFZAAgAAAAAMfxz7gEaoCdPvXrubDhCZUS0ARLZc1svgbXgMDlVBPgBXMAIAAAAAB6a5dDA3fuT5Vz2KvAcbUEFX/+B7Nw2p1QqbPoQ5TTuAVsACAAAAAAcf/y75UOuI62A6vWH7bYr/5Jz+nirZVYK/81trN6XOQAAzE0NQB9AAAABWQAIAAAAACnYsqF/VzmjIImC9+dqrHO1TM6lJ6fRwM0mM6Wf6paOwVzACAAAAAA5tgZzch8uDCR1ky3SllVaKVpxAlbrhvlNDTazZZRZOAFbAAgAAAAALeGiLJS4z2zhgVpxzyPdRYyACP9QzQBOob34YrIZumCAAMxNDYAfQAAAAVkACAAAAAAEC0sIVmadtW4YMuRXH7RpAhXclsd+3bmqGXCMeaT014FcwAgAAAAABPpXh0uzpsJJB+IRUNajmMB9WGwswfpw5T9xk3Xj6ANBWwAIAAAAAAmf+NYh9TZ/QRu3w/GQz66n7DtfbJijN3G7KzeL8lstAADMTQ3AH0AAAAFZAAgAAAAABaIB3n49Xm9cOafSrQsE0WCcYp8rMIO/qVwIlMF5YLRBXMAIAAAAAC9EyWJV3xOu9bzgdJ/yX+ko7qLf1u3AxNMataW2C9EzQVsACAAAAAAvVbDkLxXx2DcMLifIQ3K0IIJcLcAG9DUrNfI6aoUjNcAAzE0OAB9AAAABWQAIAAAAAA5rZItA/cocRnngYqcJ3nBXQ+l688aKz3EQyLbYYunPAVzACAAAAAAwKyA+L7TgxztPClLrIMk2JXR+w7c04N3ZOqPgjvrIvsFbAAgAAAAACzvZ33h6aWEe8hmo+1f6OXJ72FY5hvWaUuha64ZV3KFAAMxNDkAfQAAAAVkACAAAAAA3htn7oHJ0YYpIrs+Mzyh85Ys67HwAdv5LQl1mCdoMWkFcwAgAAAAAEHjCtNNLenHuSIYux6ezAHsXDaj2DlTF67ToDhDDe6HBWwAIAAAAAD+P4H0sk9jOd+7vOANt2/1Ectb+4ZRGPE8GkHWNXW3MgADMTUwAH0AAAAFZAAgAAAAAEnt18Km/nqggfIJWxzTr9r3hnXNaueG6XO9A5G11LnGBXMAIAAAAAD7QxzGMN/ard5TfFLecE6uusMmXG2+RBsBR+/NCQHUwAVsACAAAAAAQEZ1ZZ8GC8rdbg7s87OM5Gr9qkTXS9+P5DuAZxj5Gl4AAzE1MQB9AAAABWQAIAAAAAAVAKK/GoY8AACu/hyMpO4hdLq6JnEyWNzkyci9sbaD/wVzACAAAAAA2HmeqpMlvvBpV2zQTYIRmsc4MFlfHRwLof0ycJgMg/MFbAAgAAAAACdltCeWi5E/q1Li1eXLChpM2D9QQSGLBZ82NklQSc0oAAMxNTIAfQAAAAVkACAAAAAAhHyq1GQC/GiMwpYjcsfkNxolJ10ARKjIjfkW1Wipzi0FcwAgAAAAAD/uaGWxTDq87F8XZ6CrFI+RNa8yMqfSZdqK00Kj833BBWwAIAAAAAD6aEdOO0CsQGagioOCvANPCEHSpJ8BSixlPBq5ERhB7AADMTUzAH0AAAAFZAAgAAAAABAJJxHoZD+MQBWqm9UM9Dd3z5ZohIZGWRaRVRsMptKQBXMAIAAAAADrE/ca+gqj/SH4oao4wE4qn2ovoTydzcMbDbrfnUs3zAVsACAAAAAAeNCIQN6hVnGJinytQRFGlQ2ocoprXNqpia+BSxzl+uwAAzE1NAB9AAAABWQAIAAAAAAv01wz7VG9mTepjXQi6Zma+7b/OVBaKVkWNbgDLr1mFgVzACAAAAAA0I5sxz8r6wkCp5Tgvr+iL4p6MxSOq5d3e1kZG+0b7NkFbAAgAAAAAIA32v6oGkAOS96HexGouNTex+tLahtx9QF2dgGClk6WAAMxNTUAfQAAAAVkACAAAAAAWXecRwxSon68xaa9THXnRDw5ZfzARKnvvjTjtbae6T0FcwAgAAAAAPh0UfUMEo7eILCMv2tiJQe1bF9qtXq7GJtC6H5Va4fIBWwAIAAAAADqFr1ThRrTXNgIOrJWScO9mk86Ufi95IDu5gi4vP+HWQADMTU2AH0AAAAFZAAgAAAAAEY5WL8/LpX36iAB1wlQrMO/xHVjoO9BePVzbUlBYo+bBXMAIAAAAABoKcpadDXUARedDvTmzUzWPe1jTuvD0z9oIcZmKuiSXwVsACAAAAAAJuJbwuaMrAFoI+jU/IYr+k4RzAqITrOjAd3HWCpJHqEAAzE1NwB9AAAABWQAIAAAAADnJnWqsfx0xqNnqfFGCxIplVu8mXjaHTViJT9+y2RuTgVzACAAAAAAWAaSCwIXDwdYxWf2NZTly/iKVfG/KDjHUcA1BokN5sMFbAAgAAAAAJVxavipE0H4/JQvhagdytXBZ8qGooeXpkbPQ1RfYMVHAAMxNTgAfQAAAAVkACAAAAAAsPG7LaIpJvcwqcbtfFUpIjj+vpNj70Zjaw3eV9T+QYsFcwAgAAAAAJQ71zi0NlCyY8ZQs3IasJ4gB1PmWx57HpnlCf3+hmhqBWwAIAAAAACD58TO6d+71GaOoS+r73rAxliAO9GMs4Uc8JbOTmC0OwADMTU5AH0AAAAFZAAgAAAAAAGiSqKaQDakMi1W87rFAhkogfRAevnwQ41onWNUJKtuBXMAIAAAAAASgiDpXfGh7E47KkOD8MAcX8+BnDShlnU5JAGdnPdqOAVsACAAAAAAI+2TTQIgbFq4Yr3lkzGwhG/tqChP7hRAx2W0fNaH6jcAAzE2MAB9AAAABWQAIAAAAAB7L4EnhjKA5xJD3ORhH2wOA1BvpnQ+7IjRYi+jjVEaJAVzACAAAAAAuhBIm0nL3FJnVJId+7CKDASEo+l2E89Z9/5aWSITK4AFbAAgAAAAALtSICOzQDfV9d+gZuYxpEj6cCeHnKTT+2G3ceP2H65kAAMxNjEAfQAAAAVkACAAAAAAaROn1NaDZFOGEWw724dsXBAm6bgmL5i0cki6QZQNrOoFcwAgAAAAANVT8R6UvhrAlyqYlxtmnvkR4uYK/hlvyQmBu/LP6/3ZBWwAIAAAAAD+aHNMP/X+jcRHyUtrCNkk1KfMtoD3GTmShS8pWGLt+AADMTYyAH0AAAAFZAAgAAAAADqSR5e0/Th59LrauDA7OnGD1Xr3H3NokfVxzDWOFaN7BXMAIAAAAACt30faNwTWRbvmykDpiDYUOCwA6QDbBBYBFWS7rdOB4AVsACAAAAAAF7SvnjjRk5v2flFOKaBAEDvjXaL1cpjsQLtK2fv9zdQAAzE2MwB9AAAABWQAIAAAAADmtb1ZgpZjSeodPG/hIVlsnS8hoRRwRbrTVx89VwL62AVzACAAAAAAi38e1g6sEyVfSDkzZbaZXGxKI/zKNbMasOl2LYoWrq8FbAAgAAAAAALACk0KcCDN/Kv8WuazY8ORtUGkOZ5Dsm0ys1oOppp/AAMxNjQAfQAAAAVkACAAAAAAf/f7AWVgBxoKjr7YsEQ4w/fqSvuQWV2HMiA3rQ7ur0sFcwAgAAAAADkkeJozP6FFhUdRIN74H4UhIHue+eVbOs1NvbdWYFQrBWwAIAAAAAB55FlHAkmTzAYj/TWrGkRJw2EhrVWUnZXDoMYjyfB/ZwADMTY1AH0AAAAFZAAgAAAAAI2WEOymtuFpdKi4ctanPLnlQud+yMKKb8p/nfKmIy56BXMAIAAAAADVKrJmhjr1rfF3p+T+tl7UFd1B7+BfJRk0e7a4im7ozgVsACAAAAAA5E7Ti3PnFiBQoCcb/DN7V1uM3Xd6VKiexPKntssFL7kAAzE2NgB9AAAABWQAIAAAAAAuHU9Qd79hjyvKOujGanSGDIQlxzsql8JytTZhEnPw+AVzACAAAAAAjF2gV/4+sOHVgDd/oR5wDi9zL7NGpGD+NsEpGXy/a4QFbAAgAAAAAJzMoyojYV6Ed/LpVN5zge93Odv3U7JgP7wxeRaJZGTdAAMxNjcAfQAAAAVkACAAAAAA7dQDkt3iyWYCT94d7yqUtPPwp4qkC0ddu+HFdHgVKEkFcwAgAAAAANuYvtvZBTEq4Rm9+5eb7VuFopowkrAuv86PGP8Q8/QvBWwAIAAAAACeqXoAOQOE4j0zRMlkVd8plaW0RX1npsFvB38Xmzv7sAADMTY4AH0AAAAFZAAgAAAAAAwnZSDhL4tNGYxlHPhKYB8s28dY5ScSwiKZm3UhT8U3BXMAIAAAAABDoY6dhivufTURQExyC9Gx3ocpl09bgbbQLChj3qVGbgVsACAAAAAAF+1nS7O0v85s3CCy+9HkdeoEfm2C6ZiNbPMMnSfsMHUAAzE2OQB9AAAABWQAIAAAAAC2VuRdaC4ZJmLdNOvD6R2tnvkyARteqXouJmI46V306QVzACAAAAAAMn1Z6B35wFTX9mEYAPM+IiJ5hauEwfD0CyIvBrxHg7IFbAAgAAAAAOG6DvDZkT9B/xZWmjao2AevN7MMbs3Oh9YJeSd/hZ+hAAMxNzAAfQAAAAVkACAAAAAAVerb7qVNy457rNOHOgDSKyWl5ojun7iWrv1uHPXrIZQFcwAgAAAAAIDcYS9j5z+gx0xdJj09L7876r/vjvKTi/d3bXDE3PhyBWwAIAAAAADuhVLqb1Bkrx8aNymS+bx2cL8GvLFNH4SAi690DUgnWQADMTcxAH0AAAAFZAAgAAAAAH/E44yLxKCJjuSmU9A8SEhbmkDOx1PqqtYcZtgOzJdrBXMAIAAAAABgLh9v2HjBbogrRoQ82LS6KjZQnzjxyJH4PH+F3jupSAVsACAAAAAAIlO46ehXp4TqpDV0t6op++KO+uWBFh8iFORZjmx2IjkAAzE3MgB9AAAABWQAIAAAAAAlNUdDL+f/SSQ5074mrq0JNh7CTXwTbbhsQyDwWeDVMwVzACAAAAAANIH2IlSNG0kUw4qz0budjcWn8mNR9cJlYUqPYdonucAFbAAgAAAAAJMrOUOyiu5Y3sV76zwEFct8L7+i8WGlQI2+8z2W2kzaAAMxNzMAfQAAAAVkACAAAAAASZ+CvUDtlk/R4HAQ3a+PHrKeY/8ifAfh0oXYFqliu80FcwAgAAAAAJelpzPgM65OZFt/mvGGpwibclQ49wH+1gbUGzd9OindBWwAIAAAAAD9qeDchteEpVXWcycmD9kl9449C1dOw0r60TBm5jK+cQADMTc0AH0AAAAFZAAgAAAAAN9fkoUVbvFV2vMNMAkak4gYfEnzwKI3eDM3pnDK5q3lBXMAIAAAAACnDkgVNVNUlbQ9RhR6Aot2nVy+U4km6+GHPkLr631jEAVsACAAAAAANzg/BnkvkmvOr8nS4omF+q9EG/4oisB+ul4YHi938hwAAzE3NQB9AAAABWQAIAAAAAASyK3b1nmNCMptVEGOjwoxYLLS9fYWm/Zxilqea0jpEQVzACAAAAAADDHsGrbqlKGEpxlvfyqOJKQJjwJrzsrB7k3HG0AUJbkFbAAgAAAAAKwx3S4XfDZh4+LuI9jf7XgUh5qiefNv87JD4qvVRfPSAAMxNzYAfQAAAAVkACAAAAAAlSP9iK31GlcG9MKGbLmq+VXMslURr+As736rrVNXcsUFcwAgAAAAAAvbj0zfq9zzi8XReheKFbCB+h9IsOLgXPPpI5vrEJNZBWwAIAAAAABXvoZhaQE7ogWjeBjceVkp03N20cKYP3TA8vuNsgpfAgADMTc3AH0AAAAFZAAgAAAAAOJNORH8Bev97gVU7y6bznOxJ+E6Qoykur1QP76hG1/7BXMAIAAAAAC+C1PtOOrSZgzBAGhr+dPe/kR0JUw9GTwLVNr61xC1aAVsACAAAAAAeA/L8MQIXkamaObtMPLpoDoi5FypA5WAPtMeMrgi0eQAAzE3OAB9AAAABWQAIAAAAAAKcHzLUomavInN6upPkyWhAqYQACP/vdVCIYpiy6U6HgVzACAAAAAATsR4KItY6R2+U7Gg6sJdaEcf58gjd1OulyWovIqfxKcFbAAgAAAAAFbm10ko67ahboAejQdAV0U2uA5OhZYdb8XUFJ8OL46LAAMxNzkAfQAAAAVkACAAAAAAqTOLiMpCdR59tLZzzIPqJvbCNvz2XQL9ust0qYaehtcFcwAgAAAAAArefox/3k5xGOeiw2m6NUdzuGxmPwcu5IFcj+jMwHgHBWwAIAAAAADLZGFJ7MQd5JXMgMXjqZO5LDLxcFClcXPlnRMWRn+1oAADMTgwAH0AAAAFZAAgAAAAAIPSqSeVzSRgNVNmrPYHmUMgykCY27NbdDUNhE5kx/SgBXMAIAAAAAAhX90nNfxyXmZe/+btZ7q6xMX4PFyj0paM1ccJ/5IUUQVsACAAAAAA419oHmD2W0SYoOMwhrhrp8jf68fg9hTkaRdCuVd3CN0AAzE4MQB9AAAABWQAIAAAAACLn5DxiqAosHGXIAY96FwFKjeqrzXWf3VJIQMwx1fl4gVzACAAAAAAindvU27nveutopdvuHmzdENBbeGFtI3Qcsr07jxmvm8FbAAgAAAAAPvl9pBStQvP4OGkN5v0MghUY6djm9n7XdKKfrW0l1sMAAMxODIAfQAAAAVkACAAAAAA7i2S6rHRSPBwZEn59yxaS7HiYBOmObIkeyCcFU42kf8FcwAgAAAAAGb3RSEyBmgarkTvyLWtOLJcPwCKbCRkESG4RZjVmY4iBWwAIAAAAADB2/wo5CSHR4ANtifY6ZRXNTO5+O8qP82DfAiAeanpZwADMTgzAH0AAAAFZAAgAAAAAFz+M+H/Z94mdPW5oP51B4HWptp1rxcMWAjnlHvWJDWrBXMAIAAAAACBFEOQyL7ZHu4Cq33QvXkmKuH5ibG/Md3RaED9CtG5HwVsACAAAAAAfggtJTprQ/yZzj7y5z9KvXsdeXMWP0yUXMMJqpOwI88AAzE4NAB9AAAABWQAIAAAAAAE7c2x3Z3aM1XGfLNk/XQ9jCazNRbGhVm7H8c2NjS5ywVzACAAAAAARJ9h8fdcwA19velF3L/Wcvi2rCzewlKZ2nA0p8bT9uwFbAAgAAAAAJtWe6b4wK2Hae2dZm/OEpYQnvoZjz4Sz5IgJC2wInecAAMxODUAfQAAAAVkACAAAAAAVoRt9B9dNVvIMGN+ea5TzRzQC+lqSZ8dd/170zU5o9cFcwAgAAAAAEwM95XZin5mv2yhCI8+ugtKuvRVmNgzzIQN0yi1+9aIBWwAIAAAAAAMGBq72n00rox3uqhxSB98mkenTGCdbbUF1gXrgottzgADMTg2AH0AAAAFZAAgAAAAAKRDkjyWv/etlYT4GyoXrmBED2FgZHnhc+l9Wsl06cH2BXMAIAAAAABohlpm3K850Vndf3NmNE0hHqDlNbSR8/IvMidQ3LnIZAVsACAAAAAAW42nGHa6q2MCAaaPVwaIDfr8QLyQwjKq23onZJYsqVsAAzE4NwB9AAAABWQAIAAAAAC3DFh5oklLCNLY90bgWm68dFXz65JpAZSp1K99MBTPAQVzACAAAAAAQgZecmxEUZVHoptEQClDwAf8smI3WynQ/i+JBP0g+kQFbAAgAAAAAEUSQGVnAPISD6voD0DiBUqyWKgt2rta0tjmoe+LNt6IAAMxODgAfQAAAAVkACAAAAAAQ5WKvWSB503qeNlOI2Tpjd5blheNr6OBO8pfJfPNstcFcwAgAAAAAKwHgQLSDJ5NwLBQbY5OnblQIsVDpGV7q3RCbFLD1U4/BWwAIAAAAACQ5nED99LnpbqXZuUOUjnO2HTphEAFBjLD4OZeDEYybgADMTg5AH0AAAAFZAAgAAAAAGfhFY3RGRm5ZgWRQef1tXxHBq5Y6fXaLAR4yJhrTBplBXMAIAAAAACKEF0ApLoB6lP2UqTFsTQYNc9OdDrs/vziPGzttGVLKQVsACAAAAAArOO6FyfNRyBi0sPT5iye7M8d16MTLcwRfodZq4uCYKEAAzE5MAB9AAAABWQAIAAAAAAIM73gPcgzgotYHLeMa2zAU4mFsr7CbILUZWfnuKSwagVzACAAAAAAJCSu98uV8xv88f2BIOWzt6p+6EjQStMBdkGPUkgN79cFbAAgAAAAAMGqPGMPxXbmYbVfSa/japvUljht1zZT33TY7ZjAiuPfAAMxOTEAfQAAAAVkACAAAAAAkWmHCUsiMy1pwZTHxVPBzPTrWFBUDqHNrVqcyyt7nO8FcwAgAAAAAMv2CebFRG/br7USELR98sIdgE9OQCRBGV5JZCO+uPMgBWwAIAAAAABt7qSmn3gxJu7aswsbUiwvO+G6lXj/Xhx+J/zQyZxzLAADMTkyAH0AAAAFZAAgAAAAAGInUYv0lP/rK7McM8taEHXRefk8Q2AunrvWqdfSV7UaBXMAIAAAAACE+WPxJ3gan7iRTbIxXXx+bKVcaf8kP4JD8DcwU0aL7wVsACAAAAAAUC4eTprX4DUZn2X+UXYU6QjtiXk+u57yoOPBbPQUmDkAAzE5MwB9AAAABWQAIAAAAACmHlg2ud3cplXlTsNTpvNnY6Qm1Fce0m899COamoDjaQVzACAAAAAArtJQeJIlepBWRU2aYar7+YGYVQ7dfDc1oxgTmA8r9q0FbAAgAAAAAOk45vg5VqZHAFCO3i0Z52SZi5RADf8NXwf68T5yad/DAAMxOTQAfQAAAAVkACAAAAAApzcWSAbZWV/Rq+ylRNqqlJqNVR4fhXrz4633/MQOQgcFcwAgAAAAAN/jz/bsEleiuCl+li83EWlG6UMHA8CyaOMRKCkXkSCPBWwAIAAAAAC3Sd+Qg+uFDKpGZHbrQgokXHQ1az1aFl4YK343OB6hcQAAEmNtAAAAAAAAAAAAABBwYXlsb2FkSWQAAAAAABBmaXJzdE9wZXJhdG9yAAEAAAASc3AAAQAAAAAAAAAQdGYAAQAAABNtbgD/////Y46NN8CHrb4J7f/fE214AP////9jjo03wIetvgnt/18A", - "subType": "06" - } - } - } - }, - "u": { - "$set": { - "encryptedDecimalNoPrecision": { - "$$type": "binData" - } - } - } - } - ], - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalNoPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - }, - "$db": "default" - } - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": { - "$numberInt": "0" - }, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "rbf3AeBEv4wWFAKknqDxRW5cLNkFvbIs6iJjc6LShQY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "n+XAuFnP8Dov9TnhGFxNx0K/MnVM9WbJ7RouEu0ndO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yRXojuVdn5GQtD97qYlaCL6cOLmZ7Cvcb3wFjkLUIdM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DuIkdRPITRs55I4SZmgomAHCIsDQmXRhW8+MOznkzSk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SsBk+Et1lTbU+QRPx+xyJ/jMkmfG+QCvQEpip2YYrzA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "crCIzOd8KhHvvUlX7M1v9bhvU4pLdTc+X2SuqoKU5Ek=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YOWdCw4UrqnxkAaVjqmC4sKQDMVMHEpFGnlxpxdaU6E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "M3SShp81Ff8tQ632qKbv9MUcN6wjDaBReI0VXNu6Xh4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gzHlSPxpM0hT75kQvWFzGlOxKvDoiKQZOr19V6l2zXI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s3JnppOGYw9SL2Q1kMAZs948v2F5PrpXjGei/HioDWs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cG6+3Gk/zEH68P/uuuwiAUVCuyJwa1LeV+t29FlPPAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dupdvR3AyJtM+g9NDKiaLVOtGca387JQp8w+V03m7Ig=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JqEQc5svj2jTvZ6LLA5ivE+kTb/0aRemSEmxk4G7Zrg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "szcXXXKnob+p3SoM4yED2R920LeJ7cVsclPMFTe4CeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o1QoGVXmuBdHwHm7aCtGMlMVKrjFdYvJXpoq6uhIAZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Jfm5wPlqqLCJRGQIqRq2NGmpn7s0Vrih2H3YAOoI2YU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zMHLb8ARbsYo8Ld05bqnGFf1Usha6EGb8QKwdSAyps0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yQdtq9lh5pugL7/i0Bj/PuZUUBUIzf+7wj1rl5y736w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wGWVZdO7qIuyDg/BqDgqjgoQ02h5YYgwXQB1oCin2NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "by9HMLj6NTEpgztZ5HSN6GxImkXPcaFINYDzgZY33X8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tWo0vbasi7bXmn/MsOx13VC1IsWtpx/nYp0uj4iMzdA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tQQpndUYd5O87lOtrGjH3wl9VsOK0ray7RMasL90sBM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cQjXEDCMsOpKLLf+vlTgIHA+cbSJdzqhbSX9Wvh95aA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7yMpU48IxK9SzP2cx3VnTownGEwFmeFofuuFT97SuuY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kSOx1kz0CmBgzKQHZlo65ZUY1DIv9A99JRm+Us2y6Ew=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ubQpdPBe6/xvtr+AcXdfYLSvYCR4ot0tivehkCsupb4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xal+iCJ6FTefRQToyoNksc9NCZShyn04NDGi4IYrcoM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "d7jU4iOK50xHxlkSifcxlZFCM46TSgQzoYivxG3HNLY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJvl2nsBLBVzL3pp6sKWCL4UXeh3q/roYBJjSb74ve0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OIUCaKRvIx9t1w6Hxlz1IcQTdPNCfdRNwnnTm10W+X0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A9tvzsiElotOUVIB4CqfQp9mAwqvTM35YkmAR170aHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lI8gpK7hpb7c9x4RQugsxMnQay5LZJmwslZdvMx/dcE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dNCzh40U0XvdKnSDi3HRQOWQftEsDVqc4uUvsVFGoq8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IP+iwEBWBwVVZIdpaMu8k5+soFCz+TZkYn3drKZ9grE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnqyh6e0y5svHkJDShlN9CHV0WvMBE4QbtJpQw5ZCXc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "elEl42tbVDoRTLjAhZUFEtXiut4b3PVhg/1ZLZSQdtE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vHuu2FxwclMHqyE6JBYbTYgbEkB0dqb/JuaxsvfwsmY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xTf7NCe3Gf8QpE78HR5OknlLTKfs9J+RN9UZpH6fnso=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XiWSasRnJAulGR6+LCVD3mwRObXylqYWR9jvpywq12c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MZMxEQ5ikx0PG1YFIExv0UnTZogsvgeOEZTpzvBDn4w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yZMyMZBDrWbAhvnic7vvIYhmO9m5H2iuv0c8KNZrBzY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xxM14hTPY5j0vvcK2C7YAEjzdsfUTFHozHC0hEo1bxI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+01rqR1xVwkpGXcstbk1ItJqFVjH6Q8MGxEN3Cm9Y1A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xOpLV0Z2VTRJ3iWtnWZcsyjXubTIkYWo31cO+HV1o1k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BWUOLqgLBqc5NwxVlSV5H3KFQPXbCp7mdo+jF+8cJqY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fuQb1S6xZDGlrEbK+kI23aL53PP1PVNwqICnZNt9Yzg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfscnoibFttahLdPVC4Ee+47ewGFKpDSU7M6HX19bKE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rpSW2awybNVeKtat91VFxqbINoTfNhPfQAu+d73Xtf8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9M/CP9ccOIIj2LLFmE0GFDO0Ban2wsNalEXfM6+h+1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WrEMG49l1ye4MhXs5ZS9tz8P6h+hDvthIg/2wW9ne1Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ImNhbfeyfH8qIEeA5ic0s3dAQBdzzTBS+CPsNih9vZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dWP33YDSn04UKJN2ogh2Rui0iW/0q2y18OCDRVcfyoo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lYv0isAtfGh6H9tdp3cp2eHU7q2J+uk7QrgcxtK3w7Y=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VGMoamB/+7zTOYcY/pqJc96xlv2PdW4hwsIAEIslTDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yNeBWMF7BnD9wVwz2PgJsvWr77QiVvvWUvJF0+fqBug=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfpvObJ+tJBXSvqeN7vlOfmhYign635lciYAJIjUtY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dsen4NqjzVGjpjufiTMs3+gqeD09EbnuogPgxrJECwg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pxCWVM3sn19NsFEpgHbgLa+PmYlhN3mMiP0Wk8kJhYw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q11KNvJszjYIB9n9HcC+N4uz11a3eRj1L3BH9scKMDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A1PmkgcEToWh1JiVWE6mI5jUu7poxWWuCUt/cgRUUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qJo3Hu4PJeanL7XEaWXO/n3YsodhZyd+MJOOmB9Kpd8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BkBKLO8URFscfRY9Bav/1+L9mLohDgNr/MkZtGiraIs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rZq5WA3Hx3xthOyHAJXK//f8pE2qbz7YKu3TIMp9GFY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X07a/Lm80p5xd4RFs1dNmw+90tmPDPdGiAKVZkxd4zY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6YrBn2ofIw1b5ooakrLOwF41BWrps8OO0H9WH4/rtlE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0l86Ag5OszXpa78SlOUV3K9nff5iC1p0mRXtLg9M1s4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Hn6yuxFHodeyu7ISlhYrbSf9pTiH4TDEvbYLWjTwFO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zdf4y2etKBuIpkEU1zMwoCkCsdisfXZCh8QPamm+drY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rOQ9oMdiK5xxGH+jPzOvwVqdGGnF3+HkJXxn81s6hp4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "61aKKsE3+BJHHWYvs3xSIBvlRmKswmaOo5rygQJguUg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KuDb/GIzqDM8wv7m7m8AECiWJbae5EKKtJRugZx7kR0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Q+t8t2TmNUiCIorVr9F3AlVnX+Mpt2ZYvN+s8UGict8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJRZIpKxUgHyL83kW8cvfjkxN3z6WoNnUg+SQw+LK+k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnUsYjip8SvW0+m9mR5WWTkpK+p6uwJ6yBUAlBnFKMk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PArHlz+yPRYDycAP/PgnI/AkP8Wgmfg++Vf4UG1Bf0E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wnIh53Q3jeK8jEBe1n8kJLa89/H0BxO26ZU8SRIAs9Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4F8U59gzBLGhq58PEWQk2nch+R0Va7eTUoxMneReUIA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ihKagIW3uT1dm22ROr/g5QaCpxZVj2+Fs/YSdM2Noco=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EJtUOOwjkrPUi9mavYAi+Gom9Y2DuFll7aDwo4mq0M0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dIkr8dbaVRQFskAVT6B286BbcBBt1pZPEOcTZqk4ZcI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aYVAcZYkH/Tieoa1XOjE/zCy5AJcVTHjS0NG2QB7muA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sBidL6y8TenseetpioIAAtn0lK/7C8MoW4JXpVYi3z8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0Dd2klU/t4R86c2WJcJDAd57k/N7OjvYSO5Vf8KH8sw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I3jZ92WEVmZmgaIkLbuWhBxl7EM6bEjiEttgBJunArA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aGHoQMlgJoGvArjfIbc3nnkoc8SWBxcrN7hSmjMRzos=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "bpiWPnF/KVBQr5F6MEwc5ZZayzIRvQOLDAm4ntwOi8g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tI7QVKbE6avWgDD9h4QKyFlnTxFCwd2iLySKakxNR/I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XGsge0CnoaXgE3rcpKm8AEeku5QVfokS3kcI+JKV1lk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JQxlryW2Q5WOwfrjAnaZxDvC83Dg6sjRVP5zegf2WiM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YFuHKJOfoqp1iGVxoFjx7bLYgVdsN4GuUFxEgO9HJ5s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Z6vUdiCR18ylKomf08uxcQHeRtmyav7/Ecvzz4av3k4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SPGo1Ib5AiP/tSllL7Z5PAypvnKdwJLzt8imfIMSEJQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "m94Nh6PFFQFLIib9Cu5LAKavhXnagSHG6F5EF8lD96I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pfEkQI98mB+gm1+JbmVurPAODMFPJ4E8DnqfVyUWbSo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DNj3OVRLbr43s0vd+rgWghOL3FqeO/60npdojC8Ry/M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kAYIQrjHVu49W8FTxyxJeiLVRWWjC9fPcBn+Hx1F+Ss=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "aCSO7UVOpoQvu/iridarxkxV1SVxU1i9HVSYXUAeXk4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Gh6hTP/yj1IKlXQ+Q69KTfMlGZjEcXoRLGbQHNFo/1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/gDgIFQ4tAlJk3GN48IS5Qa5IPmErwGk8CHxAbp6gs0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PICyimwPjxpusyKxNssOOwUotAUbygpyEtORsVGXT8g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4lu+cBHyAUvuxC6JUNyHLzHsCogGSWFFnUCkDwfQdgI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pSndkmoNUJwXjgkbkgOrT5f9nSvuoMEZOkwAN9ElRaE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tyW+D4i26QihNM5MuBM+wnt5AdWGSJaJ4X5ydc9iWTU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9Syjr8RoxUgPKr+O5rsCu07AvcebA4P8IVKyS1NVLWc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "67tPfDYnK2tmrioI51fOBG0ygajcV0pLo5+Zm/rEW7U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "y0EiPRxYTuS1eVTIaPQUQBBxwkyxNckbePvKgChwd0M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NWd+2veAaeXQgR3vCvzlI4R1WW67D5YsVLdoXfdb8qg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PY5RQqKQsL2GqBBSPNOEVpojNFRX/NijCghIpxD6CZk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lcvwTyEjFlssCJtdjRpdN6oY+C7bxZY+WA+QAqzj9zg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWE7XRNylvTwO/9Fv56dNqUaQWMmESNS/GNIwgBaEI0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ijwlrUeS8nRYqK1F8kiCYF0mNDolEZS+/lJO1Lg93C8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8KzV+qYGYuIjoNj8eEpnTuHrMYuhzphl80rS6wrODuU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wDyTLjSEFF895hSQsHvmoEQVS6KIkZOtq1c9dVogm9I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SGrtPuMYCjUrfKF0Pq/thdaQzmGBMUvlwN3ORIu9tHU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KySHON3hIoUk4xWcwTqk6IL0kgjzjxgMBObVIkCGvk4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hBIdS9j0XJPeT4ot73ngELkpUoSixvRBvdOL9z48jY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Tx6um0q9HjS5ZvlFhvukpI6ORnyrXMWVW1OoxvgqII0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zFKlyfX5H81+d4A4J3FKn4T5JfG+OWtR06ddyX4Mxas=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cGgCDuPV7MeMMYEDpgOupqyNP4BQ4H7rBnd2QygumgM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IPaUoy98v11EoglTpJ4kBlEawoZ8y7BPwzjLYBpkvHQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Pfo4Am6tOWAyZNn8G9W5HWWGC3ZWmX0igI/RRB870Ro=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fnTSjd7bC1Udoq6iM7UDnHAC/lsIXSHp/Gy332qw+/I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fApBgVRrTDyEumkeWs5p3ag9KB48SbU4Si0dl7Ns9rc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QxudfBItgoCnUj5NXVnSmWH3HK76YtKkMmzn4lyyUYY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sSOvwhKa29Wq94bZ5jGIiJQGbG1uBrKSBfOYBz/oZeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FdaMgwwJ0NKsqmPZLC5oE+/0D74Dfpvig3LaI5yW5Fs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "sRWBy12IERN43BSZIrnBfC9+zFBUdvjTlkqIH81NGt4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/4tIRpxKhoOwnXAiFn1Z7Xmric4USOIfKvTYQXk3QTc=", - "subType": "00" - } - } - ] - }, - { - "_id": { - "$numberInt": "1" - }, - "encryptedDecimalNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "Mr/laWHUijZT5VT3x2a7crb7wgd/UXOGz8jr8BVqBpM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wXVD/HSbBljko0jJcaxJ1nrzs2+pchLQqYR3vywS8SU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VDCpBYsJIxTfcI6Zgf7FTmKMxUffQv+Ys8zt5dlK76I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zYDslUwOUVNwTYkETfjceH/PU3bac9X3UuQyYJ19qK0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rAOmHSz18Jx107xpbv9fYcPOmh/KPAqge0PAtuhIRnc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BFOB1OGVUen7VsOuS0g8Ti7oDsTt2Yj/k/7ta8YAdGM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2fckE5SPs0GU+akDkUEM6mm0EtcV3WDE/sQsnTtodlk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "mi9+aNjuwIvaMpSHENvKzKRAmX9cYguo2mXLvOoftHQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "K6TWn4VcWWkz/gkUkLmbtwkG7SNeABICmLDnoYJFlLU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Z+2/cEtGU0Fq7QJFNGA/0y4aWAsw0ncG6X0LYRqwS3c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rrSIf+lgcNZFbbUkS9BmE045jRWBpcBJXHzfMVEFuzE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KlHL3Kyje1/LMIfgbCqw1SolxffJvvgsYBV5y77wxuA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hzJ1YBoETmYeCh352dBmG8d8Wse/bUcqojTWpWQlgsc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lSdcllDXx8MA+s0GULjDA1lQkcV0L8/aHtZ6dM2pZ2c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "HGr7JLTTA7ksAnlmjSIwwdBVvgr3fv46/FTdiCPYpos=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "mMr25v1VwOEVZ8xaNUTHJCcsYqV+kwK6RzGYilxPtJ4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "129hJbziPJzNo0IoTU3bECdge0FtaPW8dm4dyNVNwYU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "doiLJ96qoo+v7NqIAZLq6BI5axV8Id8gT5vyJ1ZZ0PM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cW/Lcul3xYmfyvI/0x/+ybN78aQmBK1XIGs1EEU09N8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1aVIwzu9N5EJV9yEES+/g6hOTH7cA2NTcLIc59cu0wU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kw5tyl7Ew0r1wFyrN1mB9FiVW2hK2BxxxUuJDNWjyjQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ADAY2YBrm6RJBDY/eLLcfNxmSJku+mefz74gH66oyco=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8gkqB1LojzPrstpFG7RHYmWxXpIlPDTqWnNsXH7XDRU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "TESfVQMDQjfTZmHmUeYUE2XrokJ6CcrsKx/GmypGjOw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qFM+HFVQ539S0Ouynd1fBHoemFxtU9PRxE5+Dq7Ljy4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jPiFgUZteSmOg4wf3bsEKCZzcnxmMoILsgp/GaZD+dM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YaWUgJhYgPNN7TkFK16H8SsQS226JguaVhOIQxZwQNQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x90/Qk3AgyaFsvWf2KUCu5XF3j76WFSjt/GrnG01060=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ZGWybWL/xlEdMYRFCZDUoz10sywTf7U/7wufsb78lH0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8l4ganN66jIcdxfHAdYLaym/mdzUUQ8TViw3MDRySPc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "c8p5XEGTqxqvRGVlR+nkxw9uUdoqDqTB0jlYQ361qMA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1ZGFLlpQBcU3zIUg8MmgWwFKVz/SaA7eSYFrfe3Hb70=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "34529174M77rHr3Ftn9r8jU4a5ztYtyVhMn1wryZSkU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YkQ4pxFWzc49MS0vZM6S8mNo4wAwo21rePBeF3C+9mI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MhOf4mYY00KKVhptOcXf0bXB7WfuuM801MRJg4vXPgc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7pbbD8ihNIYIBJ3tAUPGzHpFPpIeCTAk5L88qCB0/9w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "C9Q5PoNJTQo6pmNzXEEXUEqH22//UUWY1gqILcIywec=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "AqGVk1QjDNDLYWGRBX/nv9QdGR2SEgXZEhF0EWBAiSE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/sGI3VCbJUKATULJmhTayPOeVW+5MjWSvVCqS77sRbU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yOtbL0ih7gsuoxVtRrACMz+4N5uo7jIR7zzmtih2Beo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uA6dkb2Iyg9Su8UNDvZzkPx33kPZtWr/CCuEY+XgzUM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1DoSFPdHIplqZk+DyWAmEPckWwXw/GdB25NLmzeEZhk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OfDVS0T3ZuIXI/LNbTp6C9UbPIWLKiMy6Wx+9tqNl+g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "3PZjHXbmG6GtPz+iapKtQ3yY4PoFFgjIy+fV2xQv1YU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kaoLN0BoBWsmqE7kKkJQejATmLShd8qffcAmlhsxsGY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vpiw9KgQdegGmp7IJnSGX2miujRLU0xzs0ITTqbPW7c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NuXFf7xGUefYjIUTuMxNUTCfVHrF8oL0AT7dPv5Plk4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8Tz53LxtfEBJ9eR+d2690kwNsqPV6XyKo2PlqZCbUrc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "e6zsOmHSyV8tyQtSX6BSwui6wK9v1xG3giY/IILJQ2w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2fedFMCxa2DzmIpfbDKGXhQg0PPwbUv6vIWdwwlvhms=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yEJKMFnWXTC8tJUfzCInzQRByNEPjHxpw4L4m8No91Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YbFuWwOiFuQyOzIJXDbOkCWC2DyrG+248TBuVCa1pXU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "w7IkwGdrguwDrar5+w0Z3va5wXyZ4VXJkDMISyRjPGo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YmJUoILTRJPhyIyWyXJTsQ6KSZHHbEpwPVup6Ldm/Ko=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FvMjcwVZJmfh6FP/yBg2wgskK+KHD8YVUY6WtrE8xbg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "h4HCtD4HyYz0nci49IVAa10Z4NJD/FHnRMV4sRX6qro=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "nC7BpXCmym+a0Is2kReM9cYN2M1Eh5rVo8fjms14Oiw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1qtVWaeVo649ZZZtN8gXbwLgMWGLhz8beODbvru0I7Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Ej+mC0QFyMNIiSjR939S+iGBm7dm+1xObu5IcF/OpbU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UQ8LbUG3cMegbr9yKfKanAPQE1EfPkFciVDrNqZ5GHY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4iI3mXIDjnX+ralk1HhJY43mZx2uTJM7hsv9MQzTX7E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0WQCcs3rvsasgohERHHCaBM4Iy6yomS4qJ5To3/yYiw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qDCTVPoue1/DOAGNAlUstdA9Sid8MgEY4e5EzHcVHRk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9F9Mus0UnlzHb8E8ImxgXtz6SU98YXD0JqswOKw/Bzs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pctHpHKVBBcsahQ6TNh6/1V1ZrqOtKSAPtATV6BJqh0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vfR3C/4cPkVdxtNaqtF/v635ONbhTf5WbwJM6s4EXNE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ejP43xUBIex6szDcqExAFpx1IE/Ksi5ywJ84GKDFRrs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jbP4AWYd3S2f3ejmMG7dS5IbrFol48UUoT+ve3JLN6U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CiDifI7958sUjNqJUBQULeyF7x0Up3loPWvYKw9uAuw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "e2dQFsiHqd2BFHNhlSxocjd+cPs4wkcUW/CnCz4KNuM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PJFckVmzBipqaEqsuP2mkjhJE4qhw36NhfQ9DcOHyEU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "S3MeuJhET/B8VcfZYDR9fvX0nscDj416jdDekhmK11s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CGVHZRXpuNtQviDB2Kj03Q8uvs4w3RwTgV847R7GwPw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yUGgmgyLrxbEpDVy89XN3c2cmFpZXWWmuJ/35zVZ+Jw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "inb6Q97mL1a9onfNTT8v9wsoi/fz7KXKq3p8j90AU9c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CCyYx/4npq9xGO1lsCo8ZJhFO9/tN7DB+/DTE778rYg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "LNnYw4fwbiAZu0kBdAHPEm/OFnreS+oArdB5O/l/I98=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "P006SxmUS/RjiQJVYPdMFnNo3827GIEmSzagggkg05Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "oyvwY+WsnYV6UHuPki1o0ILJ2jN4uyXf9yaUNtZJyBA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "36Lk3RHWh1wmtCWC/Yj6jNIo17U5y6SofAgQjzjVxD8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vOOo8FqeHnuO9mqOYjIb4vgwIwVyXZ5Y+bY5d9tGFUM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "bJiDJjwQRNxqxlGjRm5lLziFhcfTDCnQ/qU1V85qcRg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2Qgrm1n0wUELAQnpkEiIHB856yv76q8jLbpiucetcm0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "5ciPOYxTK0WDwwYyfs7yiVymwtYQXDELLxmM4JLl4/o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "31dC2WUSIOKQc4jwT6PikfeYTwi80mTlh7P31T5KNQU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YluTV2Mu53EGCKLcWfHZb0BM/IPW2xJdG3vYlDMEsM4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dh/8lGo2Ek6KukSwutH6Q35iy8TgV0FN0SJqe0ZVHN8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EVw6HpIs3BKen2qY2gz4y5dw1JpXilfh07msZfQqJpc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FYolLla9L8EZMROEdWetozroU40Dnmwwx2jIMrr7c1A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "8M6k4QIutSIj6CM41vvkQtuFsaGrjoR9SZJVSLbfGKQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9LM0VoddDNHway442MqY+Z7vohB2UHau/cddshhzf40=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "66i8Ytco4Yq/FMl6pIRZazz3CZlu8fO2OI6Pne0pvHU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2a/HgX+MjZxjXtSvHgF1yEpHMJBkl8Caee8XrJtn0WM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "frhBM662c4ZVG7mWP8K/HhRjd01lydW/cPcHnDjifqc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6k1T7Q1t668PBqv6fwpVnT1HWh7Am5LtbKvwPJKcpGU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UlJ5Edfusp8S/Pyhw6KTglIejmbr1HO0zUeHn/qFETA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jsxsB+1ECB3assUdoC333do9tYH+LglHmVSJHy4N8Hg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2nzIQxGYF7j3bGsIesECEOqhObKs/9ywknPHeJ3yges=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xJYKtuWrX90JrJVoYtnwP7Ce59XQGFYoalxpNfBXEH0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NLI5lriBTleGCELcHBtNnmnvwSRkHHaLOX4cKboMgTw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hUOQV0RmE5aJdJww1AR9rirJG4zOYPo+6cCkgn/BGvQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "h4G2Of76AgxcUziBwCyH+ayMOpdBWzg4yFrTfehSC2c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VuamM75RzGfQpj2/Y1jSVuQLrhy6OAwlZxjuQLB/9Ss=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kn9+hLq7hvw02xr9vrplOCDXKBTuFhfbX7d5v/l85Pg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fAiGqKyLZpGngBYFbtYUYt8LUrJ49vYafiboifTDjxs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BxRILymgfVJCczqjUIWXcfrfSgrrYkxTM5VTg0HkZLY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CrFY/PzfPU2zsFkGLu/dI6mEeizZzCR+uYgjZBAHro0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "AEbrIuwvXLTtYgMjOqnGQ8y8axUn5Ukrn7UZRSyfQVw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ouWeVH3PEFg+dKWlXc6BmqirJOaVWjJbMzZbCsce4dA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+hd6xFB+EG+kVP7WH4uMd1CLaWMnt5xJRaY/Guuga9Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zmpGalfAOL3gmcUMJYcLYIRT/2VDO/1Dw4KdYZoNcng=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2PbHAoM/46J2UIZ/vyksKzmVVfxA7YUyIxWeL/N/vBk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7fD9x+zk5MVFesb59Klqiwwmve7P5ON/5COURXj5smE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tlrNQ4jaq051iaWonuv1sSrYhKkL1LtNZuHsvATha3s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fBodm28iClNpvlRyVq0dOdXQ08S7/N3aDwid+PdWvRo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "O+/nnRqT3Zv7yMMGug8GhKHaWy6u7BfRGtZoj0sdN1c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "5AZZ/RTMY4Photnm/cpXZr/HnFRi3eljacMsipkJLHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "oFVyo/kgoMxBIk2VE52ySSimeyU+Gr0EfCwapXnTpKA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Z8v59DfcnviA0mzvnUk+URVO0UuqAWvtarEgJva/n1c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "P64GOntZ+zBJEHkigoh9FSxSO+rJTqR20z5aiGQ9an4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xMbSuDPfWuO/Dm7wuVl06GnzG9uzTlJJX9vFy7boGlY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kXPB19mRClxdH2UsHwlttS6lLU2uHvzuZgZz7kC45jU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NDVjVYXAw4k0w4tFzvs7QDq39aaU3HQor4I2XMKKnCk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uKw/+ErVfpTO1dGUfd3T/eWfZW3nUxXCdBGdjvHtZ88=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "av0uxEzWkizYWm0QUM/MN1hLibnxPvCWJKwjOV4yVQY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ERwUC47dvgOBzIsEESMIioLYbFOxOe8PtJTnmDkKuHM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2gseKlG5Le12fS/vj4eaED4lturF16kAgJ1TpW3HxEE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7Cvg0Y3j/5i2F1TeXxlMmU7xwif5dCmwkZAOrVC5K2Y=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-Aggregate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-Aggregate.json deleted file mode 100644 index 271f57b125d..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-Aggregate.json +++ /dev/null @@ -1,584 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range DecimalPrecision. Aggregate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$gt": { - "$numberDecimal": "0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDecimalPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "default", - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - } - } - ], - "cursor": {}, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "aggregate" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": { - "$numberInt": "0" - }, - "encryptedDecimalPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "Dri0CXmL78L2DOgk9w0DwxHOMGMzih7m6l59vgy+WWo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "b7d8mRzD1kI1tdc7uNL+YAUonJ6pODLsRLkArfEKSkM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Xg8C1/A0KJaXOw4i+26Rv03/CydaaunOzXh0CIT+gn8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UoKUDw2wJYToUCcFaIs03YQSTksYR0MIOTJllwODqKc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "c/5cwAT0C5jber2xlJnWD3a5tVDy0nRtr5HG02hoFOY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wSUrRXavAGaajNeqC5mEUH1K67oYl5Wy9RNIzKjwLAM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6vrp4wWDtHEgHWR99I70WVDzevg1Fk/Pw5U8gUDa0OU=", - "subType": "00" - } - } - ] - }, - { - "_id": { - "$numberInt": "1" - }, - "encryptedDecimalPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "mVZb+Ra0EYjQ4Zrh9X//E2T8MRj7NMqm5GUJXhRrBEI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FA74j21GUEJb1DJBOpR9nVnjaDZnd8yAQNuaW9Qi26g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kJv//KVkbrobIBf+QeWC5jxn20mx/P0R1N6aCSMgKM8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zB+Whi9IUUGxfLEe+lGuIzLX4LFbIhaIAm5lRk65QTc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ybO1QU3CgvhO8JgRXH+HxKszWcpl5aGDYYVa75fHa1g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X3Y3eSAbbMg//JgiHHiFpYOpV61t8kkDexI+CQyitH4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SlNHXyqVFGDPrX/2ppwog6l4pwj3PKda2TkZbqgfSfA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "McjV8xwTF3xI7863DYOBdyvIv6UpzThl6v9vBRk05bI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MgwakFvPyBlwqFTbhWUF79URJQWFoJTGotlEVSPPUsQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DyBERpMSD5lEM5Nhpcn4WGgxgn/mkUVJp+PYSLX5jsE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I43iazc0xj1WVbYB/V+uTL/tughN1bBlxh1iypBnNsA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wjOBa/ATMuOywFmuPgC0GF/oeLqu0Z7eK5udzkTPbis=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gRQVwiR+m+0Vg8ZDXqrQQcVnTyobwCXNaA4BCJVXtMc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WUZ6huwx0ZbLb0R00uiC9FOJzsUocUN8qE5+YRenkvQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7s79aKEuPgQcS/YPOOVcYNZvHIo7FFsWtFCrnDKXefA=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-Correctness.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-Correctness.json deleted file mode 100644 index 89544458874..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-Correctness.json +++ /dev/null @@ -1,1650 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Find with $gt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$gt": { - "$numberDecimal": "0.0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$gte": { - "$numberDecimal": "0.0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - }, - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$gt": { - "$numberDecimal": "1.0" - } - } - } - }, - "result": [] - } - ] - }, - { - "description": "Find with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$lt": { - "$numberDecimal": "1.0" - } - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - ] - } - ] - }, - { - "description": "Find with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$lte": { - "$numberDecimal": "1.0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - }, - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $lt below min", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$lt": { - "$numberDecimal": "0.0" - } - } - } - }, - "result": { - "errorContains": "must be greater than the range minimum" - } - } - ] - }, - { - "description": "Find with $gt above max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$gt": { - "$numberDecimal": "200.0" - } - } - } - }, - "result": { - "errorContains": "must be less than the range max" - } - } - ] - }, - { - "description": "Find with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$gt": { - "$numberDecimal": "0.0" - }, - "$lt": { - "$numberDecimal": "2.0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - ] - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with full range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$gte": { - "$numberDecimal": "0.0" - }, - "$lte": { - "$numberDecimal": "200.0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - }, - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$in": [ - { - "$numberDecimal": "0.0" - } - ] - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - ] - } - ] - }, - { - "description": "Insert out of range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "-1" - } - } - }, - "result": { - "errorContains": "value must be greater than or equal to the minimum value" - } - } - ] - }, - { - "description": "Insert min and max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 200, - "encryptedDecimalPrecision": { - "$numberDecimal": "200.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - }, - { - "_id": 200, - "encryptedDecimalPrecision": { - "$numberDecimal": "200.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$gte": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - }, - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$gt": { - "$numberDecimal": "1.0" - } - } - } - } - ] - }, - "result": [] - } - ] - }, - { - "description": "Aggregate with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$lt": { - "$numberDecimal": "1.0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$lte": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - }, - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $lt below min", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$lt": { - "$numberDecimal": "0.0" - } - } - } - } - ] - }, - "result": { - "errorContains": "must be greater than the range minimum" - } - } - ] - }, - { - "description": "Aggregate with $gt above max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$gt": { - "$numberDecimal": "200.0" - } - } - } - } - ] - }, - "result": { - "errorContains": "must be less than the range max" - } - } - ] - }, - { - "description": "Aggregate with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$gt": { - "$numberDecimal": "0.0" - }, - "$lt": { - "$numberDecimal": "2.0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - ] - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with full range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$gte": { - "$numberDecimal": "0.0" - }, - "$lte": { - "$numberDecimal": "200.0" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - }, - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDecimalPrecision": { - "$in": [ - { - "$numberDecimal": "0.0" - } - ] - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0.0" - } - } - ] - } - ] - }, - { - "description": "Wrong type: Insert Int", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberInt": "0" - } - } - }, - "result": { - "errorContains": "cannot encrypt element" - } - } - ] - }, - { - "description": "Wrong type: Find Int", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$gte": { - "$numberInt": "0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": { - "errorContains": "field type is not supported" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-Delete.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-Delete.json deleted file mode 100644 index 7b3d5d8225a..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-Delete.json +++ /dev/null @@ -1,476 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range DecimalPrecision. Delete.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1" - } - } - } - }, - { - "name": "deleteOne", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$gt": { - "$numberDecimal": "0" - } - } - } - }, - "result": { - "deletedCount": 1 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDecimalPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "delete": "default", - "deletes": [ - { - "q": { - "encryptedDecimalPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "limit": 1 - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "delete" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": { - "$numberInt": "0" - }, - "encryptedDecimalPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "Dri0CXmL78L2DOgk9w0DwxHOMGMzih7m6l59vgy+WWo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "b7d8mRzD1kI1tdc7uNL+YAUonJ6pODLsRLkArfEKSkM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Xg8C1/A0KJaXOw4i+26Rv03/CydaaunOzXh0CIT+gn8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UoKUDw2wJYToUCcFaIs03YQSTksYR0MIOTJllwODqKc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "c/5cwAT0C5jber2xlJnWD3a5tVDy0nRtr5HG02hoFOY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wSUrRXavAGaajNeqC5mEUH1K67oYl5Wy9RNIzKjwLAM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6vrp4wWDtHEgHWR99I70WVDzevg1Fk/Pw5U8gUDa0OU=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-FindOneAndUpdate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-FindOneAndUpdate.json deleted file mode 100644 index af371f7b3fe..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-FindOneAndUpdate.json +++ /dev/null @@ -1,588 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range DecimalPrecision. FindOneAndUpdate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1" - } - } - } - }, - { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$gt": { - "$numberDecimal": "0" - } - } - }, - "update": { - "$set": { - "encryptedDecimalPrecision": { - "$numberDecimal": "2" - } - } - }, - "returnDocument": "Before" - }, - "result": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDecimalPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default", - "query": { - "encryptedDecimalPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "update": { - "$set": { - "encryptedDecimalPrecision": { - "$$type": "binData" - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "findAndModify" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": { - "$numberInt": "0" - }, - "encryptedDecimalPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "Dri0CXmL78L2DOgk9w0DwxHOMGMzih7m6l59vgy+WWo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "b7d8mRzD1kI1tdc7uNL+YAUonJ6pODLsRLkArfEKSkM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Xg8C1/A0KJaXOw4i+26Rv03/CydaaunOzXh0CIT+gn8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UoKUDw2wJYToUCcFaIs03YQSTksYR0MIOTJllwODqKc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "c/5cwAT0C5jber2xlJnWD3a5tVDy0nRtr5HG02hoFOY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wSUrRXavAGaajNeqC5mEUH1K67oYl5Wy9RNIzKjwLAM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6vrp4wWDtHEgHWR99I70WVDzevg1Fk/Pw5U8gUDa0OU=", - "subType": "00" - } - } - ] - }, - { - "_id": { - "$numberInt": "1" - }, - "encryptedDecimalPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "V6knyt7Zq2CG3++l75UtBx2m32iGAPjHiAe439Bf02w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "F08nMDWDZc+DbWM7XCEJNNCEYyinRmrvGP7EWhmp4is=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cXH4688amcDc8kZOJq4UP8cE3R58Zl7e+Qo/1jyspps=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uURBxvTp3FBCVkd+LPqyuY7d6rMW6SGIJQEPY/wtkZI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jG3hax1L3RBp9t38vUt53FsBxgr/+Si/vVISpAylYpE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kwtIW8MhH9Ky5xNjBx8gFA/SHh2YVphie7g5FGBzals=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FHflwFuEMu4xX0ZApHi+pdlBH+oevAtXckCUb5Wv0xU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0OKSXELxPP85SBVwDGf3LtMEQCJ8TTkFUl/+6jlkdb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uEw0lpQtBppR3vqV9j9+NQRSBF1BzZukb8c9IhyWvxc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zVhZ7Q59O087ji49oMJvBIgeir2oqvUpnh4p53GcTow=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dowrzKs+qJhRMZyKDbhjXbuX43FbmUKOaw9I8YlOZDw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ep5B6cska6THLIF7Mn3tn3RvV9EiwLSt0eZM/CLRUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "URNp/YmmDh5wIZUfAzzgPyJeMNiVx9PMsz52DZRujGY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wlM4IAQhhKQEzoVqS8b1Ddd50GB95OFb9LnzOwyjCP4=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-InsertFind.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-InsertFind.json deleted file mode 100644 index bbe81f87adc..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-InsertFind.json +++ /dev/null @@ -1,571 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range DecimalPrecision. Insert and Find.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$gt": { - "$numberDecimal": "0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDecimalPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "encryptedDecimalPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "Dri0CXmL78L2DOgk9w0DwxHOMGMzih7m6l59vgy+WWo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "b7d8mRzD1kI1tdc7uNL+YAUonJ6pODLsRLkArfEKSkM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Xg8C1/A0KJaXOw4i+26Rv03/CydaaunOzXh0CIT+gn8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UoKUDw2wJYToUCcFaIs03YQSTksYR0MIOTJllwODqKc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "c/5cwAT0C5jber2xlJnWD3a5tVDy0nRtr5HG02hoFOY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wSUrRXavAGaajNeqC5mEUH1K67oYl5Wy9RNIzKjwLAM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6vrp4wWDtHEgHWR99I70WVDzevg1Fk/Pw5U8gUDa0OU=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDecimalPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "mVZb+Ra0EYjQ4Zrh9X//E2T8MRj7NMqm5GUJXhRrBEI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FA74j21GUEJb1DJBOpR9nVnjaDZnd8yAQNuaW9Qi26g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kJv//KVkbrobIBf+QeWC5jxn20mx/P0R1N6aCSMgKM8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zB+Whi9IUUGxfLEe+lGuIzLX4LFbIhaIAm5lRk65QTc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ybO1QU3CgvhO8JgRXH+HxKszWcpl5aGDYYVa75fHa1g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X3Y3eSAbbMg//JgiHHiFpYOpV61t8kkDexI+CQyitH4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SlNHXyqVFGDPrX/2ppwog6l4pwj3PKda2TkZbqgfSfA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "McjV8xwTF3xI7863DYOBdyvIv6UpzThl6v9vBRk05bI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MgwakFvPyBlwqFTbhWUF79URJQWFoJTGotlEVSPPUsQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DyBERpMSD5lEM5Nhpcn4WGgxgn/mkUVJp+PYSLX5jsE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I43iazc0xj1WVbYB/V+uTL/tughN1bBlxh1iypBnNsA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wjOBa/ATMuOywFmuPgC0GF/oeLqu0Z7eK5udzkTPbis=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gRQVwiR+m+0Vg8ZDXqrQQcVnTyobwCXNaA4BCJVXtMc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WUZ6huwx0ZbLb0R00uiC9FOJzsUocUN8qE5+YRenkvQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7s79aKEuPgQcS/YPOOVcYNZvHIo7FFsWtFCrnDKXefA=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-Update.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-Update.json deleted file mode 100644 index 987bdf1aa66..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DecimalPrecision-Update.json +++ /dev/null @@ -1,588 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range DecimalPrecision. Update.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDecimalPrecision": { - "$numberDecimal": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDecimalPrecision": { - "$numberDecimal": "1" - } - } - } - }, - { - "name": "updateOne", - "arguments": { - "filter": { - "encryptedDecimalPrecision": { - "$gt": { - "$numberDecimal": "0" - } - } - }, - "update": { - "$set": { - "encryptedDecimalPrecision": { - "$numberDecimal": "2" - } - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDecimalPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command_name": "update", - "command": { - "update": "default", - "ordered": true, - "updates": [ - { - "q": { - "encryptedDecimalPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "u": { - "$set": { - "encryptedDecimalPrecision": { - "$$type": "binData" - } - } - } - } - ], - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDecimalPrecision", - "bsonType": "decimal", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDecimal": "0.0" - }, - "max": { - "$numberDecimal": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - }, - "$db": "default" - } - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDecimalPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "Dri0CXmL78L2DOgk9w0DwxHOMGMzih7m6l59vgy+WWo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "b7d8mRzD1kI1tdc7uNL+YAUonJ6pODLsRLkArfEKSkM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Xg8C1/A0KJaXOw4i+26Rv03/CydaaunOzXh0CIT+gn8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UoKUDw2wJYToUCcFaIs03YQSTksYR0MIOTJllwODqKc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "c/5cwAT0C5jber2xlJnWD3a5tVDy0nRtr5HG02hoFOY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wSUrRXavAGaajNeqC5mEUH1K67oYl5Wy9RNIzKjwLAM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6vrp4wWDtHEgHWR99I70WVDzevg1Fk/Pw5U8gUDa0OU=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDecimalPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "V6knyt7Zq2CG3++l75UtBx2m32iGAPjHiAe439Bf02w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "F08nMDWDZc+DbWM7XCEJNNCEYyinRmrvGP7EWhmp4is=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cXH4688amcDc8kZOJq4UP8cE3R58Zl7e+Qo/1jyspps=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uURBxvTp3FBCVkd+LPqyuY7d6rMW6SGIJQEPY/wtkZI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jG3hax1L3RBp9t38vUt53FsBxgr/+Si/vVISpAylYpE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kwtIW8MhH9Ky5xNjBx8gFA/SHh2YVphie7g5FGBzals=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FHflwFuEMu4xX0ZApHi+pdlBH+oevAtXckCUb5Wv0xU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0OKSXELxPP85SBVwDGf3LtMEQCJ8TTkFUl/+6jlkdb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uEw0lpQtBppR3vqV9j9+NQRSBF1BzZukb8c9IhyWvxc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zVhZ7Q59O087ji49oMJvBIgeir2oqvUpnh4p53GcTow=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dowrzKs+qJhRMZyKDbhjXbuX43FbmUKOaw9I8YlOZDw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ep5B6cska6THLIF7Mn3tn3RvV9EiwLSt0eZM/CLRUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "URNp/YmmDh5wIZUfAzzgPyJeMNiVx9PMsz52DZRujGY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wlM4IAQhhKQEzoVqS8b1Ddd50GB95OFb9LnzOwyjCP4=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Defaults.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Defaults.json deleted file mode 100644 index c2a119cb7f6..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Defaults.json +++ /dev/null @@ -1,381 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range applies defaults for trimFactor and sparsity", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$gt": { - "$numberInt": "0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "encryptedInt": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - } - ] - }, - { - "_id": { - "$numberInt": "1" - }, - "encryptedInt": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SlNHXyqVFGDPrX/2ppwog6l4pwj3PKda2TkZbqgfSfA=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-Aggregate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-Aggregate.json deleted file mode 100644 index daa7f4e9736..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-Aggregate.json +++ /dev/null @@ -1,1132 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Double. Aggregate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$numberDouble": "0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "default", - "pipeline": [ - { - "$match": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - } - } - ], - "cursor": {}, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "aggregate" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "6YrBn2ofIw1b5ooakrLOwF41BWrps8OO0H9WH4/rtlE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "n+XAuFnP8Dov9TnhGFxNx0K/MnVM9WbJ7RouEu0ndO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yRXojuVdn5GQtD97qYlaCL6cOLmZ7Cvcb3wFjkLUIdM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DuIkdRPITRs55I4SZmgomAHCIsDQmXRhW8+MOznkzSk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SsBk+Et1lTbU+QRPx+xyJ/jMkmfG+QCvQEpip2YYrzA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "crCIzOd8KhHvvUlX7M1v9bhvU4pLdTc+X2SuqoKU5Ek=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YOWdCw4UrqnxkAaVjqmC4sKQDMVMHEpFGnlxpxdaU6E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "M3SShp81Ff8tQ632qKbv9MUcN6wjDaBReI0VXNu6Xh4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gzHlSPxpM0hT75kQvWFzGlOxKvDoiKQZOr19V6l2zXI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s3JnppOGYw9SL2Q1kMAZs948v2F5PrpXjGei/HioDWs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cG6+3Gk/zEH68P/uuuwiAUVCuyJwa1LeV+t29FlPPAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dupdvR3AyJtM+g9NDKiaLVOtGca387JQp8w+V03m7Ig=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JqEQc5svj2jTvZ6LLA5ivE+kTb/0aRemSEmxk4G7Zrg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "szcXXXKnob+p3SoM4yED2R920LeJ7cVsclPMFTe4CeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o1QoGVXmuBdHwHm7aCtGMlMVKrjFdYvJXpoq6uhIAZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Jfm5wPlqqLCJRGQIqRq2NGmpn7s0Vrih2H3YAOoI2YU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zMHLb8ARbsYo8Ld05bqnGFf1Usha6EGb8QKwdSAyps0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yQdtq9lh5pugL7/i0Bj/PuZUUBUIzf+7wj1rl5y736w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wGWVZdO7qIuyDg/BqDgqjgoQ02h5YYgwXQB1oCin2NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "by9HMLj6NTEpgztZ5HSN6GxImkXPcaFINYDzgZY33X8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tWo0vbasi7bXmn/MsOx13VC1IsWtpx/nYp0uj4iMzdA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tQQpndUYd5O87lOtrGjH3wl9VsOK0ray7RMasL90sBM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cQjXEDCMsOpKLLf+vlTgIHA+cbSJdzqhbSX9Wvh95aA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7yMpU48IxK9SzP2cx3VnTownGEwFmeFofuuFT97SuuY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kSOx1kz0CmBgzKQHZlo65ZUY1DIv9A99JRm+Us2y6Ew=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ubQpdPBe6/xvtr+AcXdfYLSvYCR4ot0tivehkCsupb4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xal+iCJ6FTefRQToyoNksc9NCZShyn04NDGi4IYrcoM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "d7jU4iOK50xHxlkSifcxlZFCM46TSgQzoYivxG3HNLY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJvl2nsBLBVzL3pp6sKWCL4UXeh3q/roYBJjSb74ve0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OIUCaKRvIx9t1w6Hxlz1IcQTdPNCfdRNwnnTm10W+X0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A9tvzsiElotOUVIB4CqfQp9mAwqvTM35YkmAR170aHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lI8gpK7hpb7c9x4RQugsxMnQay5LZJmwslZdvMx/dcE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dNCzh40U0XvdKnSDi3HRQOWQftEsDVqc4uUvsVFGoq8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IP+iwEBWBwVVZIdpaMu8k5+soFCz+TZkYn3drKZ9grE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnqyh6e0y5svHkJDShlN9CHV0WvMBE4QbtJpQw5ZCXc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "elEl42tbVDoRTLjAhZUFEtXiut4b3PVhg/1ZLZSQdtE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vHuu2FxwclMHqyE6JBYbTYgbEkB0dqb/JuaxsvfwsmY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xTf7NCe3Gf8QpE78HR5OknlLTKfs9J+RN9UZpH6fnso=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XiWSasRnJAulGR6+LCVD3mwRObXylqYWR9jvpywq12c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MZMxEQ5ikx0PG1YFIExv0UnTZogsvgeOEZTpzvBDn4w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yZMyMZBDrWbAhvnic7vvIYhmO9m5H2iuv0c8KNZrBzY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xxM14hTPY5j0vvcK2C7YAEjzdsfUTFHozHC0hEo1bxI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+01rqR1xVwkpGXcstbk1ItJqFVjH6Q8MGxEN3Cm9Y1A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xOpLV0Z2VTRJ3iWtnWZcsyjXubTIkYWo31cO+HV1o1k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BWUOLqgLBqc5NwxVlSV5H3KFQPXbCp7mdo+jF+8cJqY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fuQb1S6xZDGlrEbK+kI23aL53PP1PVNwqICnZNt9Yzg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfscnoibFttahLdPVC4Ee+47ewGFKpDSU7M6HX19bKE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rpSW2awybNVeKtat91VFxqbINoTfNhPfQAu+d73Xtf8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9M/CP9ccOIIj2LLFmE0GFDO0Ban2wsNalEXfM6+h+1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WrEMG49l1ye4MhXs5ZS9tz8P6h+hDvthIg/2wW9ne1Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ImNhbfeyfH8qIEeA5ic0s3dAQBdzzTBS+CPsNih9vZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dWP33YDSn04UKJN2ogh2Rui0iW/0q2y18OCDRVcfyoo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lYv0isAtfGh6H9tdp3cp2eHU7q2J+uk7QrgcxtK3w7Y=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VGMoamB/+7zTOYcY/pqJc96xlv2PdW4hwsIAEIslTDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yNeBWMF7BnD9wVwz2PgJsvWr77QiVvvWUvJF0+fqBug=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfpvObJ+tJBXSvqeN7vlOfmhYign635lciYAJIjUtY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dsen4NqjzVGjpjufiTMs3+gqeD09EbnuogPgxrJECwg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pxCWVM3sn19NsFEpgHbgLa+PmYlhN3mMiP0Wk8kJhYw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q11KNvJszjYIB9n9HcC+N4uz11a3eRj1L3BH9scKMDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A1PmkgcEToWh1JiVWE6mI5jUu7poxWWuCUt/cgRUUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qJo3Hu4PJeanL7XEaWXO/n3YsodhZyd+MJOOmB9Kpd8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BkBKLO8URFscfRY9Bav/1+L9mLohDgNr/MkZtGiraIs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rZq5WA3Hx3xthOyHAJXK//f8pE2qbz7YKu3TIMp9GFY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X07a/Lm80p5xd4RFs1dNmw+90tmPDPdGiAKVZkxd4zY=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "2FIZh/9N+NeJEQwxYIX5ikQT85xJzulBNReXk8PnG/s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I93Md7QNPGmEEGYU1+VVCqBPBEvXdqHPtTJtMOn06Yk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "GecBFQ1PemlECWZWCl7f74vmsL6eB6mzQ9n6tK6FYfs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QpjhZl+O1ORifgtCZuWAdcP6OKL7IZ2cA46v8FJcV28=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FWXI/yZ1M+2fIboeMCDMlp+I2NwPQDtoM/wWselOPYw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uk26nvN/LdRLaBphiBgIZzT0sSpoO1z0RdDWRm/xrSA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hiiYSH1KZovAULc7rlmEU74wCjzDR+mm6ZnsgvFQjMw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hRzvMvWPX0sJme+wck67lwbKDFaWOa+Eyef+JSdc1s4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PSx5D+zqC9c295dguX4+EobT4IEzfffdfjzC8DWpB5Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QzfXQCVTjPQv2h21v95HYPq8uCsVJ2tPnjv79gAaM9M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XcGDO/dlTcEMLqwcm55UmOqK+KpBmbzZO1LIzX7GPaQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Lf+o4E7YB5ynzUPC6KTyW0lj6Cg9oLIu1Sdd1ODHctA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wAuVn02LAVo5Y+TUocvkoenFYWzpu38k0NmGZOsAjS4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yJGDtveLbbo/0HtCtiTSsvVI/0agg/U1bFaQ0yhK12o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KsEy0zgYcmkM+O/fWF9z3aJGIk22XCk+Aw96HB6JU68=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "p+AnMI5ZxdJMSIEJmXXya+FeH5yubmOdViwUO89j0Rc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/jLix56jzeywBtNuGw55lCXyebQoSIhbful0hOKxKDY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fvDvSPomtJsl1S3+8/tzFCE8scHIdJY5hB9CdTEsoFo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "oV5hOJzPXxfTuRdKIlF4uYEoMDuqH+G7/3qgndDr0PM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "3ALwcvLj3VOfgD6OqXAO13h1ZkOv46R6+Oy6SUKh53I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gxaB9FJj0IM+InhvAjwWaex3UIZ9SAnDiUd5WHSY/l0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "66NPvDygJzKJqddfNuDuNOpvGajjFRtvhkwfUkiYmXw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1dWcQIocRAcO9XnXYqbhl83jc0RgjQpsrWd8dC27trg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "npos0Uf1DT3ztSCjPVY9EImlRnTHB1KLrvmVSqBQ/8E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "TEI9qBx/tK1l1H0v1scMG8Srmtwo5VxWHADPBSlWrXk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "3wUN2ypQKoj+5ASkeIK9ycxhahVxyTmGopigoUAlyYs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o/oksSnUS+nIq6ozWTbB5bJh+NoaPj8deAA23uxiWCk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KExYPruhA31e8xuSwvfUfDcyY/H2Va6taUd0k4yFgLc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/x+dNfxdd/lkx8Z8VZVfoYl7LPoaZ/iKEzZXBrAtIJc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DE4cmjFLPqZlmRomO0qQiruUBtzoCe8ZdNRcfNH92pU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "M6EKNcLPw/iojAChgYUSieaBYWcbsjKtB94SaHOr8vk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+qP49lDPeyhaduTvXJgtJEqHNEYANVu9Bg3Bxz7Td9w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ruMrC2VIS+VKbJwCFb3bfkaLTju9nE+yPONV9s0M0Vo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EbjDlSB5JKnDKff4d8hOmaOwJ7B9Q6NQFisLj+DPC+0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "C/yYOTB94edyqAbiQNu8/H7FoG3yRRjHDkMykz4+Mv0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CBxqrejG+qQQq2YTd6iP/06kiu2CxxzBFaZK3Ofb1CM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2ZOQ/fpho+AbDENWBZaln7wRoepIRdhyT648dr8O5cU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EghIgEPz01+myPgj8oid+PgncvobvC7vjvG3THEEQ0M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "92CysZYNF8riwAMhdrIPKxfODw9p07cKQy/Snn8XmVY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VO0LeTBQmsEf7sCHzTnZwUPNTqRZ49R8V5E9XnZ/5N4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "exs8BQMJq7U6ZXYgIizT7XN+X/hOmmn4YEuzev9zgSI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qHpS4k1I+gPniNp4CA8TY8lLN36vBYmgbKMFpbYMEqg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+7lWKCKAWFw6gPZdHE6E8KIfI14/fSvtWUmllb5WLi0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YiH/US0q6679hWblFDDKNqUjCgggoU8sUCssTIF1QbU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YgwkKElEubNfvXL9hJxzqQUQtHiXN/OCGxNL1MUZZlM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hZFST4INZTTuhvJlGJeMwlUAK270UCOTCDeBAnN4a7g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "24I1Zw35AuGnK3CqJhbCwYb0IPuu5sCRrM5iyeITOLc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vgD12JB4Q1S/kGPSQ1KOgp386KnG1GbM/5+60oRGcGw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+wNE+OL+CB9d4AUJdVxd56jUJCAXmmk9fapuB2TAc4g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uhQh1B2Pe4RkNw/kPEcgaLenuikKoRf1iyfZhpXdodc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "eu8gjAUIp8ybO204AgeOq5v1neI1yljqy5v3I6lo1lM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7QG6oVbASBAjrnCPxzzUNnuFSFNlKhbuBafkF8pr7Is=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PUS1xb2oHSDTdYltutoSSxBiJ1NjxH3l2kA4P1CZLEs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XPMh/JDC/O93gJJCwwgJDb8ssWZvRvezNmKmyn3nIfk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jWz+KGwMk/GOvFAK2rOxF3OjxeZAWfmUQ1HGJ7icw4A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o7XbW68pc6flYigf3LW4WAGUWxpeqxaQLkHUhUR9RZ8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "nqR+g60+5U0okbqJadSqGgnC+j1JcP8rwMcfzOs2ACI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Hz43qVK95tSfbYFtaE/8fE97XMk1RiO8XpWjwZHB80o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "noZUWlZ8M6KXU5rkifyo8/duw5IL7/fXbJvT7bNmW9k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WONVHCuPSanXDRQQ/3tmyJ0Vq+Lu/4hRaMUf0g0kSuw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UEaj6vQRoIghE8Movd8AGXhtwIOXlP4cBsECIUvE5Y8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "D3n2YcO8+PB4C8brDo7kxKjF9Y844rVkdRMLTgsQkrw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "C+YA0G9KjxZVaWwOMuh/dcnHnHAlYnbFrRl0IEpmsY0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rUnmbmQanxrbFPYYrwyQ53x66OSt27yAvF+s48ezKDc=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-Correctness.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-Correctness.json deleted file mode 100644 index edb336743c9..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-Correctness.json +++ /dev/null @@ -1,1160 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Find with $gt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$numberDouble": "0.0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$gte": { - "$numberDouble": "0.0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - }, - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$numberDouble": "1.0" - } - } - } - }, - "result": [] - } - ] - }, - { - "description": "Find with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$lt": { - "$numberDouble": "1.0" - } - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - ] - } - ] - }, - { - "description": "Find with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$lte": { - "$numberDouble": "1.0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - }, - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$numberDouble": "0.0" - }, - "$lt": { - "$numberDouble": "2.0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - ] - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$in": [ - { - "$numberDouble": "0.0" - } - ] - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoubleNoPrecision": { - "$gte": { - "$numberDouble": "0.0" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - }, - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$numberDouble": "1.0" - } - } - } - } - ] - }, - "result": [] - } - ] - }, - { - "description": "Aggregate with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoubleNoPrecision": { - "$lt": { - "$numberDouble": "1.0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoubleNoPrecision": { - "$lte": { - "$numberDouble": "1.0" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - }, - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$numberDouble": "0.0" - }, - "$lt": { - "$numberDouble": "2.0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - ] - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoubleNoPrecision": { - "$in": [ - { - "$numberDouble": "0.0" - } - ] - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0.0" - } - } - ] - } - ] - }, - { - "description": "Wrong type: Insert Int", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberInt": "0" - } - } - }, - "result": { - "errorContains": "cannot encrypt element" - } - } - ] - }, - { - "description": "Wrong type: Find Int", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$gte": { - "$numberInt": "0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": { - "errorContains": "field type is not supported" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-Delete.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-Delete.json deleted file mode 100644 index 4a9c1f27b5d..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-Delete.json +++ /dev/null @@ -1,732 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Double. Delete.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1" - } - } - } - }, - { - "name": "deleteOne", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$numberDouble": "0" - } - } - } - }, - "result": { - "deletedCount": 1 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "delete": "default", - "deletes": [ - { - "q": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "limit": 1 - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "delete" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "6YrBn2ofIw1b5ooakrLOwF41BWrps8OO0H9WH4/rtlE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "n+XAuFnP8Dov9TnhGFxNx0K/MnVM9WbJ7RouEu0ndO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yRXojuVdn5GQtD97qYlaCL6cOLmZ7Cvcb3wFjkLUIdM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DuIkdRPITRs55I4SZmgomAHCIsDQmXRhW8+MOznkzSk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SsBk+Et1lTbU+QRPx+xyJ/jMkmfG+QCvQEpip2YYrzA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "crCIzOd8KhHvvUlX7M1v9bhvU4pLdTc+X2SuqoKU5Ek=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YOWdCw4UrqnxkAaVjqmC4sKQDMVMHEpFGnlxpxdaU6E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "M3SShp81Ff8tQ632qKbv9MUcN6wjDaBReI0VXNu6Xh4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gzHlSPxpM0hT75kQvWFzGlOxKvDoiKQZOr19V6l2zXI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s3JnppOGYw9SL2Q1kMAZs948v2F5PrpXjGei/HioDWs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cG6+3Gk/zEH68P/uuuwiAUVCuyJwa1LeV+t29FlPPAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dupdvR3AyJtM+g9NDKiaLVOtGca387JQp8w+V03m7Ig=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JqEQc5svj2jTvZ6LLA5ivE+kTb/0aRemSEmxk4G7Zrg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "szcXXXKnob+p3SoM4yED2R920LeJ7cVsclPMFTe4CeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o1QoGVXmuBdHwHm7aCtGMlMVKrjFdYvJXpoq6uhIAZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Jfm5wPlqqLCJRGQIqRq2NGmpn7s0Vrih2H3YAOoI2YU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zMHLb8ARbsYo8Ld05bqnGFf1Usha6EGb8QKwdSAyps0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yQdtq9lh5pugL7/i0Bj/PuZUUBUIzf+7wj1rl5y736w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wGWVZdO7qIuyDg/BqDgqjgoQ02h5YYgwXQB1oCin2NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "by9HMLj6NTEpgztZ5HSN6GxImkXPcaFINYDzgZY33X8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tWo0vbasi7bXmn/MsOx13VC1IsWtpx/nYp0uj4iMzdA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tQQpndUYd5O87lOtrGjH3wl9VsOK0ray7RMasL90sBM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cQjXEDCMsOpKLLf+vlTgIHA+cbSJdzqhbSX9Wvh95aA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7yMpU48IxK9SzP2cx3VnTownGEwFmeFofuuFT97SuuY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kSOx1kz0CmBgzKQHZlo65ZUY1DIv9A99JRm+Us2y6Ew=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ubQpdPBe6/xvtr+AcXdfYLSvYCR4ot0tivehkCsupb4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xal+iCJ6FTefRQToyoNksc9NCZShyn04NDGi4IYrcoM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "d7jU4iOK50xHxlkSifcxlZFCM46TSgQzoYivxG3HNLY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJvl2nsBLBVzL3pp6sKWCL4UXeh3q/roYBJjSb74ve0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OIUCaKRvIx9t1w6Hxlz1IcQTdPNCfdRNwnnTm10W+X0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A9tvzsiElotOUVIB4CqfQp9mAwqvTM35YkmAR170aHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lI8gpK7hpb7c9x4RQugsxMnQay5LZJmwslZdvMx/dcE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dNCzh40U0XvdKnSDi3HRQOWQftEsDVqc4uUvsVFGoq8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IP+iwEBWBwVVZIdpaMu8k5+soFCz+TZkYn3drKZ9grE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnqyh6e0y5svHkJDShlN9CHV0WvMBE4QbtJpQw5ZCXc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "elEl42tbVDoRTLjAhZUFEtXiut4b3PVhg/1ZLZSQdtE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vHuu2FxwclMHqyE6JBYbTYgbEkB0dqb/JuaxsvfwsmY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xTf7NCe3Gf8QpE78HR5OknlLTKfs9J+RN9UZpH6fnso=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XiWSasRnJAulGR6+LCVD3mwRObXylqYWR9jvpywq12c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MZMxEQ5ikx0PG1YFIExv0UnTZogsvgeOEZTpzvBDn4w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yZMyMZBDrWbAhvnic7vvIYhmO9m5H2iuv0c8KNZrBzY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xxM14hTPY5j0vvcK2C7YAEjzdsfUTFHozHC0hEo1bxI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+01rqR1xVwkpGXcstbk1ItJqFVjH6Q8MGxEN3Cm9Y1A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xOpLV0Z2VTRJ3iWtnWZcsyjXubTIkYWo31cO+HV1o1k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BWUOLqgLBqc5NwxVlSV5H3KFQPXbCp7mdo+jF+8cJqY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fuQb1S6xZDGlrEbK+kI23aL53PP1PVNwqICnZNt9Yzg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfscnoibFttahLdPVC4Ee+47ewGFKpDSU7M6HX19bKE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rpSW2awybNVeKtat91VFxqbINoTfNhPfQAu+d73Xtf8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9M/CP9ccOIIj2LLFmE0GFDO0Ban2wsNalEXfM6+h+1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WrEMG49l1ye4MhXs5ZS9tz8P6h+hDvthIg/2wW9ne1Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ImNhbfeyfH8qIEeA5ic0s3dAQBdzzTBS+CPsNih9vZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dWP33YDSn04UKJN2ogh2Rui0iW/0q2y18OCDRVcfyoo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lYv0isAtfGh6H9tdp3cp2eHU7q2J+uk7QrgcxtK3w7Y=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VGMoamB/+7zTOYcY/pqJc96xlv2PdW4hwsIAEIslTDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yNeBWMF7BnD9wVwz2PgJsvWr77QiVvvWUvJF0+fqBug=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfpvObJ+tJBXSvqeN7vlOfmhYign635lciYAJIjUtY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dsen4NqjzVGjpjufiTMs3+gqeD09EbnuogPgxrJECwg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pxCWVM3sn19NsFEpgHbgLa+PmYlhN3mMiP0Wk8kJhYw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q11KNvJszjYIB9n9HcC+N4uz11a3eRj1L3BH9scKMDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A1PmkgcEToWh1JiVWE6mI5jUu7poxWWuCUt/cgRUUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qJo3Hu4PJeanL7XEaWXO/n3YsodhZyd+MJOOmB9Kpd8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BkBKLO8URFscfRY9Bav/1+L9mLohDgNr/MkZtGiraIs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rZq5WA3Hx3xthOyHAJXK//f8pE2qbz7YKu3TIMp9GFY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X07a/Lm80p5xd4RFs1dNmw+90tmPDPdGiAKVZkxd4zY=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-FindOneAndUpdate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-FindOneAndUpdate.json deleted file mode 100644 index d7860de83ec..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-FindOneAndUpdate.json +++ /dev/null @@ -1,1136 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Double. FindOneAndUpdate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1" - } - } - } - }, - { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$numberDouble": "0" - } - } - }, - "update": { - "$set": { - "encryptedDoubleNoPrecision": { - "$numberDouble": "2" - } - } - }, - "returnDocument": "Before" - }, - "result": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default", - "query": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "update": { - "$set": { - "encryptedDoubleNoPrecision": { - "$$type": "binData" - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "findAndModify" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "6YrBn2ofIw1b5ooakrLOwF41BWrps8OO0H9WH4/rtlE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "n+XAuFnP8Dov9TnhGFxNx0K/MnVM9WbJ7RouEu0ndO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yRXojuVdn5GQtD97qYlaCL6cOLmZ7Cvcb3wFjkLUIdM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DuIkdRPITRs55I4SZmgomAHCIsDQmXRhW8+MOznkzSk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SsBk+Et1lTbU+QRPx+xyJ/jMkmfG+QCvQEpip2YYrzA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "crCIzOd8KhHvvUlX7M1v9bhvU4pLdTc+X2SuqoKU5Ek=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YOWdCw4UrqnxkAaVjqmC4sKQDMVMHEpFGnlxpxdaU6E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "M3SShp81Ff8tQ632qKbv9MUcN6wjDaBReI0VXNu6Xh4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gzHlSPxpM0hT75kQvWFzGlOxKvDoiKQZOr19V6l2zXI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s3JnppOGYw9SL2Q1kMAZs948v2F5PrpXjGei/HioDWs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cG6+3Gk/zEH68P/uuuwiAUVCuyJwa1LeV+t29FlPPAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dupdvR3AyJtM+g9NDKiaLVOtGca387JQp8w+V03m7Ig=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JqEQc5svj2jTvZ6LLA5ivE+kTb/0aRemSEmxk4G7Zrg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "szcXXXKnob+p3SoM4yED2R920LeJ7cVsclPMFTe4CeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o1QoGVXmuBdHwHm7aCtGMlMVKrjFdYvJXpoq6uhIAZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Jfm5wPlqqLCJRGQIqRq2NGmpn7s0Vrih2H3YAOoI2YU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zMHLb8ARbsYo8Ld05bqnGFf1Usha6EGb8QKwdSAyps0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yQdtq9lh5pugL7/i0Bj/PuZUUBUIzf+7wj1rl5y736w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wGWVZdO7qIuyDg/BqDgqjgoQ02h5YYgwXQB1oCin2NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "by9HMLj6NTEpgztZ5HSN6GxImkXPcaFINYDzgZY33X8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tWo0vbasi7bXmn/MsOx13VC1IsWtpx/nYp0uj4iMzdA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tQQpndUYd5O87lOtrGjH3wl9VsOK0ray7RMasL90sBM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cQjXEDCMsOpKLLf+vlTgIHA+cbSJdzqhbSX9Wvh95aA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7yMpU48IxK9SzP2cx3VnTownGEwFmeFofuuFT97SuuY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kSOx1kz0CmBgzKQHZlo65ZUY1DIv9A99JRm+Us2y6Ew=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ubQpdPBe6/xvtr+AcXdfYLSvYCR4ot0tivehkCsupb4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xal+iCJ6FTefRQToyoNksc9NCZShyn04NDGi4IYrcoM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "d7jU4iOK50xHxlkSifcxlZFCM46TSgQzoYivxG3HNLY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJvl2nsBLBVzL3pp6sKWCL4UXeh3q/roYBJjSb74ve0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OIUCaKRvIx9t1w6Hxlz1IcQTdPNCfdRNwnnTm10W+X0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A9tvzsiElotOUVIB4CqfQp9mAwqvTM35YkmAR170aHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lI8gpK7hpb7c9x4RQugsxMnQay5LZJmwslZdvMx/dcE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dNCzh40U0XvdKnSDi3HRQOWQftEsDVqc4uUvsVFGoq8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IP+iwEBWBwVVZIdpaMu8k5+soFCz+TZkYn3drKZ9grE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnqyh6e0y5svHkJDShlN9CHV0WvMBE4QbtJpQw5ZCXc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "elEl42tbVDoRTLjAhZUFEtXiut4b3PVhg/1ZLZSQdtE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vHuu2FxwclMHqyE6JBYbTYgbEkB0dqb/JuaxsvfwsmY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xTf7NCe3Gf8QpE78HR5OknlLTKfs9J+RN9UZpH6fnso=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XiWSasRnJAulGR6+LCVD3mwRObXylqYWR9jvpywq12c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MZMxEQ5ikx0PG1YFIExv0UnTZogsvgeOEZTpzvBDn4w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yZMyMZBDrWbAhvnic7vvIYhmO9m5H2iuv0c8KNZrBzY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xxM14hTPY5j0vvcK2C7YAEjzdsfUTFHozHC0hEo1bxI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+01rqR1xVwkpGXcstbk1ItJqFVjH6Q8MGxEN3Cm9Y1A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xOpLV0Z2VTRJ3iWtnWZcsyjXubTIkYWo31cO+HV1o1k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BWUOLqgLBqc5NwxVlSV5H3KFQPXbCp7mdo+jF+8cJqY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fuQb1S6xZDGlrEbK+kI23aL53PP1PVNwqICnZNt9Yzg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfscnoibFttahLdPVC4Ee+47ewGFKpDSU7M6HX19bKE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rpSW2awybNVeKtat91VFxqbINoTfNhPfQAu+d73Xtf8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9M/CP9ccOIIj2LLFmE0GFDO0Ban2wsNalEXfM6+h+1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WrEMG49l1ye4MhXs5ZS9tz8P6h+hDvthIg/2wW9ne1Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ImNhbfeyfH8qIEeA5ic0s3dAQBdzzTBS+CPsNih9vZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dWP33YDSn04UKJN2ogh2Rui0iW/0q2y18OCDRVcfyoo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lYv0isAtfGh6H9tdp3cp2eHU7q2J+uk7QrgcxtK3w7Y=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VGMoamB/+7zTOYcY/pqJc96xlv2PdW4hwsIAEIslTDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yNeBWMF7BnD9wVwz2PgJsvWr77QiVvvWUvJF0+fqBug=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfpvObJ+tJBXSvqeN7vlOfmhYign635lciYAJIjUtY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dsen4NqjzVGjpjufiTMs3+gqeD09EbnuogPgxrJECwg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pxCWVM3sn19NsFEpgHbgLa+PmYlhN3mMiP0Wk8kJhYw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q11KNvJszjYIB9n9HcC+N4uz11a3eRj1L3BH9scKMDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A1PmkgcEToWh1JiVWE6mI5jUu7poxWWuCUt/cgRUUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qJo3Hu4PJeanL7XEaWXO/n3YsodhZyd+MJOOmB9Kpd8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BkBKLO8URFscfRY9Bav/1+L9mLohDgNr/MkZtGiraIs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rZq5WA3Hx3xthOyHAJXK//f8pE2qbz7YKu3TIMp9GFY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X07a/Lm80p5xd4RFs1dNmw+90tmPDPdGiAKVZkxd4zY=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "HI88j1zrIsFoijIXKybr9mYubNV5uVeODyLHFH4Ueco=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wXVD/HSbBljko0jJcaxJ1nrzs2+pchLQqYR3vywS8SU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KhscCh+tt/pp8lxtKZQSPPUU94RvJYPKG/sjtzIa4Ws=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RISnuNrTTVNW5HnwCgQJ301pFw8DOcYrAMQIwVwjOkI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Ra5zukLh2boua0Bh74qA+mtIoixGXlsNsxiJqHtqdTI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "eqr0v+NNWXWszi9ni8qH58Q6gw5x737tJvH3lPaNHO4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "d42QupriWIwGrFAquXNFi0ehEuidIbHLFZtg1Sm2nN8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2azRVxaaTIJKcgY2FU012gcyP8Y05cRDpfUaMnCBaQU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "3nlgkM4K/AAcHesRYYdEu24UGetHodVnVfHzw4yxZBM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hqy91FNmAAac2zUaPO6eWFkx0/37rOWGrwXN+fzL0tU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "akX+fmscSDSF9pB5MPj56iaJPtohr0hfXNk/OPWsGv8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1ZvUb10Q7cN4cNLktd5yNjqgtawsYnkbeVBZV6WuY/I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "otCwtuKiY4hCyXvYzXvo10OcnzZppebo38KsAlq49QM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Mty8EscckeT/dhMfrPFyDbLnmMOcYRUQ3mLK4KTu6V8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tnvgLLkJINO7csREYu4dEVe1ICrBeu7OP+HdfoX3M2E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kOefsHgEVhkJ17UuP7Dxogy6sAQbzf1SFPKCj6XRlrQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "F+JQ79xavpaHdJzdhvwyHbzdZJLNHAymc/+67La3gao=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NCZ9zp5rDRceENuSgAfTLEyKg0YgmXAhK0B8WSj7+Pw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wL1CJ7cYR5slx8mHq++uMdjDfkt9037lQTUztEMF56M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "txefkzTMITZE+XvvRFZ7QcgwDT/7m8jNmxRk4QBaoZI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jFunW3v1tSYMyZtQQD28eEy9qqDp4Kqo7gMN29N4bfQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QMO915KUiS3X3R1bU1YoafVM2s0NeHo3EjgTA9PnGwY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "nwdKJEXdilzvb7494vbuDJ+y6SrfJahza1dYIsHIWVI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vpWMX+T/VXXajFo0UbuYjtp0AEzBU0Y+lP+ih2EQ7mg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1lmzG0J1DhKDRhhq5y5Buygu4G8eV2X0t7kUY90EohM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SiKqpXqO0trwhFvBWK274hMklpCgMhNs/JY84yyn/NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7cPGPYCKPTay+ZR9Gx6oOueduOgaFrSuAXmNDpDHXdI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4THEYvAkjs2Fh7FIe5LC45P4i4N0L7ob67UOVbhp6Nk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "B+UGsChLLZR7iqnt8yq91OgmTgwiUKTJhFxY4NT0O6c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X1uYwBCsCg1H+PnKdwtBqXlt0zKEURi8bOM940GcPfk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xYOgT5l7shlNXCwHlguovmDkcEnF8dXyYlTyYrgZ8GE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vFMTZqV8bh1+gcKzTkXweMddJlgdUnwX0DWzUUaMok4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4HI0y9FrtleZxZ7M6INdNhLelrQ2Rv/+ykWCBl+tMC8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jpJ0bBE474OUkn1vUiLWumIBtYmwc7J5+LQU/nyeLQc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jQTPeXZvdxY/DjtPfYfKUArIDsf0E9MVFy2O26sv1ec=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QLLto0ExR2ZYMGqlyaMZc/hXFFTlwmgtKbiVq/xJIeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yBJNviU1nchbGbhx6InXCVRXa90sEepz1EwbYuKXu2U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jpEf0vHxrPu9gTJutNXSi2g/2Mc4WXFEN7yHonZEb7A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "E09kLFckMYwNuhggMxmPtwndyvIAx+Vl+b2CV6FP75s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "N+ue6/cLPb5NssmJCCeo18LlbKPz6r2z20AsnTKRvOo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yVQNZP8hhsvNGyDph2QP2qTNdXZTiIEVineKg+Qf33o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cSC9uI+9c5S8X+0G7amVyug1p0ZlgBsbEDYYyezBevQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1NpZGjoQzuQtekj80Rifxe9HbE08W07dfwxaFHaVn84=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "5Ghuq/8l11Ug9Uf/RTwf9On3OxOwIXUcb9soiy4J7/w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0LWKaEty6ywxLFhDaAqulqfMnYc+tgPfH4apyEeKg80=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OwSthmCBtt6NIAoAh7aCbj82Yr/+9t8U7WuBQhFT3AQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "iYiyg6/1isqbMdvFPIGucu3cNM4NAZNtJhHpGZ4eM+c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "waBgs8jWuGJPIF5zCRh6OmIyfK5GCBQgTMfmKSR2wyY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1Jdtbe2BKJXPU2G9ywOrlODZ/cNYEQlKzAW3aMe1Hy4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xaLEnNUS/2ySerBpb9dN/D31t+wYcKekwTfkwtni0Mc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "bIVBrOhOvr6cL55Tr24+B+CC9MiG7U6K54aAr2IXXuw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6Cdq5wroGu2TEFnekuT7LhOpd/K/+PcipIljcHU9QL4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "K5l64vI4S/pLviLW6Pl0U3iQkI3ge0xg4RAHcEsyKJo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "bzhuvZ0Ls22yIOX+Hz51eAHlSuDbWR/e0u4EhfdpHbc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Qv+fr6uD4o0bZRp69QJCFL6zvn3G82c7L+N1IFzj7H0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XAmISMbD3aEyQT+BQEphCKFNa0F0GDKFuhM9cGceKoQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4VLCokntMfm1AogpUnYGvhV7nllWSo3mS3hVESMy+hA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xiXNLj/CipEH63Vb5cidi8q9X47EF4f3HtJSOH7mfM8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4XlCYfYBjI9XA5zOSgTiEBYcZsdwyXL+f5XtH2xUIOc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "k6DfQy7ZYJIkEly2B5hjOZznL4NcgMkllZjJLb7yq7w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ZzM6gwWesa3lxbZVZthpPFs2s3GV0RZREE2zOMhBRBo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "US+jeMeeOd7J0wR0efJtq2/18lcO8YFvhT4O3DeaonQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "b6iSxiI1FM9SzxuG1bHqGA1i4+3GOi0/SPW00XB4L7o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kn3LsxAVkzIZKK9I6fi0Cctr0yjXOYgaQWMCoj4hLpM=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-InsertFind.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-InsertFind.json deleted file mode 100644 index 934af381f1e..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-InsertFind.json +++ /dev/null @@ -1,1123 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Double. Insert and Find.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$numberDouble": "0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "6YrBn2ofIw1b5ooakrLOwF41BWrps8OO0H9WH4/rtlE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "n+XAuFnP8Dov9TnhGFxNx0K/MnVM9WbJ7RouEu0ndO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yRXojuVdn5GQtD97qYlaCL6cOLmZ7Cvcb3wFjkLUIdM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DuIkdRPITRs55I4SZmgomAHCIsDQmXRhW8+MOznkzSk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SsBk+Et1lTbU+QRPx+xyJ/jMkmfG+QCvQEpip2YYrzA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "crCIzOd8KhHvvUlX7M1v9bhvU4pLdTc+X2SuqoKU5Ek=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YOWdCw4UrqnxkAaVjqmC4sKQDMVMHEpFGnlxpxdaU6E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "M3SShp81Ff8tQ632qKbv9MUcN6wjDaBReI0VXNu6Xh4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gzHlSPxpM0hT75kQvWFzGlOxKvDoiKQZOr19V6l2zXI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s3JnppOGYw9SL2Q1kMAZs948v2F5PrpXjGei/HioDWs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cG6+3Gk/zEH68P/uuuwiAUVCuyJwa1LeV+t29FlPPAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dupdvR3AyJtM+g9NDKiaLVOtGca387JQp8w+V03m7Ig=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JqEQc5svj2jTvZ6LLA5ivE+kTb/0aRemSEmxk4G7Zrg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "szcXXXKnob+p3SoM4yED2R920LeJ7cVsclPMFTe4CeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o1QoGVXmuBdHwHm7aCtGMlMVKrjFdYvJXpoq6uhIAZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Jfm5wPlqqLCJRGQIqRq2NGmpn7s0Vrih2H3YAOoI2YU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zMHLb8ARbsYo8Ld05bqnGFf1Usha6EGb8QKwdSAyps0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yQdtq9lh5pugL7/i0Bj/PuZUUBUIzf+7wj1rl5y736w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wGWVZdO7qIuyDg/BqDgqjgoQ02h5YYgwXQB1oCin2NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "by9HMLj6NTEpgztZ5HSN6GxImkXPcaFINYDzgZY33X8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tWo0vbasi7bXmn/MsOx13VC1IsWtpx/nYp0uj4iMzdA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tQQpndUYd5O87lOtrGjH3wl9VsOK0ray7RMasL90sBM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cQjXEDCMsOpKLLf+vlTgIHA+cbSJdzqhbSX9Wvh95aA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7yMpU48IxK9SzP2cx3VnTownGEwFmeFofuuFT97SuuY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kSOx1kz0CmBgzKQHZlo65ZUY1DIv9A99JRm+Us2y6Ew=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ubQpdPBe6/xvtr+AcXdfYLSvYCR4ot0tivehkCsupb4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xal+iCJ6FTefRQToyoNksc9NCZShyn04NDGi4IYrcoM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "d7jU4iOK50xHxlkSifcxlZFCM46TSgQzoYivxG3HNLY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJvl2nsBLBVzL3pp6sKWCL4UXeh3q/roYBJjSb74ve0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OIUCaKRvIx9t1w6Hxlz1IcQTdPNCfdRNwnnTm10W+X0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A9tvzsiElotOUVIB4CqfQp9mAwqvTM35YkmAR170aHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lI8gpK7hpb7c9x4RQugsxMnQay5LZJmwslZdvMx/dcE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dNCzh40U0XvdKnSDi3HRQOWQftEsDVqc4uUvsVFGoq8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IP+iwEBWBwVVZIdpaMu8k5+soFCz+TZkYn3drKZ9grE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnqyh6e0y5svHkJDShlN9CHV0WvMBE4QbtJpQw5ZCXc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "elEl42tbVDoRTLjAhZUFEtXiut4b3PVhg/1ZLZSQdtE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vHuu2FxwclMHqyE6JBYbTYgbEkB0dqb/JuaxsvfwsmY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xTf7NCe3Gf8QpE78HR5OknlLTKfs9J+RN9UZpH6fnso=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XiWSasRnJAulGR6+LCVD3mwRObXylqYWR9jvpywq12c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MZMxEQ5ikx0PG1YFIExv0UnTZogsvgeOEZTpzvBDn4w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yZMyMZBDrWbAhvnic7vvIYhmO9m5H2iuv0c8KNZrBzY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xxM14hTPY5j0vvcK2C7YAEjzdsfUTFHozHC0hEo1bxI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+01rqR1xVwkpGXcstbk1ItJqFVjH6Q8MGxEN3Cm9Y1A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xOpLV0Z2VTRJ3iWtnWZcsyjXubTIkYWo31cO+HV1o1k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BWUOLqgLBqc5NwxVlSV5H3KFQPXbCp7mdo+jF+8cJqY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fuQb1S6xZDGlrEbK+kI23aL53PP1PVNwqICnZNt9Yzg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfscnoibFttahLdPVC4Ee+47ewGFKpDSU7M6HX19bKE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rpSW2awybNVeKtat91VFxqbINoTfNhPfQAu+d73Xtf8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9M/CP9ccOIIj2LLFmE0GFDO0Ban2wsNalEXfM6+h+1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WrEMG49l1ye4MhXs5ZS9tz8P6h+hDvthIg/2wW9ne1Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ImNhbfeyfH8qIEeA5ic0s3dAQBdzzTBS+CPsNih9vZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dWP33YDSn04UKJN2ogh2Rui0iW/0q2y18OCDRVcfyoo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lYv0isAtfGh6H9tdp3cp2eHU7q2J+uk7QrgcxtK3w7Y=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VGMoamB/+7zTOYcY/pqJc96xlv2PdW4hwsIAEIslTDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yNeBWMF7BnD9wVwz2PgJsvWr77QiVvvWUvJF0+fqBug=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfpvObJ+tJBXSvqeN7vlOfmhYign635lciYAJIjUtY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dsen4NqjzVGjpjufiTMs3+gqeD09EbnuogPgxrJECwg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pxCWVM3sn19NsFEpgHbgLa+PmYlhN3mMiP0Wk8kJhYw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q11KNvJszjYIB9n9HcC+N4uz11a3eRj1L3BH9scKMDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A1PmkgcEToWh1JiVWE6mI5jUu7poxWWuCUt/cgRUUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qJo3Hu4PJeanL7XEaWXO/n3YsodhZyd+MJOOmB9Kpd8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BkBKLO8URFscfRY9Bav/1+L9mLohDgNr/MkZtGiraIs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rZq5WA3Hx3xthOyHAJXK//f8pE2qbz7YKu3TIMp9GFY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X07a/Lm80p5xd4RFs1dNmw+90tmPDPdGiAKVZkxd4zY=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "2FIZh/9N+NeJEQwxYIX5ikQT85xJzulBNReXk8PnG/s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I93Md7QNPGmEEGYU1+VVCqBPBEvXdqHPtTJtMOn06Yk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "GecBFQ1PemlECWZWCl7f74vmsL6eB6mzQ9n6tK6FYfs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QpjhZl+O1ORifgtCZuWAdcP6OKL7IZ2cA46v8FJcV28=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FWXI/yZ1M+2fIboeMCDMlp+I2NwPQDtoM/wWselOPYw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uk26nvN/LdRLaBphiBgIZzT0sSpoO1z0RdDWRm/xrSA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hiiYSH1KZovAULc7rlmEU74wCjzDR+mm6ZnsgvFQjMw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hRzvMvWPX0sJme+wck67lwbKDFaWOa+Eyef+JSdc1s4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PSx5D+zqC9c295dguX4+EobT4IEzfffdfjzC8DWpB5Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QzfXQCVTjPQv2h21v95HYPq8uCsVJ2tPnjv79gAaM9M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XcGDO/dlTcEMLqwcm55UmOqK+KpBmbzZO1LIzX7GPaQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Lf+o4E7YB5ynzUPC6KTyW0lj6Cg9oLIu1Sdd1ODHctA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wAuVn02LAVo5Y+TUocvkoenFYWzpu38k0NmGZOsAjS4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yJGDtveLbbo/0HtCtiTSsvVI/0agg/U1bFaQ0yhK12o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KsEy0zgYcmkM+O/fWF9z3aJGIk22XCk+Aw96HB6JU68=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "p+AnMI5ZxdJMSIEJmXXya+FeH5yubmOdViwUO89j0Rc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/jLix56jzeywBtNuGw55lCXyebQoSIhbful0hOKxKDY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fvDvSPomtJsl1S3+8/tzFCE8scHIdJY5hB9CdTEsoFo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "oV5hOJzPXxfTuRdKIlF4uYEoMDuqH+G7/3qgndDr0PM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "3ALwcvLj3VOfgD6OqXAO13h1ZkOv46R6+Oy6SUKh53I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gxaB9FJj0IM+InhvAjwWaex3UIZ9SAnDiUd5WHSY/l0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "66NPvDygJzKJqddfNuDuNOpvGajjFRtvhkwfUkiYmXw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1dWcQIocRAcO9XnXYqbhl83jc0RgjQpsrWd8dC27trg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "npos0Uf1DT3ztSCjPVY9EImlRnTHB1KLrvmVSqBQ/8E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "TEI9qBx/tK1l1H0v1scMG8Srmtwo5VxWHADPBSlWrXk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "3wUN2ypQKoj+5ASkeIK9ycxhahVxyTmGopigoUAlyYs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o/oksSnUS+nIq6ozWTbB5bJh+NoaPj8deAA23uxiWCk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KExYPruhA31e8xuSwvfUfDcyY/H2Va6taUd0k4yFgLc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "/x+dNfxdd/lkx8Z8VZVfoYl7LPoaZ/iKEzZXBrAtIJc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DE4cmjFLPqZlmRomO0qQiruUBtzoCe8ZdNRcfNH92pU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "M6EKNcLPw/iojAChgYUSieaBYWcbsjKtB94SaHOr8vk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+qP49lDPeyhaduTvXJgtJEqHNEYANVu9Bg3Bxz7Td9w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ruMrC2VIS+VKbJwCFb3bfkaLTju9nE+yPONV9s0M0Vo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EbjDlSB5JKnDKff4d8hOmaOwJ7B9Q6NQFisLj+DPC+0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "C/yYOTB94edyqAbiQNu8/H7FoG3yRRjHDkMykz4+Mv0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CBxqrejG+qQQq2YTd6iP/06kiu2CxxzBFaZK3Ofb1CM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2ZOQ/fpho+AbDENWBZaln7wRoepIRdhyT648dr8O5cU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "EghIgEPz01+myPgj8oid+PgncvobvC7vjvG3THEEQ0M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "92CysZYNF8riwAMhdrIPKxfODw9p07cKQy/Snn8XmVY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VO0LeTBQmsEf7sCHzTnZwUPNTqRZ49R8V5E9XnZ/5N4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "exs8BQMJq7U6ZXYgIizT7XN+X/hOmmn4YEuzev9zgSI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qHpS4k1I+gPniNp4CA8TY8lLN36vBYmgbKMFpbYMEqg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+7lWKCKAWFw6gPZdHE6E8KIfI14/fSvtWUmllb5WLi0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YiH/US0q6679hWblFDDKNqUjCgggoU8sUCssTIF1QbU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YgwkKElEubNfvXL9hJxzqQUQtHiXN/OCGxNL1MUZZlM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hZFST4INZTTuhvJlGJeMwlUAK270UCOTCDeBAnN4a7g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "24I1Zw35AuGnK3CqJhbCwYb0IPuu5sCRrM5iyeITOLc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vgD12JB4Q1S/kGPSQ1KOgp386KnG1GbM/5+60oRGcGw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+wNE+OL+CB9d4AUJdVxd56jUJCAXmmk9fapuB2TAc4g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uhQh1B2Pe4RkNw/kPEcgaLenuikKoRf1iyfZhpXdodc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "eu8gjAUIp8ybO204AgeOq5v1neI1yljqy5v3I6lo1lM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7QG6oVbASBAjrnCPxzzUNnuFSFNlKhbuBafkF8pr7Is=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "PUS1xb2oHSDTdYltutoSSxBiJ1NjxH3l2kA4P1CZLEs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XPMh/JDC/O93gJJCwwgJDb8ssWZvRvezNmKmyn3nIfk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jWz+KGwMk/GOvFAK2rOxF3OjxeZAWfmUQ1HGJ7icw4A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o7XbW68pc6flYigf3LW4WAGUWxpeqxaQLkHUhUR9RZ8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "nqR+g60+5U0okbqJadSqGgnC+j1JcP8rwMcfzOs2ACI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Hz43qVK95tSfbYFtaE/8fE97XMk1RiO8XpWjwZHB80o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "noZUWlZ8M6KXU5rkifyo8/duw5IL7/fXbJvT7bNmW9k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WONVHCuPSanXDRQQ/3tmyJ0Vq+Lu/4hRaMUf0g0kSuw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UEaj6vQRoIghE8Movd8AGXhtwIOXlP4cBsECIUvE5Y8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "D3n2YcO8+PB4C8brDo7kxKjF9Y844rVkdRMLTgsQkrw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "C+YA0G9KjxZVaWwOMuh/dcnHnHAlYnbFrRl0IEpmsY0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rUnmbmQanxrbFPYYrwyQ53x66OSt27yAvF+s48ezKDc=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-Update.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-Update.json deleted file mode 100644 index ec95e0334a1..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Double-Update.json +++ /dev/null @@ -1,1140 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Double. Update.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$numberDouble": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$numberDouble": "1" - } - } - } - }, - { - "name": "updateOne", - "arguments": { - "filter": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$numberDouble": "0" - } - } - }, - "update": { - "$set": { - "encryptedDoubleNoPrecision": { - "$numberDouble": "2" - } - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command_name": "update", - "command": { - "update": "default", - "ordered": true, - "updates": [ - { - "q": { - "encryptedDoubleNoPrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "u": { - "$set": { - "encryptedDoubleNoPrecision": { - "$$type": "binData" - } - } - } - } - ], - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoubleNoPrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - } - } - } - ] - } - } - }, - "$db": "default" - } - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "6YrBn2ofIw1b5ooakrLOwF41BWrps8OO0H9WH4/rtlE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "n+XAuFnP8Dov9TnhGFxNx0K/MnVM9WbJ7RouEu0ndO0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yRXojuVdn5GQtD97qYlaCL6cOLmZ7Cvcb3wFjkLUIdM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DuIkdRPITRs55I4SZmgomAHCIsDQmXRhW8+MOznkzSk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SsBk+Et1lTbU+QRPx+xyJ/jMkmfG+QCvQEpip2YYrzA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "crCIzOd8KhHvvUlX7M1v9bhvU4pLdTc+X2SuqoKU5Ek=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "YOWdCw4UrqnxkAaVjqmC4sKQDMVMHEpFGnlxpxdaU6E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "M3SShp81Ff8tQ632qKbv9MUcN6wjDaBReI0VXNu6Xh4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gzHlSPxpM0hT75kQvWFzGlOxKvDoiKQZOr19V6l2zXI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "s3JnppOGYw9SL2Q1kMAZs948v2F5PrpXjGei/HioDWs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cG6+3Gk/zEH68P/uuuwiAUVCuyJwa1LeV+t29FlPPAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dupdvR3AyJtM+g9NDKiaLVOtGca387JQp8w+V03m7Ig=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JqEQc5svj2jTvZ6LLA5ivE+kTb/0aRemSEmxk4G7Zrg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "szcXXXKnob+p3SoM4yED2R920LeJ7cVsclPMFTe4CeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "o1QoGVXmuBdHwHm7aCtGMlMVKrjFdYvJXpoq6uhIAZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Jfm5wPlqqLCJRGQIqRq2NGmpn7s0Vrih2H3YAOoI2YU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zMHLb8ARbsYo8Ld05bqnGFf1Usha6EGb8QKwdSAyps0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yQdtq9lh5pugL7/i0Bj/PuZUUBUIzf+7wj1rl5y736w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wGWVZdO7qIuyDg/BqDgqjgoQ02h5YYgwXQB1oCin2NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "by9HMLj6NTEpgztZ5HSN6GxImkXPcaFINYDzgZY33X8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tWo0vbasi7bXmn/MsOx13VC1IsWtpx/nYp0uj4iMzdA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tQQpndUYd5O87lOtrGjH3wl9VsOK0ray7RMasL90sBM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cQjXEDCMsOpKLLf+vlTgIHA+cbSJdzqhbSX9Wvh95aA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7yMpU48IxK9SzP2cx3VnTownGEwFmeFofuuFT97SuuY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kSOx1kz0CmBgzKQHZlo65ZUY1DIv9A99JRm+Us2y6Ew=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ubQpdPBe6/xvtr+AcXdfYLSvYCR4ot0tivehkCsupb4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xal+iCJ6FTefRQToyoNksc9NCZShyn04NDGi4IYrcoM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "d7jU4iOK50xHxlkSifcxlZFCM46TSgQzoYivxG3HNLY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tJvl2nsBLBVzL3pp6sKWCL4UXeh3q/roYBJjSb74ve0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OIUCaKRvIx9t1w6Hxlz1IcQTdPNCfdRNwnnTm10W+X0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A9tvzsiElotOUVIB4CqfQp9mAwqvTM35YkmAR170aHA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lI8gpK7hpb7c9x4RQugsxMnQay5LZJmwslZdvMx/dcE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dNCzh40U0XvdKnSDi3HRQOWQftEsDVqc4uUvsVFGoq8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "IP+iwEBWBwVVZIdpaMu8k5+soFCz+TZkYn3drKZ9grE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pnqyh6e0y5svHkJDShlN9CHV0WvMBE4QbtJpQw5ZCXc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "elEl42tbVDoRTLjAhZUFEtXiut4b3PVhg/1ZLZSQdtE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vHuu2FxwclMHqyE6JBYbTYgbEkB0dqb/JuaxsvfwsmY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xTf7NCe3Gf8QpE78HR5OknlLTKfs9J+RN9UZpH6fnso=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XiWSasRnJAulGR6+LCVD3mwRObXylqYWR9jvpywq12c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MZMxEQ5ikx0PG1YFIExv0UnTZogsvgeOEZTpzvBDn4w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yZMyMZBDrWbAhvnic7vvIYhmO9m5H2iuv0c8KNZrBzY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xxM14hTPY5j0vvcK2C7YAEjzdsfUTFHozHC0hEo1bxI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+01rqR1xVwkpGXcstbk1ItJqFVjH6Q8MGxEN3Cm9Y1A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xOpLV0Z2VTRJ3iWtnWZcsyjXubTIkYWo31cO+HV1o1k=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BWUOLqgLBqc5NwxVlSV5H3KFQPXbCp7mdo+jF+8cJqY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "fuQb1S6xZDGlrEbK+kI23aL53PP1PVNwqICnZNt9Yzg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfscnoibFttahLdPVC4Ee+47ewGFKpDSU7M6HX19bKE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rpSW2awybNVeKtat91VFxqbINoTfNhPfQAu+d73Xtf8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "9M/CP9ccOIIj2LLFmE0GFDO0Ban2wsNalEXfM6+h+1s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WrEMG49l1ye4MhXs5ZS9tz8P6h+hDvthIg/2wW9ne1Q=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ImNhbfeyfH8qIEeA5ic0s3dAQBdzzTBS+CPsNih9vZ0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dWP33YDSn04UKJN2ogh2Rui0iW/0q2y18OCDRVcfyoo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "lYv0isAtfGh6H9tdp3cp2eHU7q2J+uk7QrgcxtK3w7Y=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "VGMoamB/+7zTOYcY/pqJc96xlv2PdW4hwsIAEIslTDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yNeBWMF7BnD9wVwz2PgJsvWr77QiVvvWUvJF0+fqBug=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SfpvObJ+tJBXSvqeN7vlOfmhYign635lciYAJIjUtY8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dsen4NqjzVGjpjufiTMs3+gqeD09EbnuogPgxrJECwg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "pxCWVM3sn19NsFEpgHbgLa+PmYlhN3mMiP0Wk8kJhYw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q11KNvJszjYIB9n9HcC+N4uz11a3eRj1L3BH9scKMDQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "A1PmkgcEToWh1JiVWE6mI5jUu7poxWWuCUt/cgRUUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "qJo3Hu4PJeanL7XEaWXO/n3YsodhZyd+MJOOmB9Kpd8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "BkBKLO8URFscfRY9Bav/1+L9mLohDgNr/MkZtGiraIs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "rZq5WA3Hx3xthOyHAJXK//f8pE2qbz7YKu3TIMp9GFY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X07a/Lm80p5xd4RFs1dNmw+90tmPDPdGiAKVZkxd4zY=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDoubleNoPrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "HI88j1zrIsFoijIXKybr9mYubNV5uVeODyLHFH4Ueco=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wXVD/HSbBljko0jJcaxJ1nrzs2+pchLQqYR3vywS8SU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "KhscCh+tt/pp8lxtKZQSPPUU94RvJYPKG/sjtzIa4Ws=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RISnuNrTTVNW5HnwCgQJ301pFw8DOcYrAMQIwVwjOkI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Ra5zukLh2boua0Bh74qA+mtIoixGXlsNsxiJqHtqdTI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "eqr0v+NNWXWszi9ni8qH58Q6gw5x737tJvH3lPaNHO4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "d42QupriWIwGrFAquXNFi0ehEuidIbHLFZtg1Sm2nN8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "2azRVxaaTIJKcgY2FU012gcyP8Y05cRDpfUaMnCBaQU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "3nlgkM4K/AAcHesRYYdEu24UGetHodVnVfHzw4yxZBM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "hqy91FNmAAac2zUaPO6eWFkx0/37rOWGrwXN+fzL0tU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "akX+fmscSDSF9pB5MPj56iaJPtohr0hfXNk/OPWsGv8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1ZvUb10Q7cN4cNLktd5yNjqgtawsYnkbeVBZV6WuY/I=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "otCwtuKiY4hCyXvYzXvo10OcnzZppebo38KsAlq49QM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Mty8EscckeT/dhMfrPFyDbLnmMOcYRUQ3mLK4KTu6V8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "tnvgLLkJINO7csREYu4dEVe1ICrBeu7OP+HdfoX3M2E=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kOefsHgEVhkJ17UuP7Dxogy6sAQbzf1SFPKCj6XRlrQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "F+JQ79xavpaHdJzdhvwyHbzdZJLNHAymc/+67La3gao=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "NCZ9zp5rDRceENuSgAfTLEyKg0YgmXAhK0B8WSj7+Pw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wL1CJ7cYR5slx8mHq++uMdjDfkt9037lQTUztEMF56M=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "txefkzTMITZE+XvvRFZ7QcgwDT/7m8jNmxRk4QBaoZI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jFunW3v1tSYMyZtQQD28eEy9qqDp4Kqo7gMN29N4bfQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QMO915KUiS3X3R1bU1YoafVM2s0NeHo3EjgTA9PnGwY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "nwdKJEXdilzvb7494vbuDJ+y6SrfJahza1dYIsHIWVI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vpWMX+T/VXXajFo0UbuYjtp0AEzBU0Y+lP+ih2EQ7mg=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1lmzG0J1DhKDRhhq5y5Buygu4G8eV2X0t7kUY90EohM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SiKqpXqO0trwhFvBWK274hMklpCgMhNs/JY84yyn/NE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7cPGPYCKPTay+ZR9Gx6oOueduOgaFrSuAXmNDpDHXdI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4THEYvAkjs2Fh7FIe5LC45P4i4N0L7ob67UOVbhp6Nk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "B+UGsChLLZR7iqnt8yq91OgmTgwiUKTJhFxY4NT0O6c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X1uYwBCsCg1H+PnKdwtBqXlt0zKEURi8bOM940GcPfk=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xYOgT5l7shlNXCwHlguovmDkcEnF8dXyYlTyYrgZ8GE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "vFMTZqV8bh1+gcKzTkXweMddJlgdUnwX0DWzUUaMok4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4HI0y9FrtleZxZ7M6INdNhLelrQ2Rv/+ykWCBl+tMC8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jpJ0bBE474OUkn1vUiLWumIBtYmwc7J5+LQU/nyeLQc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jQTPeXZvdxY/DjtPfYfKUArIDsf0E9MVFy2O26sv1ec=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "QLLto0ExR2ZYMGqlyaMZc/hXFFTlwmgtKbiVq/xJIeI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yBJNviU1nchbGbhx6InXCVRXa90sEepz1EwbYuKXu2U=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jpEf0vHxrPu9gTJutNXSi2g/2Mc4WXFEN7yHonZEb7A=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "E09kLFckMYwNuhggMxmPtwndyvIAx+Vl+b2CV6FP75s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "N+ue6/cLPb5NssmJCCeo18LlbKPz6r2z20AsnTKRvOo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "yVQNZP8hhsvNGyDph2QP2qTNdXZTiIEVineKg+Qf33o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cSC9uI+9c5S8X+0G7amVyug1p0ZlgBsbEDYYyezBevQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1NpZGjoQzuQtekj80Rifxe9HbE08W07dfwxaFHaVn84=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "5Ghuq/8l11Ug9Uf/RTwf9On3OxOwIXUcb9soiy4J7/w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0LWKaEty6ywxLFhDaAqulqfMnYc+tgPfH4apyEeKg80=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "OwSthmCBtt6NIAoAh7aCbj82Yr/+9t8U7WuBQhFT3AQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "iYiyg6/1isqbMdvFPIGucu3cNM4NAZNtJhHpGZ4eM+c=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "waBgs8jWuGJPIF5zCRh6OmIyfK5GCBQgTMfmKSR2wyY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "1Jdtbe2BKJXPU2G9ywOrlODZ/cNYEQlKzAW3aMe1Hy4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xaLEnNUS/2ySerBpb9dN/D31t+wYcKekwTfkwtni0Mc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "bIVBrOhOvr6cL55Tr24+B+CC9MiG7U6K54aAr2IXXuw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6Cdq5wroGu2TEFnekuT7LhOpd/K/+PcipIljcHU9QL4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "K5l64vI4S/pLviLW6Pl0U3iQkI3ge0xg4RAHcEsyKJo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "bzhuvZ0Ls22yIOX+Hz51eAHlSuDbWR/e0u4EhfdpHbc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Qv+fr6uD4o0bZRp69QJCFL6zvn3G82c7L+N1IFzj7H0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "XAmISMbD3aEyQT+BQEphCKFNa0F0GDKFuhM9cGceKoQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4VLCokntMfm1AogpUnYGvhV7nllWSo3mS3hVESMy+hA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "xiXNLj/CipEH63Vb5cidi8q9X47EF4f3HtJSOH7mfM8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "4XlCYfYBjI9XA5zOSgTiEBYcZsdwyXL+f5XtH2xUIOc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "k6DfQy7ZYJIkEly2B5hjOZznL4NcgMkllZjJLb7yq7w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ZzM6gwWesa3lxbZVZthpPFs2s3GV0RZREE2zOMhBRBo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "US+jeMeeOd7J0wR0efJtq2/18lcO8YFvhT4O3DeaonQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "b6iSxiI1FM9SzxuG1bHqGA1i4+3GOi0/SPW00XB4L7o=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kn3LsxAVkzIZKK9I6fi0Cctr0yjXOYgaQWMCoj4hLpM=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-Aggregate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-Aggregate.json deleted file mode 100644 index e8a50ebeca9..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-Aggregate.json +++ /dev/null @@ -1,580 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range DoublePrecision. Aggregate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$gt": { - "$numberDouble": "0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDoublePrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "default", - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - } - } - ], - "cursor": {}, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "aggregate" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "Dri0CXmL78L2DOgk9w0DwxHOMGMzih7m6l59vgy+WWo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "b7d8mRzD1kI1tdc7uNL+YAUonJ6pODLsRLkArfEKSkM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Xg8C1/A0KJaXOw4i+26Rv03/CydaaunOzXh0CIT+gn8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UoKUDw2wJYToUCcFaIs03YQSTksYR0MIOTJllwODqKc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "c/5cwAT0C5jber2xlJnWD3a5tVDy0nRtr5HG02hoFOY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wSUrRXavAGaajNeqC5mEUH1K67oYl5Wy9RNIzKjwLAM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6vrp4wWDtHEgHWR99I70WVDzevg1Fk/Pw5U8gUDa0OU=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDoublePrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "mVZb+Ra0EYjQ4Zrh9X//E2T8MRj7NMqm5GUJXhRrBEI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FA74j21GUEJb1DJBOpR9nVnjaDZnd8yAQNuaW9Qi26g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kJv//KVkbrobIBf+QeWC5jxn20mx/P0R1N6aCSMgKM8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zB+Whi9IUUGxfLEe+lGuIzLX4LFbIhaIAm5lRk65QTc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ybO1QU3CgvhO8JgRXH+HxKszWcpl5aGDYYVa75fHa1g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X3Y3eSAbbMg//JgiHHiFpYOpV61t8kkDexI+CQyitH4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SlNHXyqVFGDPrX/2ppwog6l4pwj3PKda2TkZbqgfSfA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "McjV8xwTF3xI7863DYOBdyvIv6UpzThl6v9vBRk05bI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MgwakFvPyBlwqFTbhWUF79URJQWFoJTGotlEVSPPUsQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DyBERpMSD5lEM5Nhpcn4WGgxgn/mkUVJp+PYSLX5jsE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I43iazc0xj1WVbYB/V+uTL/tughN1bBlxh1iypBnNsA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wjOBa/ATMuOywFmuPgC0GF/oeLqu0Z7eK5udzkTPbis=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gRQVwiR+m+0Vg8ZDXqrQQcVnTyobwCXNaA4BCJVXtMc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WUZ6huwx0ZbLb0R00uiC9FOJzsUocUN8qE5+YRenkvQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7s79aKEuPgQcS/YPOOVcYNZvHIo7FFsWtFCrnDKXefA=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-Correctness.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-Correctness.json deleted file mode 100644 index 87d0e3dd8c1..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-Correctness.json +++ /dev/null @@ -1,1650 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Find with $gt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$gt": { - "$numberDouble": "0.0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$gte": { - "$numberDouble": "0.0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - }, - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$gt": { - "$numberDouble": "1.0" - } - } - } - }, - "result": [] - } - ] - }, - { - "description": "Find with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$lt": { - "$numberDouble": "1.0" - } - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - ] - } - ] - }, - { - "description": "Find with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$lte": { - "$numberDouble": "1.0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - }, - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $lt below min", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$lt": { - "$numberDouble": "0.0" - } - } - } - }, - "result": { - "errorContains": "must be greater than the range minimum" - } - } - ] - }, - { - "description": "Find with $gt above max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$gt": { - "$numberDouble": "200.0" - } - } - } - }, - "result": { - "errorContains": "must be less than the range max" - } - } - ] - }, - { - "description": "Find with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$gt": { - "$numberDouble": "0.0" - }, - "$lt": { - "$numberDouble": "2.0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - ] - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with full range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$gte": { - "$numberDouble": "0.0" - }, - "$lte": { - "$numberDouble": "200.0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - }, - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Find with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$in": [ - { - "$numberDouble": "0.0" - } - ] - } - } - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - ] - } - ] - }, - { - "description": "Insert out of range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "-1" - } - } - }, - "result": { - "errorContains": "value must be greater than or equal to the minimum value" - } - } - ] - }, - { - "description": "Insert min and max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 200, - "encryptedDoublePrecision": { - "$numberDouble": "200.0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - }, - { - "_id": 200, - "encryptedDoublePrecision": { - "$numberDouble": "200.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$gte": { - "$numberDouble": "0.0" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - }, - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$gt": { - "$numberDouble": "1.0" - } - } - } - } - ] - }, - "result": [] - } - ] - }, - { - "description": "Aggregate with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$lt": { - "$numberDouble": "1.0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$lte": { - "$numberDouble": "1.0" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - }, - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $lt below min", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$lt": { - "$numberDouble": "0.0" - } - } - } - } - ] - }, - "result": { - "errorContains": "must be greater than the range minimum" - } - } - ] - }, - { - "description": "Aggregate with $gt above max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$gt": { - "$numberDouble": "200.0" - } - } - } - } - ] - }, - "result": { - "errorContains": "must be less than the range max" - } - } - ] - }, - { - "description": "Aggregate with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$gt": { - "$numberDouble": "0.0" - }, - "$lt": { - "$numberDouble": "2.0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - ] - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with full range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$gte": { - "$numberDouble": "0.0" - }, - "$lte": { - "$numberDouble": "200.0" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - }, - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1.0" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedDoublePrecision": { - "$in": [ - { - "$numberDouble": "0.0" - } - ] - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0.0" - } - } - ] - } - ] - }, - { - "description": "Wrong type: Insert Int", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberInt": "0" - } - } - }, - "result": { - "errorContains": "cannot encrypt element" - } - } - ] - }, - { - "description": "Wrong type: Find Int", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$gte": { - "$numberInt": "0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": { - "errorContains": "field type is not supported" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-Delete.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-Delete.json deleted file mode 100644 index 8a0fecf786c..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-Delete.json +++ /dev/null @@ -1,474 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range DoublePrecision. Delete.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1" - } - } - } - }, - { - "name": "deleteOne", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$gt": { - "$numberDouble": "0" - } - } - } - }, - "result": { - "deletedCount": 1 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDoublePrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "delete": "default", - "deletes": [ - { - "q": { - "encryptedDoublePrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "limit": 1 - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "delete" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "Dri0CXmL78L2DOgk9w0DwxHOMGMzih7m6l59vgy+WWo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "b7d8mRzD1kI1tdc7uNL+YAUonJ6pODLsRLkArfEKSkM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Xg8C1/A0KJaXOw4i+26Rv03/CydaaunOzXh0CIT+gn8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UoKUDw2wJYToUCcFaIs03YQSTksYR0MIOTJllwODqKc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "c/5cwAT0C5jber2xlJnWD3a5tVDy0nRtr5HG02hoFOY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wSUrRXavAGaajNeqC5mEUH1K67oYl5Wy9RNIzKjwLAM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6vrp4wWDtHEgHWR99I70WVDzevg1Fk/Pw5U8gUDa0OU=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-FindOneAndUpdate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-FindOneAndUpdate.json deleted file mode 100644 index ac77931d610..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-FindOneAndUpdate.json +++ /dev/null @@ -1,584 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range DoublePrecision. FindOneAndUpdate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1" - } - } - } - }, - { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$gt": { - "$numberDouble": "0" - } - } - }, - "update": { - "$set": { - "encryptedDoublePrecision": { - "$numberDouble": "2" - } - } - }, - "returnDocument": "Before" - }, - "result": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDoublePrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default", - "query": { - "encryptedDoublePrecision": { - "$gt": { - "$binary": { - "base64": "DQYKAAADcGF5bG9hZACiCQAABGcAjgkAAAMwAH0AAAAFZAAgAAAAAHdJ2Vnb4MMzqVYVssjSdDy8XU4GVzMTfGifGETgQ2mYBXMAIAAAAAD7cFfKJGIXo6PjyeX2ria02CckW7dWFDoY/3FyBdm1NQVsACAAAAAAhEPSNv4M023A3hzNFuy83+hIKuZ2mKRY954N++aEOBUAAzEAfQAAAAVkACAAAAAAlmvfDrZoydUet4eCVMq7z6a58Ea+1HLJOWxN5lNcrWEFcwAgAAAAAEBo5AWZyC41b9ayjWNQSL4iYEAIwR/JG+ssN8bdoK9RBWwAIAAAAACEndE0SLxFSElOrNnqeX0EPmgDio3udZjVREy4JLS3sQADMgB9AAAABWQAIAAAAABbiLaoxAA6rinMJw1hC8ZUiq6UU1AQaPFn/py/Y06WuQVzACAAAAAAhtDasFkvYE7SCNu1je/hxdE9TJtAvvH3NtdEbKzNbCUFbAAgAAAAAIGepU1RSCF8sWODHEpKglsoqw3VBBH4a/URGxgGzbq2AAMzAH0AAAAFZAAgAAAAALORWwSr+tYNxcil2KIGSbNhTHvcPbdj+rLVQNx21S/KBXMAIAAAAAD6diZBkPEJ1cQy06LAxdbNK8Nlxbb44fH4Wk3Y3260nQVsACAAAAAA1eYAZBFHlDiaDAljWi8blGQ2nvvZa5AO5doeo0SFZsgAAzQAfQAAAAVkACAAAAAAG5XMK96PjClNlUvg82j4pMY1YxsznZfj4uNweD394FoFcwAgAAAAAKHgQLdGJHkrfFg9nB93Ac+3VgBw6aU44MTkKIQ91dZoBWwAIAAAAAAPxXmi+SDJ+40A0KdwfRczexlZQrHjIA+D3oUB0EY9tAADNQB9AAAABWQAIAAAAAA6M++b9I0YFemmWBAWAE3glu2Ah3Ta1FBxAQEIWS0toAVzACAAAAAANXYTqPf1Y6X3Ns6YQIX0C3FKCyWUo+Kk+fNcQvc0WSoFbAAgAAAAAA+uJUw1ICYgyeygSRe206VTWVtUnhdci3iHbyP5YtEVAAM2AH0AAAAFZAAgAAAAAKl8bV1riH/uyJ+X0HHd3+18k2cJl2dQFXCdoagutFcaBXMAIAAAAABm8F2Ew9f0VOABdcF+lP0Bi+zWvEUPniWgrxPq/Sx3uwVsACAAAAAAJfFErjZ6BPhsw5LjJLqNtKDLJ4zV0eIZppQpd9b0wZoAAzcAfQAAAAVkACAAAAAAsYZD8JEP6kYsPncFnNZwJxhu4YtUTKPNcjHtv67H+rYFcwAgAAAAAI4LqZcRkvbs/2F62Flu0pixNcor4WmBD0DHGaf039wLBWwAIAAAAAD4wUR3xd9lKltcqqo8LYvdMQWzCRobkV/ppKB/yn5dUgADOAB9AAAABWQAIAAAAAC0vdAi+dmoIXvZ5LqUqvyKV9/tHqSI2SWiSJO5pTnA2wVzACAAAAAAS2qvf9fvfVUH5WtsVxjxmskpGjYTQV34LwvQQw1y9wIFbAAgAAAAAE0+FKuK7HxbypvCeEJzMTcjOWE0ScYOlTBMUNlIv55hAAM5AH0AAAAFZAAgAAAAAH31lb/srBcrOXkzddCwAnclsR5/3QijEVgECs2JjOWBBXMAIAAAAABg7+prDT73YcCvLE5QbuIrqGcjLc5pQD2Miq0d29yrxgVsACAAAAAAetRiPwDSFWBzpWSWkOKWM6fKStRJ8SyObnpc79ux8p0AAzEwAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzExAH0AAAAFZAAgAAAAAFdthRhe2Q8CvxGIhjTJZv0Lk97GkHciTPxZ/mckLoNaBXMAIAAAAAAqOxsAr23LOVB0DIHbPf9UDJJRFXY2YoKbjhRqw5psbQVsACAAAAAA0G2GD8ZQjDBntjLpW4rqwKRS6HiUjL03g1N6chANozcAAzEyAH0AAAAFZAAgAAAAAMWymwwbvIeMqmnKWWifUqoCxOsdpnonM2qdLPyjqJO/BXMAIAAAAAB6IDmmpUhBD2zpRj8/y/kmOSXcjuIU14sNh6GKSsg2uwVsACAAAAAAWMFPNOk3EMSQDS9JGPSMIQP0oNGVugxXKKUrIPPlhHgAAzEzAH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzE0AH0AAAAFZAAgAAAAAJaRYmo8zqI2BEUzdSwp4tVRpPmVWsfydkYN3UHh6TMuBXMAIAAAAAAeD6mDnQeLlbC9i0sVgE8+RH6y+e94OJQ0tJ0PvblVSgVsACAAAAAAWp4jvretbDEsqEMzP/WLTnwOiJwCtfrCiB6m8k+yEMoAAzE1AH0AAAAFZAAgAAAAAAZZ538coNPwyRjhEwr5P8Xw32oWOJF+R+nfCGgy2qO3BXMAIAAAAACOPLnJlKwGNPDBReRKnHfteq0wFb3ezhrc7BVXs8RUHwVsACAAAAAA+lGesNk3+SyB/60rSvdQ2aN2vfJPR7llJVhufGTNhHkAAzE2AH0AAAAFZAAgAAAAAFH9l9GGA1I52atJV5jNUf1lx8jBjoEoVoME97v5GFJiBXMAIAAAAAC1qH3Kd78Dr9NGbw7y9D/XYBwv5h1LLO8la5OU7g8UkQVsACAAAAAArZ6atJCYrVfHB8dSNPOFf6nnDADBMJcIEj8ljPvxHp8AAzE3AH0AAAAFZAAgAAAAADtbVEI2tdkrowEMdkacD2w0Y3T3Ofi7PH6HmA6sP0c/BXMAIAAAAADuBSROnZHA+NgUPH8d0LnWFiDsM2bY8bzjC1+elSsIygVsACAAAAAAR0G2m+uANoWknkr/NerFcG+fECVxNIs0cqbY1t/U/0MAAzE4AH0AAAAFZAAgAAAAAAh3WpeMVlikPFYj9hLj+fmIqVt6omCSF75W3TPExyWpBXMAIAAAAAAsQkRmwqeVj2gGE03orb6PtrIzDt6dDU3hgSQi8E2wKgVsACAAAAAA3GHaRE2RAcaBRd8VzmYzWeBD2Gmy91eTK1k8YdWObZcAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHBuAAIAAAAQdGYAAQAAAAFtbgAAAAAAAAAAAAFteAAAAAAAAABpQAA=", - "subType": "06" - } - } - } - }, - "update": { - "$set": { - "encryptedDoublePrecision": { - "$$type": "binData" - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "findAndModify" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "Dri0CXmL78L2DOgk9w0DwxHOMGMzih7m6l59vgy+WWo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "b7d8mRzD1kI1tdc7uNL+YAUonJ6pODLsRLkArfEKSkM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Xg8C1/A0KJaXOw4i+26Rv03/CydaaunOzXh0CIT+gn8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UoKUDw2wJYToUCcFaIs03YQSTksYR0MIOTJllwODqKc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "c/5cwAT0C5jber2xlJnWD3a5tVDy0nRtr5HG02hoFOY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wSUrRXavAGaajNeqC5mEUH1K67oYl5Wy9RNIzKjwLAM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6vrp4wWDtHEgHWR99I70WVDzevg1Fk/Pw5U8gUDa0OU=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDoublePrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "V6knyt7Zq2CG3++l75UtBx2m32iGAPjHiAe439Bf02w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "F08nMDWDZc+DbWM7XCEJNNCEYyinRmrvGP7EWhmp4is=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cXH4688amcDc8kZOJq4UP8cE3R58Zl7e+Qo/1jyspps=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uURBxvTp3FBCVkd+LPqyuY7d6rMW6SGIJQEPY/wtkZI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jG3hax1L3RBp9t38vUt53FsBxgr/+Si/vVISpAylYpE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kwtIW8MhH9Ky5xNjBx8gFA/SHh2YVphie7g5FGBzals=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FHflwFuEMu4xX0ZApHi+pdlBH+oevAtXckCUb5Wv0xU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0OKSXELxPP85SBVwDGf3LtMEQCJ8TTkFUl/+6jlkdb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uEw0lpQtBppR3vqV9j9+NQRSBF1BzZukb8c9IhyWvxc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zVhZ7Q59O087ji49oMJvBIgeir2oqvUpnh4p53GcTow=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dowrzKs+qJhRMZyKDbhjXbuX43FbmUKOaw9I8YlOZDw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ep5B6cska6THLIF7Mn3tn3RvV9EiwLSt0eZM/CLRUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "URNp/YmmDh5wIZUfAzzgPyJeMNiVx9PMsz52DZRujGY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wlM4IAQhhKQEzoVqS8b1Ddd50GB95OFb9LnzOwyjCP4=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-InsertFind.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-InsertFind.json deleted file mode 100644 index 5dcc09dca91..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-InsertFind.json +++ /dev/null @@ -1,571 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range DoublePrecision. Insert and Find.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$gt": { - "$numberDouble": "0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDoublePrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "encryptedDoublePrecision": { - "$gt": { - "$binary": { - "base64": "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", - "subType": "06" - } - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "Dri0CXmL78L2DOgk9w0DwxHOMGMzih7m6l59vgy+WWo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "b7d8mRzD1kI1tdc7uNL+YAUonJ6pODLsRLkArfEKSkM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Xg8C1/A0KJaXOw4i+26Rv03/CydaaunOzXh0CIT+gn8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UoKUDw2wJYToUCcFaIs03YQSTksYR0MIOTJllwODqKc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "c/5cwAT0C5jber2xlJnWD3a5tVDy0nRtr5HG02hoFOY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wSUrRXavAGaajNeqC5mEUH1K67oYl5Wy9RNIzKjwLAM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6vrp4wWDtHEgHWR99I70WVDzevg1Fk/Pw5U8gUDa0OU=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDoublePrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "mVZb+Ra0EYjQ4Zrh9X//E2T8MRj7NMqm5GUJXhRrBEI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FA74j21GUEJb1DJBOpR9nVnjaDZnd8yAQNuaW9Qi26g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kJv//KVkbrobIBf+QeWC5jxn20mx/P0R1N6aCSMgKM8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zB+Whi9IUUGxfLEe+lGuIzLX4LFbIhaIAm5lRk65QTc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ybO1QU3CgvhO8JgRXH+HxKszWcpl5aGDYYVa75fHa1g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X3Y3eSAbbMg//JgiHHiFpYOpV61t8kkDexI+CQyitH4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SlNHXyqVFGDPrX/2ppwog6l4pwj3PKda2TkZbqgfSfA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "McjV8xwTF3xI7863DYOBdyvIv6UpzThl6v9vBRk05bI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "MgwakFvPyBlwqFTbhWUF79URJQWFoJTGotlEVSPPUsQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "DyBERpMSD5lEM5Nhpcn4WGgxgn/mkUVJp+PYSLX5jsE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "I43iazc0xj1WVbYB/V+uTL/tughN1bBlxh1iypBnNsA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wjOBa/ATMuOywFmuPgC0GF/oeLqu0Z7eK5udzkTPbis=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "gRQVwiR+m+0Vg8ZDXqrQQcVnTyobwCXNaA4BCJVXtMc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "WUZ6huwx0ZbLb0R00uiC9FOJzsUocUN8qE5+YRenkvQ=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "7s79aKEuPgQcS/YPOOVcYNZvHIo7FFsWtFCrnDKXefA=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-Update.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-Update.json deleted file mode 100644 index 483e3d52e60..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-DoublePrecision-Update.json +++ /dev/null @@ -1,588 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range DoublePrecision. Update.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedDoublePrecision": { - "$numberDouble": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedDoublePrecision": { - "$numberDouble": "1" - } - } - } - }, - { - "name": "updateOne", - "arguments": { - "filter": { - "encryptedDoublePrecision": { - "$gt": { - "$numberDouble": "0" - } - } - }, - "update": { - "$set": { - "encryptedDoublePrecision": { - "$numberDouble": "2" - } - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedDoublePrecision": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command_name": "update", - "command": { - "update": "default", - "ordered": true, - "updates": [ - { - "q": { - "encryptedDoublePrecision": { - "$gt": { - "$binary": { - "base64": "DQYKAAADcGF5bG9hZACiCQAABGcAjgkAAAMwAH0AAAAFZAAgAAAAAHdJ2Vnb4MMzqVYVssjSdDy8XU4GVzMTfGifGETgQ2mYBXMAIAAAAAD7cFfKJGIXo6PjyeX2ria02CckW7dWFDoY/3FyBdm1NQVsACAAAAAAhEPSNv4M023A3hzNFuy83+hIKuZ2mKRY954N++aEOBUAAzEAfQAAAAVkACAAAAAAlmvfDrZoydUet4eCVMq7z6a58Ea+1HLJOWxN5lNcrWEFcwAgAAAAAEBo5AWZyC41b9ayjWNQSL4iYEAIwR/JG+ssN8bdoK9RBWwAIAAAAACEndE0SLxFSElOrNnqeX0EPmgDio3udZjVREy4JLS3sQADMgB9AAAABWQAIAAAAABbiLaoxAA6rinMJw1hC8ZUiq6UU1AQaPFn/py/Y06WuQVzACAAAAAAhtDasFkvYE7SCNu1je/hxdE9TJtAvvH3NtdEbKzNbCUFbAAgAAAAAIGepU1RSCF8sWODHEpKglsoqw3VBBH4a/URGxgGzbq2AAMzAH0AAAAFZAAgAAAAALORWwSr+tYNxcil2KIGSbNhTHvcPbdj+rLVQNx21S/KBXMAIAAAAAD6diZBkPEJ1cQy06LAxdbNK8Nlxbb44fH4Wk3Y3260nQVsACAAAAAA1eYAZBFHlDiaDAljWi8blGQ2nvvZa5AO5doeo0SFZsgAAzQAfQAAAAVkACAAAAAAG5XMK96PjClNlUvg82j4pMY1YxsznZfj4uNweD394FoFcwAgAAAAAKHgQLdGJHkrfFg9nB93Ac+3VgBw6aU44MTkKIQ91dZoBWwAIAAAAAAPxXmi+SDJ+40A0KdwfRczexlZQrHjIA+D3oUB0EY9tAADNQB9AAAABWQAIAAAAAA6M++b9I0YFemmWBAWAE3glu2Ah3Ta1FBxAQEIWS0toAVzACAAAAAANXYTqPf1Y6X3Ns6YQIX0C3FKCyWUo+Kk+fNcQvc0WSoFbAAgAAAAAA+uJUw1ICYgyeygSRe206VTWVtUnhdci3iHbyP5YtEVAAM2AH0AAAAFZAAgAAAAAKl8bV1riH/uyJ+X0HHd3+18k2cJl2dQFXCdoagutFcaBXMAIAAAAABm8F2Ew9f0VOABdcF+lP0Bi+zWvEUPniWgrxPq/Sx3uwVsACAAAAAAJfFErjZ6BPhsw5LjJLqNtKDLJ4zV0eIZppQpd9b0wZoAAzcAfQAAAAVkACAAAAAAsYZD8JEP6kYsPncFnNZwJxhu4YtUTKPNcjHtv67H+rYFcwAgAAAAAI4LqZcRkvbs/2F62Flu0pixNcor4WmBD0DHGaf039wLBWwAIAAAAAD4wUR3xd9lKltcqqo8LYvdMQWzCRobkV/ppKB/yn5dUgADOAB9AAAABWQAIAAAAAC0vdAi+dmoIXvZ5LqUqvyKV9/tHqSI2SWiSJO5pTnA2wVzACAAAAAAS2qvf9fvfVUH5WtsVxjxmskpGjYTQV34LwvQQw1y9wIFbAAgAAAAAE0+FKuK7HxbypvCeEJzMTcjOWE0ScYOlTBMUNlIv55hAAM5AH0AAAAFZAAgAAAAAH31lb/srBcrOXkzddCwAnclsR5/3QijEVgECs2JjOWBBXMAIAAAAABg7+prDT73YcCvLE5QbuIrqGcjLc5pQD2Miq0d29yrxgVsACAAAAAAetRiPwDSFWBzpWSWkOKWM6fKStRJ8SyObnpc79ux8p0AAzEwAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzExAH0AAAAFZAAgAAAAAFdthRhe2Q8CvxGIhjTJZv0Lk97GkHciTPxZ/mckLoNaBXMAIAAAAAAqOxsAr23LOVB0DIHbPf9UDJJRFXY2YoKbjhRqw5psbQVsACAAAAAA0G2GD8ZQjDBntjLpW4rqwKRS6HiUjL03g1N6chANozcAAzEyAH0AAAAFZAAgAAAAAMWymwwbvIeMqmnKWWifUqoCxOsdpnonM2qdLPyjqJO/BXMAIAAAAAB6IDmmpUhBD2zpRj8/y/kmOSXcjuIU14sNh6GKSsg2uwVsACAAAAAAWMFPNOk3EMSQDS9JGPSMIQP0oNGVugxXKKUrIPPlhHgAAzEzAH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzE0AH0AAAAFZAAgAAAAAJaRYmo8zqI2BEUzdSwp4tVRpPmVWsfydkYN3UHh6TMuBXMAIAAAAAAeD6mDnQeLlbC9i0sVgE8+RH6y+e94OJQ0tJ0PvblVSgVsACAAAAAAWp4jvretbDEsqEMzP/WLTnwOiJwCtfrCiB6m8k+yEMoAAzE1AH0AAAAFZAAgAAAAAAZZ538coNPwyRjhEwr5P8Xw32oWOJF+R+nfCGgy2qO3BXMAIAAAAACOPLnJlKwGNPDBReRKnHfteq0wFb3ezhrc7BVXs8RUHwVsACAAAAAA+lGesNk3+SyB/60rSvdQ2aN2vfJPR7llJVhufGTNhHkAAzE2AH0AAAAFZAAgAAAAAFH9l9GGA1I52atJV5jNUf1lx8jBjoEoVoME97v5GFJiBXMAIAAAAAC1qH3Kd78Dr9NGbw7y9D/XYBwv5h1LLO8la5OU7g8UkQVsACAAAAAArZ6atJCYrVfHB8dSNPOFf6nnDADBMJcIEj8ljPvxHp8AAzE3AH0AAAAFZAAgAAAAADtbVEI2tdkrowEMdkacD2w0Y3T3Ofi7PH6HmA6sP0c/BXMAIAAAAADuBSROnZHA+NgUPH8d0LnWFiDsM2bY8bzjC1+elSsIygVsACAAAAAAR0G2m+uANoWknkr/NerFcG+fECVxNIs0cqbY1t/U/0MAAzE4AH0AAAAFZAAgAAAAAAh3WpeMVlikPFYj9hLj+fmIqVt6omCSF75W3TPExyWpBXMAIAAAAAAsQkRmwqeVj2gGE03orb6PtrIzDt6dDU3hgSQi8E2wKgVsACAAAAAA3GHaRE2RAcaBRd8VzmYzWeBD2Gmy91eTK1k8YdWObZcAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHBuAAIAAAAQdGYAAQAAAAFtbgAAAAAAAAAAAAFteAAAAAAAAABpQAA=", - "subType": "06" - } - } - } - }, - "u": { - "$set": { - "encryptedDoublePrecision": { - "$$type": "binData" - } - } - } - } - ], - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedDoublePrecision", - "bsonType": "double", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberDouble": "0.0" - }, - "max": { - "$numberDouble": "200.0" - }, - "precision": { - "$numberInt": "2" - } - } - } - ] - } - } - }, - "$db": "default" - } - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedDoublePrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "Dri0CXmL78L2DOgk9w0DwxHOMGMzih7m6l59vgy+WWo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "b7d8mRzD1kI1tdc7uNL+YAUonJ6pODLsRLkArfEKSkM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "Xg8C1/A0KJaXOw4i+26Rv03/CydaaunOzXh0CIT+gn8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "UoKUDw2wJYToUCcFaIs03YQSTksYR0MIOTJllwODqKc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "c/5cwAT0C5jber2xlJnWD3a5tVDy0nRtr5HG02hoFOY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wSUrRXavAGaajNeqC5mEUH1K67oYl5Wy9RNIzKjwLAM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6vrp4wWDtHEgHWR99I70WVDzevg1Fk/Pw5U8gUDa0OU=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedDoublePrecision": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "V6knyt7Zq2CG3++l75UtBx2m32iGAPjHiAe439Bf02w=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "F08nMDWDZc+DbWM7XCEJNNCEYyinRmrvGP7EWhmp4is=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cXH4688amcDc8kZOJq4UP8cE3R58Zl7e+Qo/1jyspps=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uURBxvTp3FBCVkd+LPqyuY7d6rMW6SGIJQEPY/wtkZI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jG3hax1L3RBp9t38vUt53FsBxgr/+Si/vVISpAylYpE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kwtIW8MhH9Ky5xNjBx8gFA/SHh2YVphie7g5FGBzals=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FHflwFuEMu4xX0ZApHi+pdlBH+oevAtXckCUb5Wv0xU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "0OKSXELxPP85SBVwDGf3LtMEQCJ8TTkFUl/+6jlkdb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uEw0lpQtBppR3vqV9j9+NQRSBF1BzZukb8c9IhyWvxc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zVhZ7Q59O087ji49oMJvBIgeir2oqvUpnh4p53GcTow=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "dowrzKs+qJhRMZyKDbhjXbuX43FbmUKOaw9I8YlOZDw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ep5B6cska6THLIF7Mn3tn3RvV9EiwLSt0eZM/CLRUDc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "URNp/YmmDh5wIZUfAzzgPyJeMNiVx9PMsz52DZRujGY=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "wlM4IAQhhKQEzoVqS8b1Ddd50GB95OFb9LnzOwyjCP4=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-Aggregate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-Aggregate.json deleted file mode 100644 index 6cd837c7890..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-Aggregate.json +++ /dev/null @@ -1,484 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Int. Aggregate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$gt": { - "$numberInt": "0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "default", - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$gt": { - "$binary": { - "base64": "DW0FAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAAQbW4AAAAAABBteADIAAAAAA==", - "subType": "06" - } - } - } - } - } - ], - "cursor": {}, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "aggregate" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedInt": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FA74j21GUEJb1DJBOpR9nVnjaDZnd8yAQNuaW9Qi26g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kJv//KVkbrobIBf+QeWC5jxn20mx/P0R1N6aCSMgKM8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zB+Whi9IUUGxfLEe+lGuIzLX4LFbIhaIAm5lRk65QTc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ybO1QU3CgvhO8JgRXH+HxKszWcpl5aGDYYVa75fHa1g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X3Y3eSAbbMg//JgiHHiFpYOpV61t8kkDexI+CQyitH4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SlNHXyqVFGDPrX/2ppwog6l4pwj3PKda2TkZbqgfSfA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "McjV8xwTF3xI7863DYOBdyvIv6UpzThl6v9vBRk05bI=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-Correctness.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-Correctness.json deleted file mode 100644 index 9dc4e4e5011..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-Correctness.json +++ /dev/null @@ -1,1644 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Find with $gt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$gt": { - "$numberInt": "0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ] - }, - { - "description": "Find with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$gte": { - "$numberInt": "0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - }, - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ] - }, - { - "description": "Find with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$gt": { - "$numberInt": "1" - } - } - } - }, - "result": [] - } - ] - }, - { - "description": "Find with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$lt": { - "$numberInt": "1" - } - } - } - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - ] - } - ] - }, - { - "description": "Find with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$lte": { - "$numberInt": "1" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - }, - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ] - }, - { - "description": "Find with $lt below min", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$lt": { - "$numberInt": "0" - } - } - } - }, - "result": { - "errorContains": "must be greater than the range minimum" - } - } - ] - }, - { - "description": "Find with $gt above max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$gt": { - "$numberInt": "200" - } - } - } - }, - "result": { - "errorContains": "must be less than the range maximum" - } - } - ] - }, - { - "description": "Find with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$gt": { - "$numberInt": "0" - }, - "$lt": { - "$numberInt": "2" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ] - }, - { - "description": "Find with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$numberInt": "0" - } - } - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - ] - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$numberInt": "1" - } - } - }, - "result": [ - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ] - }, - { - "description": "Find with full range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$gte": { - "$numberInt": "0" - }, - "$lte": { - "$numberInt": "200" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - }, - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ] - }, - { - "description": "Find with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$in": [ - { - "$numberInt": "0" - } - ] - } - } - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - ] - } - ] - }, - { - "description": "Insert out of range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "-1" - } - } - }, - "result": { - "errorContains": "value must be greater than or equal to the minimum value" - } - } - ] - }, - { - "description": "Insert min and max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 200, - "encryptedInt": { - "$numberInt": "200" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - }, - { - "_id": 200, - "encryptedInt": { - "$numberInt": "200" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$gte": { - "$numberInt": "0" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - }, - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$gt": { - "$numberInt": "1" - } - } - } - } - ] - }, - "result": [] - } - ] - }, - { - "description": "Aggregate with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$lt": { - "$numberInt": "1" - } - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$lte": { - "$numberInt": "1" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - }, - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $lt below min", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$lt": { - "$numberInt": "0" - } - } - } - } - ] - }, - "result": { - "errorContains": "must be greater than the range minimum" - } - } - ] - }, - { - "description": "Aggregate with $gt above max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$gt": { - "$numberInt": "200" - } - } - } - } - ] - }, - "result": { - "errorContains": "must be less than the range maximum" - } - } - ] - }, - { - "description": "Aggregate with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$gt": { - "$numberInt": "0" - }, - "$lt": { - "$numberInt": "2" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ] - }, - { - "description": "Aggregate with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$numberInt": "0" - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - ] - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$numberInt": "1" - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ] - }, - { - "description": "Aggregate with full range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$gte": { - "$numberInt": "0" - }, - "$lte": { - "$numberInt": "200" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - }, - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedInt": { - "$in": [ - { - "$numberInt": "0" - } - ] - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - ] - } - ] - }, - { - "description": "Wrong type: Insert Double", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberDouble": "0" - } - } - }, - "result": { - "errorContains": "cannot encrypt element" - } - } - ] - }, - { - "description": "Wrong type: Find Double", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$gte": { - "$numberDouble": "0" - } - } - } - }, - "result": { - "errorContains": "field type is not supported" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-Delete.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-Delete.json deleted file mode 100644 index b251db91575..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-Delete.json +++ /dev/null @@ -1,420 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Int. Delete.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "deleteOne", - "arguments": { - "filter": { - "encryptedInt": { - "$gt": { - "$numberInt": "0" - } - } - } - }, - "result": { - "deletedCount": 1 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "delete": "default", - "deletes": [ - { - "q": { - "encryptedInt": { - "$gt": { - "$binary": { - "base64": "DW0FAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAAQbW4AAAAAABBteADIAAAAAA==", - "subType": "06" - } - } - } - }, - "limit": 1 - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "delete" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-FindOneAndUpdate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-FindOneAndUpdate.json deleted file mode 100644 index 6e09b5ea2c7..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-FindOneAndUpdate.json +++ /dev/null @@ -1,488 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Int. FindOneAndUpdate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "encryptedInt": { - "$gt": { - "$numberInt": "0" - } - } - }, - "update": { - "$set": { - "encryptedInt": { - "$numberInt": "2" - } - } - }, - "returnDocument": "Before" - }, - "result": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default", - "query": { - "encryptedInt": { - "$gt": { - "$binary": { - "base64": "DW0FAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAAQbW4AAAAAABBteADIAAAAAA==", - "subType": "06" - } - } - } - }, - "update": { - "$set": { - "encryptedInt": { - "$$type": "binData" - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "findAndModify" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedInt": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "hyDcE6QQjPrYJaIS/n7evEZFYcm31Tj89CpEYGF45cI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "F08nMDWDZc+DbWM7XCEJNNCEYyinRmrvGP7EWhmp4is=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cXH4688amcDc8kZOJq4UP8cE3R58Zl7e+Qo/1jyspps=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uURBxvTp3FBCVkd+LPqyuY7d6rMW6SGIJQEPY/wtkZI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jG3hax1L3RBp9t38vUt53FsBxgr/+Si/vVISpAylYpE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kwtIW8MhH9Ky5xNjBx8gFA/SHh2YVphie7g5FGBzals=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FHflwFuEMu4xX0ZApHi+pdlBH+oevAtXckCUb5Wv0xU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ty4cnzJdAlbQKnh7px3GEYjBnvO+jIOaKjoTRDtmh3M=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-InsertFind.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-InsertFind.json deleted file mode 100644 index cbab7e76996..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-InsertFind.json +++ /dev/null @@ -1,475 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Int. Insert and Find.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$gt": { - "$numberInt": "0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "encryptedInt": { - "$gt": { - "$binary": { - "base64": "DW0FAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAAQbW4AAAAAABBteADIAAAAAA==", - "subType": "06" - } - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedInt": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FA74j21GUEJb1DJBOpR9nVnjaDZnd8yAQNuaW9Qi26g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kJv//KVkbrobIBf+QeWC5jxn20mx/P0R1N6aCSMgKM8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zB+Whi9IUUGxfLEe+lGuIzLX4LFbIhaIAm5lRk65QTc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ybO1QU3CgvhO8JgRXH+HxKszWcpl5aGDYYVa75fHa1g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X3Y3eSAbbMg//JgiHHiFpYOpV61t8kkDexI+CQyitH4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SlNHXyqVFGDPrX/2ppwog6l4pwj3PKda2TkZbqgfSfA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "McjV8xwTF3xI7863DYOBdyvIv6UpzThl6v9vBRk05bI=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-Update.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-Update.json deleted file mode 100644 index cb6b223943a..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Int-Update.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Int. Update.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedInt": { - "$numberInt": "1" - } - } - } - }, - { - "name": "updateOne", - "arguments": { - "filter": { - "encryptedInt": { - "$gt": { - "$numberInt": "0" - } - } - }, - "update": { - "$set": { - "encryptedInt": { - "$numberInt": "2" - } - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedInt": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command_name": "update", - "command": { - "update": "default", - "ordered": true, - "updates": [ - { - "q": { - "encryptedInt": { - "$gt": { - "$binary": { - "base64": "DW0FAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAAQbW4AAAAAABBteADIAAAAAA==", - "subType": "06" - } - } - } - }, - "u": { - "$set": { - "encryptedInt": { - "$$type": "binData" - } - } - } - } - ], - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - } - } - }, - "$db": "default" - } - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedInt": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedInt": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "hyDcE6QQjPrYJaIS/n7evEZFYcm31Tj89CpEYGF45cI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "F08nMDWDZc+DbWM7XCEJNNCEYyinRmrvGP7EWhmp4is=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cXH4688amcDc8kZOJq4UP8cE3R58Zl7e+Qo/1jyspps=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uURBxvTp3FBCVkd+LPqyuY7d6rMW6SGIJQEPY/wtkZI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jG3hax1L3RBp9t38vUt53FsBxgr/+Si/vVISpAylYpE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kwtIW8MhH9Ky5xNjBx8gFA/SHh2YVphie7g5FGBzals=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FHflwFuEMu4xX0ZApHi+pdlBH+oevAtXckCUb5Wv0xU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ty4cnzJdAlbQKnh7px3GEYjBnvO+jIOaKjoTRDtmh3M=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-Aggregate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-Aggregate.json deleted file mode 100644 index 5c4bf101012..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-Aggregate.json +++ /dev/null @@ -1,484 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Long. Aggregate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$gt": { - "$numberLong": "0" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedLong": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedLong": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "aggregate": "default", - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$gt": { - "$binary": { - "base64": "DXUFAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAASbW4AAAAAAAAAAAASbXgAyAAAAAAAAAAA", - "subType": "06" - } - } - } - } - } - ], - "cursor": {}, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "aggregate" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedLong": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedLong": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FA74j21GUEJb1DJBOpR9nVnjaDZnd8yAQNuaW9Qi26g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kJv//KVkbrobIBf+QeWC5jxn20mx/P0R1N6aCSMgKM8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zB+Whi9IUUGxfLEe+lGuIzLX4LFbIhaIAm5lRk65QTc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ybO1QU3CgvhO8JgRXH+HxKszWcpl5aGDYYVa75fHa1g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X3Y3eSAbbMg//JgiHHiFpYOpV61t8kkDexI+CQyitH4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SlNHXyqVFGDPrX/2ppwog6l4pwj3PKda2TkZbqgfSfA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "McjV8xwTF3xI7863DYOBdyvIv6UpzThl6v9vBRk05bI=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-Correctness.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-Correctness.json deleted file mode 100644 index d81e0933f80..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-Correctness.json +++ /dev/null @@ -1,1644 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Find with $gt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$gt": { - "$numberLong": "0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ] - }, - { - "description": "Find with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$gte": { - "$numberLong": "0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - }, - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ] - }, - { - "description": "Find with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$gt": { - "$numberLong": "1" - } - } - } - }, - "result": [] - } - ] - }, - { - "description": "Find with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$lt": { - "$numberLong": "1" - } - } - } - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - ] - } - ] - }, - { - "description": "Find with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$lte": { - "$numberLong": "1" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - }, - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ] - }, - { - "description": "Find with $lt below min", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$lt": { - "$numberLong": "0" - } - } - } - }, - "result": { - "errorContains": "must be greater than the range minimum" - } - } - ] - }, - { - "description": "Find with $gt above max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$gt": { - "$numberLong": "200" - } - } - } - }, - "result": { - "errorContains": "must be less than the range maximum" - } - } - ] - }, - { - "description": "Find with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$gt": { - "$numberLong": "0" - }, - "$lt": { - "$numberLong": "2" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ] - }, - { - "description": "Find with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$numberLong": "0" - } - } - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - ] - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$numberLong": "1" - } - } - }, - "result": [ - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ] - }, - { - "description": "Find with full range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$gte": { - "$numberLong": "0" - }, - "$lte": { - "$numberLong": "200" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - }, - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ] - }, - { - "description": "Find with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$in": [ - { - "$numberLong": "0" - } - ] - } - } - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - ] - } - ] - }, - { - "description": "Insert out of range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "-1" - } - } - }, - "result": { - "errorContains": "value must be greater than or equal to the minimum value" - } - } - ] - }, - { - "description": "Insert min and max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 200, - "encryptedLong": { - "$numberLong": "200" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - } - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - }, - { - "_id": 200, - "encryptedLong": { - "$numberLong": "200" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$gte": { - "$numberLong": "0" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - }, - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $gt with no results", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$gt": { - "$numberLong": "1" - } - } - } - } - ] - }, - "result": [] - } - ] - }, - { - "description": "Aggregate with $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$lt": { - "$numberLong": "1" - } - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $lte", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$lte": { - "$numberLong": "1" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - }, - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $lt below min", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$lt": { - "$numberLong": "0" - } - } - } - } - ] - }, - "result": { - "errorContains": "must be greater than the range minimum" - } - } - ] - }, - { - "description": "Aggregate with $gt above max", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$gt": { - "$numberLong": "200" - } - } - } - } - ] - }, - "result": { - "errorContains": "must be less than the range maximum" - } - } - ] - }, - { - "description": "Aggregate with $gt and $lt", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$gt": { - "$numberLong": "0" - }, - "$lt": { - "$numberLong": "2" - } - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ] - }, - { - "description": "Aggregate with equality", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$numberLong": "0" - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - ] - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$numberLong": "1" - } - } - } - ] - }, - "result": [ - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ] - }, - { - "description": "Aggregate with full range", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$gte": { - "$numberLong": "0" - }, - "$lte": { - "$numberLong": "200" - } - } - } - }, - { - "$sort": { - "_id": 1 - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - }, - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $in", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "encryptedLong": { - "$in": [ - { - "$numberLong": "0" - } - ] - } - } - } - ] - }, - "result": [ - { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - ] - } - ] - }, - { - "description": "Wrong type: Insert Double", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberDouble": "0" - } - } - }, - "result": { - "errorContains": "cannot encrypt element" - } - } - ] - }, - { - "description": "Wrong type: Find Double", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$gte": { - "$numberDouble": "0" - } - } - } - }, - "result": { - "errorContains": "field type is not supported" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-Delete.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-Delete.json deleted file mode 100644 index faf0c401b71..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-Delete.json +++ /dev/null @@ -1,420 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Long. Delete.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "deleteOne", - "arguments": { - "filter": { - "encryptedLong": { - "$gt": { - "$numberLong": "0" - } - } - } - }, - "result": { - "deletedCount": 1 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedLong": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedLong": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "delete": "default", - "deletes": [ - { - "q": { - "encryptedLong": { - "$gt": { - "$binary": { - "base64": "DXUFAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAASbW4AAAAAAAAAAAASbXgAyAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "limit": 1 - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "delete" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedLong": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-FindOneAndUpdate.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-FindOneAndUpdate.json deleted file mode 100644 index b233b40b54a..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-FindOneAndUpdate.json +++ /dev/null @@ -1,488 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Long. FindOneAndUpdate.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "encryptedLong": { - "$gt": { - "$numberLong": "0" - } - } - }, - "update": { - "$set": { - "encryptedLong": { - "$numberLong": "2" - } - } - }, - "returnDocument": "Before" - }, - "result": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedLong": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedLong": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "findAndModify": "default", - "query": { - "encryptedLong": { - "$gt": { - "$binary": { - "base64": "DXUFAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAASbW4AAAAAAAAAAAASbXgAyAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "update": { - "$set": { - "encryptedLong": { - "$$type": "binData" - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "findAndModify" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedLong": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedLong": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "hyDcE6QQjPrYJaIS/n7evEZFYcm31Tj89CpEYGF45cI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "F08nMDWDZc+DbWM7XCEJNNCEYyinRmrvGP7EWhmp4is=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cXH4688amcDc8kZOJq4UP8cE3R58Zl7e+Qo/1jyspps=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uURBxvTp3FBCVkd+LPqyuY7d6rMW6SGIJQEPY/wtkZI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jG3hax1L3RBp9t38vUt53FsBxgr/+Si/vVISpAylYpE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kwtIW8MhH9Ky5xNjBx8gFA/SHh2YVphie7g5FGBzals=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FHflwFuEMu4xX0ZApHi+pdlBH+oevAtXckCUb5Wv0xU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ty4cnzJdAlbQKnh7px3GEYjBnvO+jIOaKjoTRDtmh3M=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-InsertFind.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-InsertFind.json deleted file mode 100644 index 1b787d4cb6b..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-InsertFind.json +++ /dev/null @@ -1,475 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Long. Insert and Find.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedLong": { - "$gt": { - "$numberLong": "0" - } - } - } - }, - "result": [ - { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedLong": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedLong": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "encryptedLong": { - "$gt": { - "$binary": { - "base64": "DXUFAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAASbW4AAAAAAAAAAAASbXgAyAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedLong": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedLong": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "25j9sQXZCihCmHKvTHgaBsAVZFcGPn7JjHdrCGlwyyw=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FA74j21GUEJb1DJBOpR9nVnjaDZnd8yAQNuaW9Qi26g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kJv//KVkbrobIBf+QeWC5jxn20mx/P0R1N6aCSMgKM8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "zB+Whi9IUUGxfLEe+lGuIzLX4LFbIhaIAm5lRk65QTc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ybO1QU3CgvhO8JgRXH+HxKszWcpl5aGDYYVa75fHa1g=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "X3Y3eSAbbMg//JgiHHiFpYOpV61t8kkDexI+CQyitH4=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "SlNHXyqVFGDPrX/2ppwog6l4pwj3PKda2TkZbqgfSfA=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "McjV8xwTF3xI7863DYOBdyvIv6UpzThl6v9vBRk05bI=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-Update.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-Update.json deleted file mode 100644 index 07182bb5e22..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-Long-Update.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "FLE2 Range Long. Update.", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedLong": { - "$numberLong": "0" - } - } - } - }, - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedLong": { - "$numberLong": "1" - } - } - } - }, - { - "name": "updateOne", - "arguments": { - "filter": { - "encryptedLong": { - "$gt": { - "$numberLong": "0" - } - } - }, - "update": { - "$set": { - "encryptedLong": { - "$numberLong": "2" - } - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 0, - "encryptedLong": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedLong": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command_name": "update", - "command": { - "update": "default", - "ordered": true, - "updates": [ - { - "q": { - "encryptedLong": { - "$gt": { - "$binary": { - "base64": "DXUFAAADcGF5bG9hZAAZBQAABGcABQUAAAMwAH0AAAAFZAAgAAAAALGGQ/CRD+pGLD53BZzWcCcYbuGLVEyjzXIx7b+ux/q2BXMAIAAAAACOC6mXEZL27P9hethZbtKYsTXKK+FpgQ9Axxmn9N/cCwVsACAAAAAA+MFEd8XfZSpbXKqqPC2L3TEFswkaG5Ff6aSgf8p+XVIAAzEAfQAAAAVkACAAAAAAtL3QIvnZqCF72eS6lKr8ilff7R6kiNklokiTuaU5wNsFcwAgAAAAAEtqr3/X731VB+VrbFcY8ZrJKRo2E0Fd+C8L0EMNcvcCBWwAIAAAAABNPhSriux8W8qbwnhCczE3IzlhNEnGDpUwTFDZSL+eYQADMgB9AAAABWQAIAAAAAB99ZW/7KwXKzl5M3XQsAJ3JbEef90IoxFYBArNiYzlgQVzACAAAAAAYO/qaw0+92HAryxOUG7iK6hnIy3OaUA9jIqtHdvcq8YFbAAgAAAAAHrUYj8A0hVgc6VklpDiljOnykrUSfEsjm56XO/bsfKdAAMzAH0AAAAFZAAgAAAAAOK8brUuc2onBNDRtfYMR736dHj4dQqXod8JG7tAMTsDBXMAIAAAAAAW6SrGAL6Bx0s7ZlsYULFfOAiYIGhEWu6md3r+Rk40awVsACAAAAAAIHYXP8RLcCboUmHN3+OlnEw1DxaLSnbTB9PdF228fFAAAzQAfQAAAAVkACAAAAAAV22FGF7ZDwK/EYiGNMlm/QuT3saQdyJM/Fn+ZyQug1oFcwAgAAAAACo7GwCvbcs5UHQMgds9/1QMklEVdjZigpuOFGrDmmxtBWwAIAAAAADQbYYPxlCMMGe2MulbiurApFLoeJSMvTeDU3pyEA2jNwADNQB9AAAABWQAIAAAAADFspsMG7yHjKppyllon1KqAsTrHaZ6JzNqnSz8o6iTvwVzACAAAAAAeiA5pqVIQQ9s6UY/P8v5Jjkl3I7iFNeLDYehikrINrsFbAAgAAAAAFjBTzTpNxDEkA0vSRj0jCED9KDRlboMVyilKyDz5YR4AAM2AH0AAAAFZAAgAAAAAPcLmtq+V1e+MRlZ7NHq1+mrRVBQje5zj685ZvdsfKvSBXMAIAAAAABdHz/3w2k5km97QN9m7oLFYJaVJneNlMboIlz5yUASQAVsACAAAAAAWbp8JVJnx8fEVAJFa7WMfMa7wXeP5M3C8MX20J/i9n0AAzcAfQAAAAVkACAAAAAAYfLwnoxK6XAGQrJFy8+TIJoq38ldBaO75h4zA4ZX5tQFcwAgAAAAAC2wk8UcJH5X5XGnDBYmel6srpBkzBhHtt3Jw1u5TSJ1BWwAIAAAAAA9/YU9eI3D7QbXKIw/3/gzWJ6MZrCYhG0j1wNKgRQp5wADOAB9AAAABWQAIAAAAADGvyrtKkIcaV17ynZA7b2k5Pz6OhvxdWNkDvDWJIja8wVzACAAAAAAOLypVKNxf/wR1G8OZjUUsTQzDYeNNhhITxGMSp7euS4FbAAgAAAAAA9EsxoV1B2DcQ1NJRwuxXnvVR+vkD0wbbDYEI/zFEnDAAM5AH0AAAAFZAAgAAAAAEocREw1L0g+roFUchJI2Yd0M0ME2bnErNUYnpyJP1SqBXMAIAAAAAAcE2/JK/8MoSeOchIuAkKh1X3ImoA7p8ujAZIfvIDo6QVsACAAAAAA+W0+zgLr85/PD7P9a94wk6MgNgrizx/XU9aCxAkp1IwAABJjbQAAAAAAAAAAAAAQcGF5bG9hZElkAAAAAAAQZmlyc3RPcGVyYXRvcgABAAAAEnNwAAEAAAAAAAAAEHRmAAEAAAASbW4AAAAAAAAAAAASbXgAyAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "u": { - "$set": { - "encryptedLong": { - "$$type": "binData" - } - } - } - } - ], - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedLong", - "bsonType": "long", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberInt": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberLong": "0" - }, - "max": { - "$numberLong": "200" - } - } - } - ] - } - } - }, - "$db": "default" - } - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 0, - "encryptedLong": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "RjBYT2h3ZAoHxhf8DU6/dFbDkEBZp0IxREcsRTu2MXs=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "x7GR49EN0t3WXQDihkrbonK7qNIBYC87tpL/XEUyIYc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "JfYUqWF+OoGjiYkRI4L5iPlF+T1Eleul7Fki22jp4Qc=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "q1RyGfIgsaQHoZFRw+DD28V26rN5hweApPLwExncvT8=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "L2PFeKGvLS6C+DLudR6fGlBq3ERPvjWvRyNRIA2HVb0=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "CWxaNqL3iP1yCixDkcmf9bmW3E5VeN8TJkg1jJe528s=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "+vC6araOEo+fpW7PSIP40/EnzBCj1d2N10Jr3rrXJJM=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "6SV63Mf51Z6A6p2X3rCnJKCu6ku3Oeb45mBYbz+IoAo=", - "subType": "00" - } - } - ] - }, - { - "_id": 1, - "encryptedLong": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "hyDcE6QQjPrYJaIS/n7evEZFYcm31Tj89CpEYGF45cI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "F08nMDWDZc+DbWM7XCEJNNCEYyinRmrvGP7EWhmp4is=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "cXH4688amcDc8kZOJq4UP8cE3R58Zl7e+Qo/1jyspps=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "uURBxvTp3FBCVkd+LPqyuY7d6rMW6SGIJQEPY/wtkZI=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "jG3hax1L3RBp9t38vUt53FsBxgr/+Si/vVISpAylYpE=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "kwtIW8MhH9Ky5xNjBx8gFA/SHh2YVphie7g5FGBzals=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "FHflwFuEMu4xX0ZApHi+pdlBH+oevAtXckCUb5Wv0xU=", - "subType": "00" - } - }, - { - "$binary": { - "base64": "ty4cnzJdAlbQKnh7px3GEYjBnvO+jIOaKjoTRDtmh3M=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-WrongType.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-WrongType.json deleted file mode 100644 index 62156045085..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Rangev2-WrongType.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "8.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ], - "maxServerVersion": "8.99.99" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedInt", - "bsonType": "int", - "queries": { - "queryType": "range", - "contention": { - "$numberLong": "0" - }, - "trimFactor": { - "$numberLong": "1" - }, - "sparsity": { - "$numberLong": "1" - }, - "min": { - "$numberInt": "0" - }, - "max": { - "$numberInt": "200" - } - } - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Wrong type: Insert Double", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberDouble": "0" - } - } - }, - "result": { - "errorContains": "cannot encrypt element" - } - } - ] - }, - { - "description": "Wrong type: Find Double", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 0, - "encryptedInt": { - "$numberInt": "0" - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "encryptedInt": { - "$gte": { - "$numberDouble": "0" - } - } - }, - "sort": { - "_id": 1 - } - }, - "result": { - "errorContains": "field type is not supported" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Update.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Update.json deleted file mode 100644 index cb260edc0d6..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-Update.json +++ /dev/null @@ -1,570 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "encrypted_fields": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "sHe0kz57YW7v8g9VP9sf/+K1ex4JqKc5rf/URX3n3p8XdZ6+15uXPaSayC6adWbNxkFskuMCOifDoTT+rkqMtFkDclOy884RuGGtUysq3X7zkAWYTKi8QAfKkajvVbZl2y23UqgVasdQu3OVBQCrH/xY00nNAs/52e958nVjBuzQkSb1T8pKJAyjZsHJ60+FtnfafDZSTAIBJYn7UWBCwQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1648914851981" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Update can query an FLE2 indexed field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedIndexed": "value123" - } - } - }, - { - "name": "updateOne", - "arguments": { - "filter": { - "encryptedIndexed": "value123" - }, - "update": { - "$set": { - "foo": "bar" - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "update": "default", - "updates": [ - { - "q": { - "encryptedIndexed": { - "$eq": { - "$binary": { - "base64": "DIkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVsACAAAAAAaZ9s3G+4znfxStxeOZwcZy1OhzjMGc5hjmdMN+b/w6kSY20AAAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "u": { - "$set": { - "foo": "bar" - } - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "update" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - }, - "foo": "bar", - "__safeContent__": [ - { - "$binary": { - "base64": "ThpoKfQ8AkOzkFfNC1+9PF0pY2nIzfXvRdxQgjkNbBw=", - "subType": "00" - } - } - ] - } - ] - } - } - }, - { - "description": "Update can modify an FLE2 indexed field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encryptedIndexed": "value123" - } - } - }, - { - "name": "updateOne", - "arguments": { - "filter": { - "encryptedIndexed": "value123" - }, - "update": { - "$set": { - "encryptedIndexed": "value456" - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": [ - { - "encryptedIndexed": "value456" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "update": "default", - "updates": [ - { - "q": { - "encryptedIndexed": { - "$eq": { - "$binary": { - "base64": "DIkAAAAFZAAgAAAAAPtVteJQAlgb2YMa/+7YWH00sbQPyt7L6Rb8OwBdMmL2BXMAIAAAAAAd44hgVKnEnTFlwNVC14oyc9OZOTspeymusqkRQj57nAVsACAAAAAAaZ9s3G+4znfxStxeOZwcZy1OhzjMGc5hjmdMN+b/w6kSY20AAAAAAAAAAAAA", - "subType": "06" - } - } - } - }, - "u": { - "$set": { - "encryptedIndexed": { - "$$type": "binData" - } - } - } - } - ], - "ordered": true, - "encryptionInformation": { - "type": 1, - "schema": { - "default.default": { - "escCollection": "enxcol_.default.esc", - "ecocCollection": "enxcol_.default.ecoc", - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "command_name": "update" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": { - "$eq": 1 - } - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encryptedIndexed": { - "$$type": "binData" - }, - "__safeContent__": [ - { - "$binary": { - "base64": "rhe7/w8Ob8Unl44rGr/moScx6m5VODQnscDhF4Nkn6g=", - "subType": "00" - } - } - ] - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-validatorAndPartialFieldExpression.json b/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-validatorAndPartialFieldExpression.json deleted file mode 100644 index 901c4dd841c..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/fle2v2-validatorAndPartialFieldExpression.json +++ /dev/null @@ -1,503 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "7.0.0", - "topology": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "tests": [ - { - "description": "create with a validator on an unencrypted field is OK", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection", - "validator": { - "unencrypted_string": "foo" - } - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - } - ] - }, - { - "description": "create with a validator on an encrypted field is an error", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection", - "validator": { - "encryptedIndexed": "foo" - } - }, - "result": { - "errorContains": "Comparison to encrypted fields not supported" - } - } - ] - }, - { - "description": "collMod with a validator on an unencrypted field is OK", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "collMod": "encryptedCollection", - "validator": { - "unencrypted_string": "foo" - } - } - } - } - ] - }, - { - "description": "collMod with a validator on an encrypted field is an error", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "collMod": "encryptedCollection", - "validator": { - "encryptedIndexed": "foo" - } - } - }, - "result": { - "errorContains": "Comparison to encrypted fields not supported" - } - } - ] - }, - { - "description": "createIndexes with a partialFilterExpression on an unencrypted field is OK", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "createIndexes": "encryptedCollection", - "indexes": [ - { - "name": "name", - "key": { - "name": 1 - }, - "partialFilterExpression": { - "unencrypted_string": "foo" - } - } - ] - } - } - }, - { - "name": "assertIndexExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection", - "index": "name" - } - } - ] - }, - { - "description": "createIndexes with a partialFilterExpression on an encrypted field is an error", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "encryptedFieldsMap": { - "default.encryptedCollection": { - "fields": [ - { - "keyId": { - "$binary": { - "base64": "EjRWeBI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedIndexed", - "bsonType": "string", - "queries": { - "queryType": "equality", - "contention": { - "$numberLong": "0" - } - } - }, - { - "keyId": { - "$binary": { - "base64": "q83vqxI0mHYSNBI0VniQEg==", - "subType": "04" - } - }, - "path": "encryptedUnindexed", - "bsonType": "string" - } - ] - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "createIndexes": "encryptedCollection", - "indexes": [ - { - "name": "name", - "key": { - "name": 1 - }, - "partialFilterExpression": { - "encryptedIndexed": "foo" - } - } - ] - } - }, - "result": { - "errorContains": "Comparison to encrypted fields not supported" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/gcpKMS.json b/driver-core/src/test/resources/client-side-encryption/legacy/gcpKMS.json deleted file mode 100644 index 65f12ec1395..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/gcpKMS.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": { - "properties": { - "encrypted_string_aws": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_azure": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZURE+AAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_gcp": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCP+AAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_local": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_kmip": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "dBHpr8aITfeBQ15grpbLpQ==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_kmip_delegated": { - "encrypt": { - "keyId": [ - { - "$uuid": "7411e9af-c688-4df7-8143-5e60ae96cba6" - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "GCP+AAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "CiQAIgLj0WyktnB4dfYHo5SLZ41K4ASQrjJUaSzl5vvVH0G12G0SiQEAjlV8XPlbnHDEDFbdTO4QIe8ER2/172U1ouLazG0ysDtFFIlSvWX5ZnZUrRMmp/R2aJkzLXEt/zf8Mn4Lfm+itnjgo5R9K4pmPNvvPKNZX5C16lrPT+aA+rd+zXFSmlMg3i5jnxvTdLHhg3G7Q/Uv1ZIJskKt95bzLoe0tUVzRWMYXLIEcohnQg==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1601574333107" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1601574333107" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "gcp", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - }, - "keyAltNames": [ - "altname", - "gcp_altname" - ] - } - ], - "tests": [ - { - "description": "Insert a document with auto encryption using GCP KMS provider", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "gcp": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string_gcp": "string0" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "GCP+AAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault" - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_string_gcp": { - "$binary": { - "base64": "ARgj/gAAAAAAAAAAAAAAAAACwFd+Y5Ojw45GUXNvbcIpN9YkRdoHDHkR4kssdn0tIMKlDQOLFkWFY9X07IRlXsxPD8DcTiKnl6XINK28vhcGlg==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string_gcp": { - "$binary": { - "base64": "ARgj/gAAAAAAAAAAAAAAAAACwFd+Y5Ojw45GUXNvbcIpN9YkRdoHDHkR4kssdn0tIMKlDQOLFkWFY9X07IRlXsxPD8DcTiKnl6XINK28vhcGlg==", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/getMore.json b/driver-core/src/test/resources/client-side-encryption/legacy/getMore.json deleted file mode 100644 index 94e788ef61d..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/getMore.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - }, - { - "_id": 3, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACQ76HWOut3DZtQuV90hp1aaCpZn95vZIaWmn+wrBehcEtcFwyJlBdlyzDzZTWPZCPgiFq72Wvh6Y7VbpU9NAp3A==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "getMore with encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "batchSize": 2, - "filter": {} - }, - "result": [ - { - "_id": 1, - "encrypted_string": "string0" - }, - { - "_id": 2, - "encrypted_string": "string1" - }, - { - "_id": 3, - "encrypted_string": "string2" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "batchSize": 2 - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "default", - "batchSize": 2 - }, - "command_name": "getMore" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - }, - { - "_id": 3, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACQ76HWOut3DZtQuV90hp1aaCpZn95vZIaWmn+wrBehcEtcFwyJlBdlyzDzZTWPZCPgiFq72Wvh6Y7VbpU9NAp3A==", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/insert.json b/driver-core/src/test/resources/client-side-encryption/legacy/insert.json deleted file mode 100644 index cf2910fd7a1..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/insert.json +++ /dev/null @@ -1,344 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "insertOne with encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0", - "random": "abc" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - } - ] - } - } - }, - { - "description": "insertMany with encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 1, - "encrypted_string": "string0", - "random": "abc" - }, - { - "_id": 2, - "encrypted_string": "string1" - } - ] - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/keyAltName.json b/driver-core/src/test/resources/client-side-encryption/legacy/keyAltName.json deleted file mode 100644 index 7f71b9dbeb4..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/keyAltName.json +++ /dev/null @@ -1,228 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "Insert with encryption using key alt name", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_w_altname": "string0", - "altname": "altname" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [] - } - }, - { - "keyAltNames": { - "$in": [ - "altname" - ] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_w_altname": { - "$$type": "binData" - }, - "altname": "altname" - } - ], - "ordered": true - }, - "command_name": "insert" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_w_altname": { - "$$type": "binData" - }, - "altname": "altname" - } - ] - } - } - }, - { - "description": "Replace with key alt name fails", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$set": { - "encrypted_w_altname": "string0" - } - }, - "upsert": true - }, - "result": { - "errorContains": "A non-static (JSONPointer) keyId is not supported" - } - } - ], - "outcome": { - "collection": { - "data": [] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/kmipKMS.json b/driver-core/src/test/resources/client-side-encryption/legacy/kmipKMS.json deleted file mode 100644 index 349328b4333..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/kmipKMS.json +++ /dev/null @@ -1,362 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": { - "properties": { - "encrypted_string_aws": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_azure": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AZURE+AAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_gcp": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "GCP+AAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_local": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_kmip": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "dBHpr8aITfeBQ15grpbLpQ==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "encrypted_string_kmip_delegated": { - "encrypt": { - "keyId": [ - { - "$uuid": "7411e9af-c688-4df7-8143-5e60ae96cba6" - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "dBHpr8aITfeBQ15grpbLpQ==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "eUYDyB0HuWb+lQgUwO+6qJQyTTDTY2gp9FbemL7ZFo0pvr0x6rm6Ff9OVUTGH6HyMKipaeHdiIJU1dzsLwvqKvi7Beh+U4iaIWX/K0oEg1GOsJc0+Z/in8gNHbGUYLmycHViM3LES3kdt7FdFSUl5rEBHrM71yoNEXImz17QJWMGOuT4x6yoi2pvnaRJwfrI4DjpmnnTrDMac92jgZehbg==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1634220190041" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1634220190041" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "kmip", - "keyId": "1" - }, - "keyAltNames": [ - "altname", - "kmip_altname" - ] - }, - { - "_id": { - "$uuid": "7411e9af-c688-4df7-8143-5e60ae96cba6" - }, - "keyMaterial": { - "$binary": { - "base64": "5TLMFWlguBWe5GUESTvOVtkdBsCrynhnV72XRyZ66/nk+EP9/1oEp1t1sg0+vwCTqULHjBiUE6DRx2mYD/Eup1+u2Jgz9/+1sV1drXeOPALNPkSgiZiDbIb67zRi+wTABEcKcegJH+FhmSGxwUoQAiHCsCbcvia5P8tN1lt98YQ=", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1634220190041" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1634220190041" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "kmip", - "delegated": true, - "keyId": "11" - }, - "keyAltNames": [ - "delegated" - ] - } - ], - "tests": [ - { - "description": "Insert a document with auto encryption using KMIP KMS provider", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "kmip": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string_kmip": "string0" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "dBHpr8aITfeBQ15grpbLpQ==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault" - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_string_kmip": { - "$binary": { - "base64": "AXQR6a/GiE33gUNeYK6Wy6UCKCwtKFIsL8eKObDVxvqGupJNUk7kXswHhB7G5j/C1D+6no+Asra0KgSU43bTL3ooIBLVyIzbV5CDJYqzAsa4WQ==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string_kmip": { - "$binary": { - "base64": "AXQR6a/GiE33gUNeYK6Wy6UCKCwtKFIsL8eKObDVxvqGupJNUk7kXswHhB7G5j/C1D+6no+Asra0KgSU43bTL3ooIBLVyIzbV5CDJYqzAsa4WQ==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "Insert a document with auto encryption using KMIP delegated KMS provider", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "kmip": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string_kmip_delegated": "string0" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$uuid": "7411e9af-c688-4df7-8143-5e60ae96cba6" - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault" - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_string_kmip_delegated": { - "$binary": { - "base64": "AXQR6a/GiE33gUNeYK6Wy6YCkB+8NVfAAjIbvLqyXIg6g1a8tXrym92DPoqmxpcdQyH0vQM3aFNMz7tZwQBimKs29ztZV/LWjM633HhO5ACl9A==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string_kmip_delegated": { - "$binary": { - "base64": "AXQR6a/GiE33gUNeYK6Wy6YCkB+8NVfAAjIbvLqyXIg6g1a8tXrym92DPoqmxpcdQyH0vQM3aFNMz7tZwQBimKs29ztZV/LWjM633HhO5ACl9A==", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/localKMS.json b/driver-core/src/test/resources/client-side-encryption/legacy/localKMS.json deleted file mode 100644 index 67c4ba1308e..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/localKMS.json +++ /dev/null @@ -1,191 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": { - "properties": { - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "Ce9HSz/HKKGkIt4uyy+jDuKGA+rLC2cycykMo6vc8jXxqa1UVDYHWq1r+vZKbnnSRBfB981akzRKZCFpC05CTyFqDhXv6OnMjpG97OZEREGIsHEYiJkBW0jJJvfLLgeLsEpBzsro9FztGGXASxyxFRZFhXvHxyiLOKrdWfs7X1O/iK3pEoHMx6uSNSfUOgbebLfIqW7TO++iQS5g1xovXA==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local" - } - } - ], - "tests": [ - { - "description": "Insert a document with auto encryption using local KMS provider", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {}, - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0", - "random": "abc" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault" - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACV/+zJmpqMU47yxS/xIVAviGi7wHDuFwaULAixEAoIh0xHz73UYOM3D8D44gcJn67EROjbz4ITpYzzlCJovDL0Q==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACV/+zJmpqMU47yxS/xIVAviGi7wHDuFwaULAixEAoIh0xHz73UYOM3D8D44gcJn67EROjbz4ITpYzzlCJovDL0Q==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/localSchema.json b/driver-core/src/test/resources/client-side-encryption/legacy/localSchema.json deleted file mode 100644 index 4698520f6fa..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/localSchema.json +++ /dev/null @@ -1,258 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": {}, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "A local schema should override", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0" - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": [ - { - "_id": 1, - "encrypted_string": "string0" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "A local schema with no encryption is an error", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "test": { - "bsonType": "string" - } - }, - "bsonType": "object", - "required": [ - "test" - ] - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0" - } - }, - "result": { - "errorContains": "JSON schema keyword 'required' is only allowed with a remote schema" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/malformedCiphertext.json b/driver-core/src/test/resources/client-side-encryption/legacy/malformedCiphertext.json deleted file mode 100644 index c81330ce833..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/malformedCiphertext.json +++ /dev/null @@ -1,321 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "00" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQ==", - "subType": "06" - } - } - }, - { - "_id": 3, - "encrypted_string": { - "$binary": { - "base64": "AQAAa2V2aW4gYWxiZXJ0c29uCg==", - "subType": "06" - } - } - } - ], - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "Wrong subtype", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "00" - } - } - } - ] - } - ] - }, - { - "description": "Empty data", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "_id": 2 - } - }, - "result": { - "errorContains": "malformed ciphertext" - } - } - ] - }, - { - "description": "Malformed data", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "_id": 3 - } - }, - "result": { - "errorContains": "not all keys requested were satisfied" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/maxWireVersion.json b/driver-core/src/test/resources/client-side-encryption/legacy/maxWireVersion.json deleted file mode 100644 index f04f58dffde..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/maxWireVersion.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "runOn": [ - { - "maxServerVersion": "4.0.99" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "operation fails with maxWireVersion < 8", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - }, - "extraOptions": { - "mongocryptdBypassSpawn": true - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "encrypted_string": "string0" - } - }, - "result": { - "errorContains": "Auto-encryption requires a minimum MongoDB version of 4.2" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/missingKey.json b/driver-core/src/test/resources/client-side-encryption/legacy/missingKey.json deleted file mode 100644 index 275147bb723..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/missingKey.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "Insert with encryption on a missing key", - "clientOptions": { - "autoEncryptOpts": { - "keyVaultNamespace": "keyvault.different", - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0", - "random": "abc" - } - }, - "result": { - "errorContains": "not all keys requested were satisfied" - } - } - ], - "outcome": { - "collection": { - "data": [] - } - }, - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "different", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/namedKMS.json b/driver-core/src/test/resources/client-side-encryption/legacy/namedKMS.json deleted file mode 100644 index c859443585b..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/namedKMS.json +++ /dev/null @@ -1,197 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": { - "properties": { - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "local+name2+AAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "_id": { - "$binary": { - "base64": "local+name2+AAAAAAAAAA==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "DX3iUuOlBsx6wBX9UZ3v/qXk1HNeBace2J+h/JwsDdF/vmSXLZ1l1VmZYIcpVFy6ODhdbzLjd4pNgg9wcm4etYig62KNkmtZ0/s1tAL5VsuW/s7/3PYnYGznZTFhLjIVcOH/RNoRj2eQb/sRTyivL85wePEpAU/JzuBj6qO9Y5txQgs1k0J3aNy10R9aQ8kC1NuSSpLAIXwE6DlNDDJXhw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local:name2" - } - } - ], - "tests": [ - { - "description": "Automatically encrypt and decrypt with a named KMS provider", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local:name2": { - "key": { - "$binary": { - "base64": "local+name2+YUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0" - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": [ - { - "_id": 1, - "encrypted_string": "string0" - } - ] - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "local+name2+AAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AZaHGpfp2pntvgAAAAAAAAAC07sFvTQ0I4O2U49hpr4HezaK44Ivluzv5ntQBTYHDlAJMLyRMyB6Dl+UGHBgqhHe/Xw+pcT9XdiUoOJYAx9g+w==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AZaHGpfp2pntvgAAAAAAAAAC07sFvTQ0I4O2U49hpr4HezaK44Ivluzv5ntQBTYHDlAJMLyRMyB6Dl+UGHBgqhHe/Xw+pcT9XdiUoOJYAx9g+w==", - "subType": "06" - } - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/noSchema.json b/driver-core/src/test/resources/client-side-encryption/legacy/noSchema.json deleted file mode 100644 index 095434f8864..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/noSchema.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "unencrypted", - "tests": [ - { - "description": "Insert on an unencrypted collection", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1 - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "unencrypted" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "insert": "unencrypted", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true - }, - "command_name": "insert" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1 - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/replaceOne.json b/driver-core/src/test/resources/client-side-encryption/legacy/replaceOne.json deleted file mode 100644 index 9757686819d..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/replaceOne.json +++ /dev/null @@ -1,239 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "replaceOne with encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "replaceOne", - "arguments": { - "filter": { - "encrypted_string": "string0" - }, - "replacement": { - "encrypted_string": "string1", - "random": "abc" - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "update": "default", - "updates": [ - { - "q": { - "encrypted_string": { - "$eq": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - }, - "u": { - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - } - } - ], - "ordered": true - }, - "command_name": "update" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - } - ] - } - } - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/timeoutMS.json b/driver-core/src/test/resources/client-side-encryption/legacy/timeoutMS.json deleted file mode 100644 index 247541646cc..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/timeoutMS.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.4" - } - ], - "comment": "Updated timeoutMS and blockTimeMS manually to address race conditions in tests with SSL handshake.", - "database_name": "cse-timeouts-db", - "collection_name": "cse-timeouts-coll", - "data": [], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "timeoutMS applied to listCollections to get collection schema", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - }, - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - }, - "timeoutMS": 200 - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0", - "random": "abc" - } - }, - "result": { - "isTimeoutError": true - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "cse-timeouts-coll" - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - }, - "command_name": "listCollections" - } - } - ] - }, - { - "description": "remaining timeoutMS applied to find to get keyvault data", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections", - "find" - ], - "blockConnection": true, - "blockTimeMS": 300 - } - }, - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - }, - "timeoutMS": 500 - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_string": "string0", - "random": "abc" - } - }, - "result": { - "isTimeoutError": true - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/types.json b/driver-core/src/test/resources/client-side-encryption/legacy/types.json deleted file mode 100644 index a6c6507e90d..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/types.json +++ /dev/null @@ -1,1646 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "json_schema": {}, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "type=objectId", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_objectId": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "objectId", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_objectId": { - "$oid": "AAAAAAAAAAAAAAAAAAAAAAAA" - } - } - } - }, - { - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "encrypted_objectId": { - "$oid": "AAAAAAAAAAAAAAAAAAAAAAAA" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_objectId": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAAHmkTPqvzfHMWpvS1mEsrjOxVQ2dyihEgIFWD5E0eNEsiMBQsC0GuvjdqYRL5DHLFI1vKuGek7EYYp0Qyii/tHqA==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_objectId": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAAHmkTPqvzfHMWpvS1mEsrjOxVQ2dyihEgIFWD5E0eNEsiMBQsC0GuvjdqYRL5DHLFI1vKuGek7EYYp0Qyii/tHqA==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "type=symbol", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_symbol": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "symbol", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_symbol": { - "$symbol": "test" - } - } - } - }, - { - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "encrypted_symbol": { - "$symbol": "test" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_symbol": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAAOOmvDmWjcuKsSCO7U/7t9HJ8eI73B6wduyMbdkvn7n7V4uTJes/j+BTtneSdyG2JHKHGkevWAJSIU2XoO66BSXw==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_symbol": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAAOOmvDmWjcuKsSCO7U/7t9HJ8eI73B6wduyMbdkvn7n7V4uTJes/j+BTtneSdyG2JHKHGkevWAJSIU2XoO66BSXw==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "type=int", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_int": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "int", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_int": { - "$numberInt": "123" - } - } - } - }, - { - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "encrypted_int": { - "$numberInt": "123" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_int": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAAQPNXJVXMEjGZnftMuf2INKufXCtQIRHdw5wTgn6QYt3ejcoAXyiwI4XIUizkpsob494qpt2in4tWeiO7b9zkA8Q==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_int": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAAQPNXJVXMEjGZnftMuf2INKufXCtQIRHdw5wTgn6QYt3ejcoAXyiwI4XIUizkpsob494qpt2in4tWeiO7b9zkA8Q==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "type=double", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_double": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "double", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_double": { - "$numberDouble": "1.23" - } - } - }, - "result": { - "errorContains": "element of type: double" - } - } - ] - }, - { - "description": "type=decimal", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_decimal": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "decimal", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_decimal": { - "$numberDecimal": "1.23" - } - } - }, - "result": { - "errorContains": "element of type: decimal" - } - } - ] - }, - { - "description": "type=binData", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_binData": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "binData", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_binData": { - "$binary": { - "base64": "AAAA", - "subType": "00" - } - } - } - } - }, - { - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "encrypted_binData": { - "$binary": { - "base64": "AAAA", - "subType": "00" - } - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_binData": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAAFB/KHZQHaHHo8fctcl7v6kR+sLkJoTRx2cPSSck9ya+nbGROSeFhdhDRHaCzhV78fDEqnMDSVPNi+ZkbaIh46GQ==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_binData": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAAFB/KHZQHaHHo8fctcl7v6kR+sLkJoTRx2cPSSck9ya+nbGROSeFhdhDRHaCzhV78fDEqnMDSVPNi+ZkbaIh46GQ==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "type=javascript", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_javascript": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "javascript", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_javascript": { - "$code": "var x = 1;" - } - } - } - }, - { - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "encrypted_javascript": { - "$code": "var x = 1;" - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_javascript": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAANrvMgJkTKWGMc9wt3E2RBR2Hu5gL9p+vIIdHe9FcOm99t1W480/oX1Gnd87ON3B399DuFaxi/aaIiQSo7gTX6Lw==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_javascript": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAANrvMgJkTKWGMc9wt3E2RBR2Hu5gL9p+vIIdHe9FcOm99t1W480/oX1Gnd87ON3B399DuFaxi/aaIiQSo7gTX6Lw==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "type=javascriptWithScope", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_javascriptWithScope": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "javascriptWithScope", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_javascriptWithScope": { - "$code": "var x = 1;", - "$scope": {} - } - } - }, - "result": { - "errorContains": "element of type: javascriptWithScope" - } - } - ] - }, - { - "description": "type=object", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_object": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "object", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_object": {} - } - }, - "result": { - "errorContains": "element of type: object" - } - } - ] - }, - { - "description": "type=timestamp", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_timestamp": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "timestamp", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_timestamp": { - "$timestamp": { - "t": 123, - "i": 456 - } - } - } - } - }, - { - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "encrypted_timestamp": { - "$timestamp": { - "t": 123, - "i": 456 - } - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_timestamp": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAARJHaM4Gq3MpDTdBasBsEolQaOmxJQU1wsZVaSFAOLpEh1QihDglXI95xemePFMKhg+KNpFg7lw1ChCs2Wn/c26Q==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_timestamp": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAARJHaM4Gq3MpDTdBasBsEolQaOmxJQU1wsZVaSFAOLpEh1QihDglXI95xemePFMKhg+KNpFg7lw1ChCs2Wn/c26Q==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "type=regex", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_regex": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "regex", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_regex": { - "$regularExpression": { - "pattern": "test", - "options": "" - } - } - } - } - }, - { - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "encrypted_regex": { - "$regularExpression": { - "pattern": "test", - "options": "" - } - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_regex": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAALVnxM4UqGhqf5eXw6nsS08am3YJrTf1EvjKitT8tyyMAbHsICIU3GUjuC7EBofCHbusvgo7pDyaClGostFz44nA==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_regex": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAALVnxM4UqGhqf5eXw6nsS08am3YJrTf1EvjKitT8tyyMAbHsICIU3GUjuC7EBofCHbusvgo7pDyaClGostFz44nA==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "type=date", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_date": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "date", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_date": { - "$date": { - "$numberLong": "123" - } - } - } - } - }, - { - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "result": { - "_id": 1, - "encrypted_date": { - "$date": { - "$numberLong": "123" - } - } - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "insert": "default", - "documents": [ - { - "_id": 1, - "encrypted_date": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAAJ5sN7u6l97+DswfKTqZAijSTSOo5htinGKQKUD7pHNJYlLXGOkB4glrCu7ibu0g3344RHQ5yUp4YxMEa8GD+Snw==", - "subType": "06" - } - } - } - ], - "ordered": true - }, - "command_name": "insert" - } - }, - { - "command_started_event": { - "command": { - "find": "default", - "filter": { - "_id": 1 - } - }, - "command_name": "find" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_date": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAAJ5sN7u6l97+DswfKTqZAijSTSOo5htinGKQKUD7pHNJYlLXGOkB4glrCu7ibu0g3344RHQ5yUp4YxMEa8GD+Snw==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "type=minKey", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_minKey": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "minKey", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_minKey": { - "$minKey": 1 - } - } - }, - "result": { - "errorContains": "Cannot encrypt element of type: minKey" - } - } - ] - }, - { - "description": "type=maxKey", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_maxKey": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "maxKey", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_maxKey": { - "$maxKey": 1 - } - } - }, - "result": { - "errorContains": "Cannot encrypt element of type: maxKey" - } - } - ] - }, - { - "description": "type=undefined", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_undefined": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "undefined", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_undefined": { - "$undefined": true - } - } - }, - "result": { - "errorContains": "Cannot encrypt element of type: undefined" - } - } - ] - }, - { - "description": "type=array", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_array": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "array", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_array": [] - } - }, - "result": { - "errorContains": "element of type: array" - } - } - ] - }, - { - "description": "type=bool", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_bool": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "bool", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_bool": true - } - }, - "result": { - "errorContains": "element of type: bool" - } - } - ] - }, - { - "description": "type=null", - "clientOptions": { - "autoEncryptOpts": { - "schemaMap": { - "default.default": { - "properties": { - "encrypted_null": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "null", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - }, - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "encrypted_null": true - } - }, - "result": { - "errorContains": "Cannot encrypt element of type: null" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/unsupportedCommand.json b/driver-core/src/test/resources/client-side-encryption/legacy/unsupportedCommand.json deleted file mode 100644 index 31887151150..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/unsupportedCommand.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "x": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "x": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "mapReduce deterministic encryption (unsupported)", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "mapReduce", - "arguments": { - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "result": { - "errorContains": "command not supported for auto encryption: mapreduce" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/updateMany.json b/driver-core/src/test/resources/client-side-encryption/legacy/updateMany.json deleted file mode 100644 index 823909044b7..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/updateMany.json +++ /dev/null @@ -1,307 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "updateMany with deterministic encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateMany", - "arguments": { - "filter": { - "encrypted_string": { - "$in": [ - "string0", - "string1" - ] - } - }, - "update": { - "$set": { - "encrypted_string": "string2", - "random": "abc" - } - } - }, - "result": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "update": "default", - "updates": [ - { - "q": { - "encrypted_string": { - "$in": [ - { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - }, - { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - } - ] - } - }, - "u": { - "$set": { - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACQ76HWOut3DZtQuV90hp1aaCpZn95vZIaWmn+wrBehcEtcFwyJlBdlyzDzZTWPZCPgiFq72Wvh6Y7VbpU9NAp3A==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - } - }, - "multi": true, - "upsert": false - } - ], - "ordered": true - }, - "command_name": "update" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACQ76HWOut3DZtQuV90hp1aaCpZn95vZIaWmn+wrBehcEtcFwyJlBdlyzDzZTWPZCPgiFq72Wvh6Y7VbpU9NAp3A==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - }, - { - "_id": 2, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACQ76HWOut3DZtQuV90hp1aaCpZn95vZIaWmn+wrBehcEtcFwyJlBdlyzDzZTWPZCPgiFq72Wvh6Y7VbpU9NAp3A==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - } - ] - } - } - }, - { - "description": "updateMany fails when filtering on a random field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateMany", - "arguments": { - "filter": { - "random": "abc" - }, - "update": { - "$set": { - "encrypted_string": "string1" - } - } - }, - "result": { - "errorContains": "Cannot query on fields encrypted with the randomized encryption" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/updateOne.json b/driver-core/src/test/resources/client-side-encryption/legacy/updateOne.json deleted file mode 100644 index 23bada964ff..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/updateOne.json +++ /dev/null @@ -1,465 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "4.1.10" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ], - "json_schema": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - }, - "key_vault_data": [ - { - "status": 1, - "_id": { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gEqnsxXlR51T5EbEVezUqqKAAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDHa4jo6yp0Z18KgbUgIBEIB74sKxWtV8/YHje5lv5THTl0HIbhSwM6EqRlmBiFFatmEWaeMk4tO4xBX65eq670I5TWPSLMzpp8ncGHMmvHqRajNBnmFtbYxN3E3/WjxmdbOOe+OXpnGJPcGsftc7cB2shRfA4lICPnE26+oVNXT6p0Lo20nY5XC7jyCO", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "keyAltNames": [ - "altname", - "another_altname" - ] - } - ], - "tests": [ - { - "description": "updateOne with deterministic encryption", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": { - "encrypted_string": "string0" - }, - "update": { - "$set": { - "encrypted_string": "string1", - "random": "abc" - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "find": "datakeys", - "filter": { - "$or": [ - { - "_id": { - "$in": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ] - } - }, - { - "keyAltNames": { - "$in": [] - } - } - ] - }, - "$db": "keyvault", - "readConcern": { - "level": "majority" - } - }, - "command_name": "find" - } - }, - { - "command_started_event": { - "command": { - "update": "default", - "updates": [ - { - "q": { - "encrypted_string": { - "$eq": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - }, - "u": { - "$set": { - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - } - } - } - ], - "ordered": true - }, - "command_name": "update" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACDdw4KFz3ZLquhsbt7RmDjD0N67n0uSXx7IGnQNCLeIKvot6s/ouI21Eo84IOtb6lhwUNPlSEBNY0/hbszWAKJg==", - "subType": "06" - } - }, - "random": { - "$$type": "binData" - } - } - ] - } - } - }, - { - "description": "updateOne fails when filtering on a random field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": { - "random": "abc" - }, - "update": { - "$set": { - "encrypted_string": "string1" - } - } - }, - "result": { - "errorContains": "Cannot query on fields encrypted with the randomized encryption" - } - } - ] - }, - { - "description": "$unset works with an encrypted field", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$unset": { - "encrypted_string": "" - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "update": "default", - "updates": [ - { - "q": {}, - "u": { - "$unset": { - "encrypted_string": "" - } - } - } - ], - "ordered": true - }, - "command_name": "update" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1 - } - ] - } - } - }, - { - "description": "$rename works if target value has same encryption options", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$rename": { - "encrypted_string": "encrypted_string_equivalent" - } - } - }, - "result": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectations": [ - { - "command_started_event": { - "command": { - "listCollections": 1, - "filter": { - "name": "default" - } - }, - "command_name": "listCollections" - } - }, - { - "command_started_event": { - "command": { - "update": "default", - "updates": [ - { - "q": {}, - "u": { - "$rename": { - "encrypted_string": "encrypted_string_equivalent" - } - } - } - ], - "ordered": true - }, - "command_name": "update" - } - } - ], - "outcome": { - "collection": { - "data": [ - { - "_id": 1, - "encrypted_string_equivalent": { - "$binary": { - "base64": "AQAAAAAAAAAAAAAAAAAAAAACwj+3zkv2VM+aTfk60RqhXq6a/77WlLwu/BxXFkL7EppGsju/m8f0x5kBDD3EZTtGALGXlym5jnpZAoSIkswHoA==", - "subType": "06" - } - } - } - ] - } - } - }, - { - "description": "$rename fails if target value has different encryption options", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$rename": { - "encrypted_string": "random" - } - } - }, - "result": { - "errorContains": "$rename between two encrypted fields must have the same metadata or both be unencrypted" - } - } - ] - }, - { - "description": "an invalid update (no $ operators) is validated and errors", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "aws": {} - } - } - }, - "operations": [ - { - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "encrypted_string": "random" - } - }, - "result": { - "errorContains": "" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/client-side-encryption/legacy/validatorAndPartialFieldExpression.json b/driver-core/src/test/resources/client-side-encryption/legacy/validatorAndPartialFieldExpression.json deleted file mode 100644 index e07137ce151..00000000000 --- a/driver-core/src/test/resources/client-side-encryption/legacy/validatorAndPartialFieldExpression.json +++ /dev/null @@ -1,642 +0,0 @@ -{ - "runOn": [ - { - "minServerVersion": "6.0.0" - } - ], - "database_name": "default", - "collection_name": "default", - "data": [], - "tests": [ - { - "description": "create with a validator on an unencrypted field is OK", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "schemaMap": { - "default.encryptedCollection": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection", - "validator": { - "unencrypted_string": "foo" - } - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection" - } - } - ] - }, - { - "description": "create with a validator on an encrypted field is an error", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "schemaMap": { - "default.encryptedCollection": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection", - "validator": { - "encrypted_string": "foo" - } - }, - "result": { - "errorContains": "Comparison to encrypted fields not supported" - } - } - ] - }, - { - "description": "collMod with a validator on an unencrypted field is OK", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "schemaMap": { - "default.encryptedCollection": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "collMod": "encryptedCollection", - "validator": { - "unencrypted_string": "foo" - } - } - } - } - ] - }, - { - "description": "collMod with a validator on an encrypted field is an error", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "schemaMap": { - "default.encryptedCollection": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "collMod": "encryptedCollection", - "validator": { - "encrypted_string": "foo" - } - } - }, - "result": { - "errorContains": "Comparison to encrypted fields not supported" - } - } - ] - }, - { - "description": "createIndexes with a partialFilterExpression on an unencrypted field is OK", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "schemaMap": { - "default.encryptedCollection": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "createIndexes": "encryptedCollection", - "indexes": [ - { - "name": "name", - "key": { - "name": 1 - }, - "partialFilterExpression": { - "unencrypted_string": "foo" - } - } - ] - } - } - }, - { - "name": "assertIndexExists", - "object": "testRunner", - "arguments": { - "database": "default", - "collection": "encryptedCollection", - "index": "name" - } - } - ] - }, - { - "description": "createIndexes with a partialFilterExpression on an encrypted field is an error", - "clientOptions": { - "autoEncryptOpts": { - "kmsProviders": { - "local": { - "key": { - "$binary": { - "base64": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", - "subType": "00" - } - } - } - }, - "schemaMap": { - "default.encryptedCollection": { - "properties": { - "encrypted_w_altname": { - "encrypt": { - "keyId": "/altname", - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "random": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Random" - } - }, - "encrypted_string_equivalent": { - "encrypt": { - "keyId": [ - { - "$binary": { - "base64": "AAAAAAAAAAAAAAAAAAAAAA==", - "subType": "04" - } - } - ], - "bsonType": "string", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - } - }, - "bsonType": "object" - } - } - } - }, - "operations": [ - { - "name": "dropCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "createCollection", - "object": "database", - "arguments": { - "collection": "encryptedCollection" - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "createIndexes": "encryptedCollection", - "indexes": [ - { - "name": "name", - "key": { - "name": 1 - }, - "partialFilterExpression": { - "encrypted_string": "foo" - } - } - ] - } - }, - "result": { - "errorContains": "Comparison to encrypted fields not supported" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/README.rst b/driver-core/src/test/resources/connection-monitoring-and-pooling/README.rst deleted file mode 100644 index 72eda4b0245..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/README.rst +++ /dev/null @@ -1,217 +0,0 @@ -.. role:: javascript(code) - :language: javascript - -======================================== -Connection Monitoring and Pooling (CMAP) -======================================== - -.. contents:: - --------- - -Introduction -============ - -The YAML and JSON files in this directory are platform-independent tests that -drivers can use to prove their conformance to the Connection Monitoring and Pooling (CMAP) Spec. - -Several prose tests, which are not easily expressed in YAML, are also presented -in this file. Those tests will need to be manually implemented by each driver. - -Common Test Format -================== - -Each YAML file has the following keys: - -- ``version``: A version number indicating the expected format of the spec tests (current version = 1) -- ``style``: A string indicating what style of tests this file contains. Contains one of the following: - - - ``"unit"``: a test that may be run without connecting to a MongoDB deployment. - - ``"integration"``: a test that MUST be run against a real MongoDB deployment. - -- ``description``: A text description of what the test is meant to assert - -Unit Test Format: -================= - -All Unit Tests have some of the following fields: - -- ``poolOptions``: if present, connection pool options to use when creating a pool -- ``operations``: A list of operations to perform. All operations support the following fields: - - - ``name``: A string describing which operation to issue. - - ``thread``: The name of the thread in which to run this operation. If not specified, runs in the default thread - -- ``error``: Indicates that the main thread is expected to error during this test. An error may include of the following fields: - - - ``type``: the type of error emitted - - ``message``: the message associated with that error - - ``address``: Address of pool emitting error - -- ``events``: An array of all connection monitoring events expected to occur while running ``operations``. An event may contain any of the following fields - - - ``type``: The type of event emitted - - ``address``: The address of the pool emitting the event - - ``connectionId``: The id of a connection associated with the event - - ``options``: Options used to create the pool - - ``reason``: A reason giving mroe information on why the event was emitted - -- ``ignore``: An array of event names to ignore - -Valid Unit Test Operations are the following: - -- ``start(target)``: Starts a new thread named ``target`` - - - ``target``: The name of the new thread to start - -- ``wait(ms)``: Sleep the current thread for ``ms`` milliseconds - - - ``ms``: The number of milliseconds to sleep the current thread for - -- ``waitForThread(target)``: wait for thread ``target`` to finish executing. Propagate any errors to the main thread. - - - ``target``: The name of the thread to wait for. - -- ``waitForEvent(event, count, timeout)``: block the current thread until ``event`` has occurred ``count`` times - - - ``event``: The name of the event - - ``count``: The number of times the event must occur (counting from the start of the test) - - ``timeout``: If specified, time out with an error after waiting for this many milliseconds without seeing the required events - -- ``label = pool.checkOut()``: call ``checkOut`` on pool, returning the checked out connection - - - ``label``: If specified, associate this label with the returned connection, so that it may be referenced in later operations - -- ``pool.checkIn(connection)``: call ``checkIn`` on pool - - - ``connection``: A string label identifying which connection to check in. Should be a label that was previously set with ``checkOut`` - -- ``pool.clear()``: call ``clear`` on Pool -- ``pool.close()``: call ``close`` on Pool -- ``pool.ready()``: call ``ready`` on Pool - - -Integration Test Format -======================= - -The integration test format is identical to the unit test format with -the addition of the following fields to each test: - -- ``runOn`` (optional): An array of server version and/or topology requirements - for which the tests can be run. If the test environment satisfies one or more - of these requirements, the tests may be executed; otherwise, this test should - be skipped. If this field is omitted, the tests can be assumed to have no - particular requirements and should be executed. Each element will have some or - all of the following fields: - - - ``minServerVersion`` (optional): The minimum server version (inclusive) - required to successfully run the tests. If this field is omitted, it should - be assumed that there is no lower bound on the required server version. - - - ``maxServerVersion`` (optional): The maximum server version (inclusive) - against which the tests can be run successfully. If this field is omitted, - it should be assumed that there is no upper bound on the required server - version. - -- ``failPoint``: optional, a document containing a ``configureFailPoint`` - command to run against the endpoint being used for the test. - -- ``poolOptions.appName`` (optional): appName attribute to be set in connections, which will be affected by the fail point. - -Spec Test Match Function -======================== - -The definition of MATCH or MATCHES in the Spec Test Runner is as follows: - -- MATCH takes two values, ``expected`` and ``actual`` -- Notation is "Assert [actual] MATCHES [expected] -- Assertion passes if ``expected`` is a subset of ``actual``, with the values ``42`` and ``"42"`` acting as placeholders for "any value" - -Pseudocode implementation of ``actual`` MATCHES ``expected``: - -:: - - If expected is "42" or 42: - Assert that actual exists (is not null or undefined) - Else: - Assert that actual is of the same JSON type as expected - If expected is a JSON array: - For every idx/value in expected: - Assert that actual[idx] MATCHES value - Else if expected is a JSON object: - For every key/value in expected - Assert that actual[key] MATCHES value - Else: - Assert that expected equals actual - -Unit Test Runner: -================= - -For the unit tests, the behavior of a Connection is irrelevant beyond the need to asserting ``connection.id``. Drivers MAY use a mock connection class for testing the pool behavior in unit tests - -For each YAML file with ``style: unit``: - -- Create a Pool ``pool``, subscribe and capture any Connection Monitoring events emitted in order. - - - If ``poolOptions`` is specified, use those options to initialize both pools - - The returned pool must have an ``address`` set as a string value. - - If the pool uses a background thread to satisfy ``minPoolSize``, ensure it - attempts to create a new connection every 50ms. - -- Process each ``operation`` in ``operations`` (on the main thread) - - - If a ``thread`` is specified, the main thread MUST schedule the operation to execute in the corresponding thread. Otherwise, execute the operation directly in the main thread. - -- If ``error`` is presented - - - Assert that an actual error ``actualError`` was thrown by the main thread - - Assert that ``actualError`` MATCHES ``error`` - -- Else: - - - Assert that no errors were thrown by the main thread - -- calculate ``actualEvents`` as every Connection Event emitted whose ``type`` is not in ``ignore`` -- if ``events`` is not empty, then for every ``idx``/``expectedEvent`` in ``events`` - - - Assert that ``actualEvents[idx]`` exists - - Assert that ``actualEvents[idx]`` MATCHES ``expectedEvent`` - - -It is important to note that the ``ignore`` list is used for calculating ``actualEvents``, but is NOT used for the ``waitForEvent`` command - -Integration Test Runner -======================= - -The steps to run the integration tests are the same as those used to run the -unit tests with the following modifications: - -- The integration tests MUST be run against an actual endpoint. If the - deployment being tested contains multiple endpoints, then the runner MUST - only use one of them to run the tests against. - -- For each test, if `failPoint` is specified, its value is a - ``configureFailPoint`` command. Run the command on the admin database of the - endpoint being tested to enable the fail point. - -- At the end of each test, any enabled fail point MUST be disabled to avoid - spurious failures in subsequent tests. The fail point may be disabled like - so:: - - db.adminCommand({ - configureFailPoint: , - mode: "off" - }); - - -Prose Tests -=========== - -The following tests have not yet been automated, but MUST still be tested - -#. All ConnectionPoolOptions MUST be specified at the MongoClient level -#. All ConnectionPoolOptions MUST be the same for all pools created by a MongoClient -#. A user MUST be able to specify all ConnectionPoolOptions via a URI string -#. A user MUST be able to subscribe to Connection Monitoring Events in a manner idiomatic to their language and driver -#. When a check out attempt fails because connection set up throws an error, - assert that a ConnectionCheckOutFailedEvent with reason="connectionError" is emitted. diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/connection-must-have-id.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/connection-must-have-id.json deleted file mode 100644 index f2d6fb95e9e..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/connection-must-have-id.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must have an ID number associated with it", - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut" - }, - { - "name": "checkOut" - } - ], - "events": [ - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCreated", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCreated", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - } - ], - "ignore": [ - "ConnectionPoolCreated", - "ConnectionPoolReady", - "ConnectionPoolClosed", - "ConnectionReady" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/connection-must-order-ids.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/connection-must-order-ids.json deleted file mode 100644 index b7c2751dd7e..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/connection-must-order-ids.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must have IDs assigned in order of creation", - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut" - }, - { - "name": "checkOut" - } - ], - "events": [ - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCreated", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCreated", - "connectionId": 2, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 2, - "address": 42 - } - ], - "ignore": [ - "ConnectionPoolCreated", - "ConnectionPoolReady", - "ConnectionPoolClosed", - "ConnectionReady" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkin-destroy-closed.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkin-destroy-closed.json deleted file mode 100644 index 55d0c03752d..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkin-destroy-closed.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must destroy checked in connection if pool has been closed", - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut", - "label": "conn" - }, - { - "name": "close" - }, - { - "name": "checkIn", - "connection": "conn" - } - ], - "events": [ - { - "type": "ConnectionCheckedOut", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionPoolClosed", - "address": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionClosed", - "connectionId": 1, - "reason": "poolClosed", - "address": 42 - } - ], - "ignore": [ - "ConnectionPoolCreated", - "ConnectionPoolReady", - "ConnectionCreated", - "ConnectionReady", - "ConnectionCheckOutStarted" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkin-destroy-stale.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkin-destroy-stale.json deleted file mode 100644 index 6ffb8f53d11..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkin-destroy-stale.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must destroy checked in connection if it is stale", - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut", - "label": "conn" - }, - { - "name": "clear" - }, - { - "name": "checkIn", - "connection": "conn" - } - ], - "events": [ - { - "type": "ConnectionCheckedOut", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionPoolCleared", - "address": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionClosed", - "connectionId": 1, - "reason": "stale", - "address": 42 - } - ], - "ignore": [ - "ConnectionPoolCreated", - "ConnectionPoolReady", - "ConnectionCreated", - "ConnectionReady", - "ConnectionCheckOutStarted" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkin-make-available.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkin-make-available.json deleted file mode 100644 index 3f37f188c0f..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkin-make-available.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must make valid checked in connection available", - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut", - "label": "conn" - }, - { - "name": "checkIn", - "connection": "conn" - }, - { - "name": "checkOut" - } - ], - "events": [ - { - "type": "ConnectionCheckedOut", - "connectionId": 1, - "address": 42, - "duration": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 1, - "address": 42, - "duration": 42 - } - ], - "ignore": [ - "ConnectionPoolCreated", - "ConnectionPoolReady", - "ConnectionCreated", - "ConnectionReady", - "ConnectionCheckOutStarted" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkin.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkin.json deleted file mode 100644 index 3b40cec6f44..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkin.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must have a method of allowing the driver to check in a connection", - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut", - "label": "conn" - }, - { - "name": "checkIn", - "connection": "conn" - } - ], - "events": [ - { - "type": "ConnectionCheckedIn", - "connectionId": 42, - "address": 42 - } - ], - "ignore": [ - "ConnectionPoolCreated", - "ConnectionPoolReady", - "ConnectionCreated", - "ConnectionReady", - "ConnectionClosed", - "ConnectionCheckOutStarted", - "ConnectionCheckedOut" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-connection.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-connection.json deleted file mode 100644 index c7e8914d45d..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-connection.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must be able to check out a connection", - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut" - } - ], - "events": [ - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCreated", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionReady", - "connectionId": 1, - "address": 42, - "duration": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 1, - "address": 42, - "duration": 42 - } - ], - "ignore": [ - "ConnectionPoolReady", - "ConnectionPoolCreated" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-custom-maxConnecting-is-enforced.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-custom-maxConnecting-is-enforced.json deleted file mode 100644 index 6620f82fd9b..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-custom-maxConnecting-is-enforced.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "version": 1, - "style": "integration", - "description": "custom maxConnecting is enforced", - "runOn": [ - { - "minServerVersion": "4.4.0" - } - ], - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "isMaster", - "hello" - ], - "closeConnection": false, - "blockConnection": true, - "blockTimeMS": 500 - } - }, - "poolOptions": { - "maxConnecting": 1, - "maxPoolSize": 2, - "waitQueueTimeoutMS": 5000 - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "start", - "target": "thread1" - }, - { - "name": "start", - "target": "thread2" - }, - { - "name": "checkOut", - "thread": "thread1" - }, - { - "name": "waitForEvent", - "event": "ConnectionCreated", - "count": 1 - }, - { - "name": "checkOut", - "thread": "thread2" - }, - { - "name": "waitForEvent", - "event": "ConnectionReady", - "count": 2 - } - ], - "events": [ - { - "type": "ConnectionCreated" - }, - { - "type": "ConnectionReady" - }, - { - "type": "ConnectionCreated" - }, - { - "type": "ConnectionReady" - } - ], - "ignore": [ - "ConnectionCheckOutStarted", - "ConnectionCheckedIn", - "ConnectionCheckedOut", - "ConnectionClosed", - "ConnectionPoolCreated", - "ConnectionPoolReady" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-error-closed.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-error-closed.json deleted file mode 100644 index 614403ef509..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-error-closed.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must throw error if checkOut is called on a closed pool", - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut", - "label": "conn1" - }, - { - "name": "checkIn", - "connection": "conn1" - }, - { - "name": "close" - }, - { - "name": "checkOut" - } - ], - "error": { - "type": "PoolClosedError", - "message": "Attempted to check out a connection from closed connection pool" - }, - "events": [ - { - "type": "ConnectionPoolCreated", - "address": 42, - "options": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "address": 42, - "connectionId": 42, - "duration": 42 - }, - { - "type": "ConnectionCheckedIn", - "address": 42, - "connectionId": 42 - }, - { - "type": "ConnectionPoolClosed", - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckOutFailed", - "address": 42, - "duration": 42, - "reason": "poolClosed" - } - ], - "ignore": [ - "ConnectionPoolReady", - "ConnectionCreated", - "ConnectionReady", - "ConnectionClosed" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-maxConnecting-is-enforced.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-maxConnecting-is-enforced.json deleted file mode 100644 index 3a63818bfe6..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-maxConnecting-is-enforced.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "version": 1, - "style": "integration", - "description": "maxConnecting is enforced", - "runOn": [ - { - "minServerVersion": "4.4.0" - } - ], - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 50 - }, - "data": { - "failCommands": [ - "isMaster", - "hello" - ], - "closeConnection": false, - "blockConnection": true, - "blockTimeMS": 800 - } - }, - "poolOptions": { - "maxPoolSize": 10, - "waitQueueTimeoutMS": 5000 - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "start", - "target": "thread1" - }, - { - "name": "start", - "target": "thread2" - }, - { - "name": "start", - "target": "thread3" - }, - { - "name": "checkOut", - "thread": "thread1" - }, - { - "name": "waitForEvent", - "event": "ConnectionCreated", - "count": 1 - }, - { - "name": "wait", - "ms": 400 - }, - { - "name": "checkOut", - "thread": "thread2" - }, - { - "name": "checkOut", - "thread": "thread3" - }, - { - "name": "waitForEvent", - "event": "ConnectionReady", - "count": 3 - } - ], - "events": [ - { - "type": "ConnectionCreated", - "address": 42, - "connectionId": 1 - }, - { - "type": "ConnectionCreated", - "address": 42 - }, - { - "type": "ConnectionReady", - "address": 42, - "connectionId": 1 - }, - { - "type": "ConnectionCreated", - "address": 42 - }, - { - "type": "ConnectionReady", - "address": 42 - }, - { - "type": "ConnectionReady", - "address": 42 - } - ], - "ignore": [ - "ConnectionCheckOutStarted", - "ConnectionCheckedIn", - "ConnectionCheckedOut", - "ConnectionClosed", - "ConnectionPoolCreated", - "ConnectionPoolReady" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-maxConnecting-timeout.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-maxConnecting-timeout.json deleted file mode 100644 index 4d9fda1a68f..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-maxConnecting-timeout.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "version": 1, - "style": "integration", - "description": "waiting on maxConnecting is limited by WaitQueueTimeoutMS", - "runOn": [ - { - "minServerVersion": "4.4.0" - } - ], - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 50 - }, - "data": { - "failCommands": [ - "isMaster", - "hello" - ], - "closeConnection": false, - "blockConnection": true, - "blockTimeMS": 750 - } - }, - "poolOptions": { - "maxPoolSize": 10, - "waitQueueTimeoutMS": 50 - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "start", - "target": "thread1" - }, - { - "name": "checkOut", - "thread": "thread1" - }, - { - "name": "start", - "target": "thread2" - }, - { - "name": "checkOut", - "thread": "thread2" - }, - { - "name": "waitForEvent", - "event": "ConnectionCreated", - "count": 2 - }, - { - "name": "start", - "target": "thread3" - }, - { - "name": "checkOut", - "thread": "thread3" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckOutFailed", - "count": 1 - }, - { - "name": "waitForThread", - "target": "thread3" - } - ], - "error": { - "type": "WaitQueueTimeoutError", - "message": "Timed out while checking out a connection from connection pool" - }, - "events": [ - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckOutFailed", - "reason": "timeout", - "address": 42, - "duration": 42 - } - ], - "ignore": [ - "ConnectionCreated", - "ConnectionCheckedIn", - "ConnectionCheckedOut", - "ConnectionClosed", - "ConnectionPoolCreated", - "ConnectionPoolReady" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-minPoolSize-connection-maxConnecting.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-minPoolSize-connection-maxConnecting.json deleted file mode 100644 index 3b0d43e8775..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-minPoolSize-connection-maxConnecting.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "version": 1, - "style": "integration", - "description": "threads blocked by maxConnecting check out minPoolSize connections", - "runOn": [ - { - "minServerVersion": "4.4.0" - } - ], - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "isMaster", - "hello" - ], - "closeConnection": false, - "blockConnection": true, - "blockTimeMS": 500 - } - }, - "poolOptions": { - "minPoolSize": 2, - "maxPoolSize": 3, - "waitQueueTimeoutMS": 5000 - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "start", - "target": "thread1" - }, - { - "name": "start", - "target": "thread2" - }, - { - "name": "wait", - "ms": 200 - }, - { - "name": "checkOut", - "thread": "thread1" - }, - { - "name": "waitForEvent", - "event": "ConnectionCreated", - "count": 2 - }, - { - "name": "checkOut", - "thread": "thread2" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckedOut", - "count": 2 - } - ], - "events": [ - { - "type": "ConnectionCreated", - "address": 42 - }, - { - "type": "ConnectionCreated", - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "address": 42 - } - ], - "ignore": [ - "ConnectionPoolReady", - "ConnectionClosed", - "ConnectionReady", - "ConnectionPoolCreated", - "ConnectionCheckOutStarted" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-multiple.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-multiple.json deleted file mode 100644 index 07a4eda6292..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-multiple.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must be able to check out multiple connections at the same time", - "operations": [ - { - "name": "ready" - }, - { - "name": "start", - "target": "thread1" - }, - { - "name": "start", - "target": "thread2" - }, - { - "name": "start", - "target": "thread3" - }, - { - "name": "checkOut", - "thread": "thread1" - }, - { - "name": "checkOut", - "thread": "thread2" - }, - { - "name": "checkOut", - "thread": "thread3" - }, - { - "name": "waitForThread", - "target": "thread1" - }, - { - "name": "waitForThread", - "target": "thread2" - }, - { - "name": "waitForThread", - "target": "thread3" - } - ], - "events": [ - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - } - ], - "ignore": [ - "ConnectionCreated", - "ConnectionPoolReady", - "ConnectionReady", - "ConnectionPoolCreated", - "ConnectionCheckOutStarted" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-no-idle.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-no-idle.json deleted file mode 100644 index 0b0fe572ff5..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-no-idle.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must destroy and must not check out an idle connection if found while iterating available connections", - "poolOptions": { - "maxIdleTimeMS": 10, - "backgroundThreadIntervalMS": -1 - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut", - "label": "conn" - }, - { - "name": "checkIn", - "connection": "conn" - }, - { - "name": "wait", - "ms": 50 - }, - { - "name": "checkOut" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckedOut", - "count": 2 - } - ], - "events": [ - { - "type": "ConnectionPoolCreated", - "address": 42, - "options": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionClosed", - "connectionId": 1, - "reason": "idle", - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 2, - "address": 42 - } - ], - "ignore": [ - "ConnectionReady", - "ConnectionPoolReady", - "ConnectionCreated", - "ConnectionCheckOutStarted" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-no-stale.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-no-stale.json deleted file mode 100644 index ec76f4e9c85..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-no-stale.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must destroy and must not check out a stale connection if found while iterating available connections", - "poolOptions": { - "backgroundThreadIntervalMS": -1 - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut", - "label": "conn" - }, - { - "name": "checkIn", - "connection": "conn" - }, - { - "name": "clear" - }, - { - "name": "ready" - }, - { - "name": "checkOut" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckedOut", - "count": 2 - } - ], - "events": [ - { - "type": "ConnectionPoolCreated", - "address": 42, - "options": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionPoolCleared", - "address": 42 - }, - { - "type": "ConnectionClosed", - "connectionId": 1, - "reason": "stale", - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 2, - "address": 42 - } - ], - "ignore": [ - "ConnectionReady", - "ConnectionPoolReady", - "ConnectionCreated", - "ConnectionCheckOutStarted" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-returned-connection-maxConnecting.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-returned-connection-maxConnecting.json deleted file mode 100644 index 10b526e0c32..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-checkout-returned-connection-maxConnecting.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "version": 1, - "style": "integration", - "description": "threads blocked by maxConnecting check out returned connections", - "runOn": [ - { - "minServerVersion": "4.4.0" - } - ], - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 50 - }, - "data": { - "failCommands": [ - "isMaster", - "hello" - ], - "closeConnection": false, - "blockConnection": true, - "blockTimeMS": 750 - } - }, - "poolOptions": { - "maxConnecting": 2, - "maxPoolSize": 10, - "waitQueueTimeoutMS": 5000 - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut", - "label": "conn0" - }, - { - "name": "start", - "target": "thread1" - }, - { - "name": "checkOut", - "thread": "thread1" - }, - { - "name": "start", - "target": "thread2" - }, - { - "name": "checkOut", - "thread": "thread2" - }, - { - "name": "start", - "target": "thread3" - }, - { - "name": "checkOut", - "thread": "thread3" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckOutStarted", - "count": 4 - }, - { - "name": "wait", - "ms": 100 - }, - { - "name": "checkIn", - "connection": "conn0" - }, - { - "name": "wait", - "ms": 100 - } - ], - "events": [ - { - "type": "ConnectionCreated", - "address": 42, - "connectionId": 1 - }, - { - "type": "ConnectionCheckedOut", - "address": 42 - }, - { - "type": "ConnectionCreated", - "address": 42 - }, - { - "type": "ConnectionCreated", - "address": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 1, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 1, - "address": 42 - } - ], - "ignore": [ - "ConnectionPoolReady", - "ConnectionClosed", - "ConnectionReady", - "ConnectionPoolCreated", - "ConnectionCheckOutStarted" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-clear-clears-waitqueue.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-clear-clears-waitqueue.json deleted file mode 100644 index e6077f12a54..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-clear-clears-waitqueue.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "clearing pool clears the WaitQueue", - "poolOptions": { - "maxPoolSize": 1, - "waitQueueTimeoutMS": 30000 - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut" - }, - { - "name": "start", - "target": "thread1" - }, - { - "name": "checkOut", - "thread": "thread1" - }, - { - "name": "start", - "target": "thread2" - }, - { - "name": "checkOut", - "thread": "thread2" - }, - { - "name": "start", - "target": "thread3" - }, - { - "name": "checkOut", - "thread": "thread3" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckOutStarted", - "count": 4 - }, - { - "name": "clear" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckOutFailed", - "count": 3, - "timeout": 1000 - } - ], - "events": [ - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "address": 42, - "duration": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckOutFailed", - "reason": "connectionError", - "address": 42, - "duration": 42 - }, - { - "type": "ConnectionCheckOutFailed", - "reason": "connectionError", - "address": 42, - "duration": 42 - }, - { - "type": "ConnectionCheckOutFailed", - "reason": "connectionError", - "address": 42, - "duration": 42 - } - ], - "ignore": [ - "ConnectionPoolReady", - "ConnectionPoolCleared", - "ConnectionPoolCreated", - "ConnectionCreated", - "ConnectionReady", - "ConnectionCheckedIn", - "ConnectionClosed" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-clear-min-size.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-clear-min-size.json deleted file mode 100644 index 239df871b8c..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-clear-min-size.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "pool clear halts background minPoolSize establishments", - "poolOptions": { - "minPoolSize": 1, - "backgroundThreadIntervalMS": 50 - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "waitForEvent", - "event": "ConnectionReady", - "count": 1 - }, - { - "name": "clear" - }, - { - "name": "wait", - "ms": 200 - }, - { - "name": "ready" - }, - { - "name": "waitForEvent", - "event": "ConnectionReady", - "count": 2 - } - ], - "events": [ - { - "type": "ConnectionPoolReady", - "address": 42 - }, - { - "type": "ConnectionCreated", - "address": 42 - }, - { - "type": "ConnectionReady", - "address": 42 - }, - { - "type": "ConnectionPoolCleared", - "address": 42 - }, - { - "type": "ConnectionPoolReady", - "address": 42 - }, - { - "type": "ConnectionCreated", - "address": 42 - }, - { - "type": "ConnectionReady", - "address": 42 - } - ], - "ignore": [ - "ConnectionPoolCreated", - "ConnectionClosed" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-clear-paused.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-clear-paused.json deleted file mode 100644 index 847f08d8497..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-clear-paused.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "clearing a paused pool emits no events", - "operations": [ - { - "name": "clear" - }, - { - "name": "ready" - }, - { - "name": "clear" - }, - { - "name": "clear" - } - ], - "events": [ - { - "type": "ConnectionPoolReady", - "address": 42 - }, - { - "type": "ConnectionPoolCleared", - "address": 42 - } - ], - "ignore": [ - "ConnectionPoolCreated" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-clear-ready.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-clear-ready.json deleted file mode 100644 index 88c2988ac5c..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-clear-ready.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "after clear, cannot check out connections until pool ready", - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut" - }, - { - "name": "clear" - }, - { - "name": "start", - "target": "thread1" - }, - { - "name": "checkOut", - "thread": "thread1" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckOutFailed", - "count": 1 - }, - { - "name": "ready" - }, - { - "name": "checkOut" - } - ], - "events": [ - { - "type": "ConnectionPoolReady", - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "address": 42, - "connectionId": 42, - "duration": 42 - }, - { - "type": "ConnectionPoolCleared", - "address": 42 - }, - { - "type": "ConnectionCheckOutFailed", - "address": 42, - "duration": 42, - "reason": "connectionError" - }, - { - "type": "ConnectionPoolReady", - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "address": 42, - "duration": 42 - } - ], - "ignore": [ - "ConnectionPoolCreated", - "ConnectionReady", - "ConnectionCheckOutStarted", - "ConnectionCreated" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-close-destroy-conns.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-close-destroy-conns.json deleted file mode 100644 index a3d58a21362..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-close-destroy-conns.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "When a pool is closed, it MUST first destroy all available connections in that pool", - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut" - }, - { - "name": "checkOut", - "label": "conn" - }, - { - "name": "checkOut" - }, - { - "name": "checkIn", - "connection": "conn" - }, - { - "name": "close" - } - ], - "events": [ - { - "type": "ConnectionCheckedIn", - "connectionId": 2, - "address": 42 - }, - { - "type": "ConnectionClosed", - "connectionId": 2, - "reason": "poolClosed", - "address": 42 - }, - { - "type": "ConnectionPoolClosed", - "address": 42 - } - ], - "ignore": [ - "ConnectionCreated", - "ConnectionPoolReady", - "ConnectionReady", - "ConnectionPoolCreated", - "ConnectionCheckOutStarted", - "ConnectionCheckedOut" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-close.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-close.json deleted file mode 100644 index fe083d73e63..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-close.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must be able to manually close a pool", - "operations": [ - { - "name": "close" - } - ], - "events": [ - { - "type": "ConnectionPoolCreated", - "address": 42, - "options": 42 - }, - { - "type": "ConnectionPoolClosed", - "address": 42 - } - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create-max-size.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create-max-size.json deleted file mode 100644 index e3a1fa8eda4..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create-max-size.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must never exceed maxPoolSize total connections", - "poolOptions": { - "maxPoolSize": 3 - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut", - "label": "conn1" - }, - { - "name": "checkOut" - }, - { - "name": "checkOut", - "label": "conn2" - }, - { - "name": "checkIn", - "connection": "conn2" - }, - { - "name": "checkOut" - }, - { - "name": "start", - "target": "thread1" - }, - { - "name": "checkOut", - "thread": "thread1" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckOutStarted", - "count": 5 - }, - { - "name": "checkIn", - "connection": "conn1" - }, - { - "name": "waitForThread", - "target": "thread1" - } - ], - "events": [ - { - "type": "ConnectionPoolCreated", - "address": 42, - "options": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCreated", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCreated", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCreated", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - } - ], - "ignore": [ - "ConnectionReady", - "ConnectionPoolReady" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create-min-size-error.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create-min-size-error.json deleted file mode 100644 index 1c744b850c3..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create-min-size-error.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "version": 1, - "style": "integration", - "description": "error during minPoolSize population clears pool", - "runOn": [ - { - "minServerVersion": "4.9.0" - } - ], - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 50 - }, - "data": { - "failCommands": [ - "isMaster", - "hello" - ], - "closeConnection": true, - "appName": "poolCreateMinSizeErrorTest" - } - }, - "poolOptions": { - "minPoolSize": 1, - "backgroundThreadIntervalMS": 50, - "appName": "poolCreateMinSizeErrorTest" - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "waitForEvent", - "event": "ConnectionPoolCleared", - "count": 1 - }, - { - "name": "wait", - "ms": 200 - } - ], - "events": [ - { - "type": "ConnectionPoolReady", - "address": 42 - }, - { - "type": "ConnectionCreated", - "address": 42 - }, - { - "type": "ConnectionClosed", - "address": 42, - "connectionId": 42, - "reason": "error" - }, - { - "type": "ConnectionPoolCleared", - "address": 42 - } - ], - "ignore": [ - "ConnectionPoolCreated" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create-min-size.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create-min-size.json deleted file mode 100644 index 43118f7841f..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create-min-size.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must be able to start a pool with minPoolSize connections", - "poolOptions": { - "minPoolSize": 3 - }, - "operations": [ - { - "name": "wait", - "ms": 200 - }, - { - "name": "ready" - }, - { - "name": "waitForEvent", - "event": "ConnectionCreated", - "count": 3 - }, - { - "name": "waitForEvent", - "event": "ConnectionReady", - "count": 3 - }, - { - "name": "checkOut" - } - ], - "events": [ - { - "type": "ConnectionPoolCreated", - "address": 42, - "options": 42 - }, - { - "type": "ConnectionPoolReady", - "address": 42 - }, - { - "type": "ConnectionCreated", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCreated", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCreated", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - } - ], - "ignore": [ - "ConnectionReady", - "ConnectionClosed", - "ConnectionCheckOutStarted" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create-with-options.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create-with-options.json deleted file mode 100644 index 4e8223f91e3..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create-with-options.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must be able to start a pool with various options set", - "poolOptions": { - "maxPoolSize": 50, - "minPoolSize": 5, - "maxIdleTimeMS": 100 - }, - "operations": [ - { - "name": "waitForEvent", - "event": "ConnectionPoolCreated", - "count": 1 - } - ], - "events": [ - { - "type": "ConnectionPoolCreated", - "address": 42, - "options": { - "maxPoolSize": 50, - "minPoolSize": 5, - "maxIdleTimeMS": 100 - } - } - ], - "ignore": [ - "ConnectionCreated", - "ConnectionReady" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create.json deleted file mode 100644 index 8c1f85537f9..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-create.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must be able to create a pool", - "operations": [ - { - "name": "waitForEvent", - "event": "ConnectionPoolCreated", - "count": 1 - } - ], - "events": [ - { - "type": "ConnectionPoolCreated", - "address": 42, - "options": 42 - } - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-ready-ready.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-ready-ready.json deleted file mode 100644 index 25dfa9c97c9..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-ready-ready.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "readying a ready pool emits no events", - "operations": [ - { - "name": "ready" - }, - { - "name": "ready" - }, - { - "name": "ready" - }, - { - "name": "clear" - }, - { - "name": "ready" - } - ], - "events": [ - { - "type": "ConnectionPoolReady", - "address": 42 - }, - { - "type": "ConnectionPoolCleared", - "address": 42 - }, - { - "type": "ConnectionPoolReady", - "address": 42 - } - ], - "ignore": [ - "ConnectionPoolCreated" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-ready.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-ready.json deleted file mode 100644 index a90aed04d04..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/pool-ready.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "pool starts as cleared and becomes ready", - "operations": [ - { - "name": "start", - "target": "thread1" - }, - { - "name": "checkOut", - "thread": "thread1" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckOutFailed", - "count": 1 - }, - { - "name": "ready" - }, - { - "name": "checkOut" - } - ], - "events": [ - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckOutFailed", - "reason": "connectionError", - "address": 42, - "duration": 42 - }, - { - "type": "ConnectionPoolReady", - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCreated", - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "address": 42, - "duration": 42 - } - ], - "ignore": [ - "ConnectionPoolCreated", - "ConnectionReady" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/wait-queue-fairness.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/wait-queue-fairness.json deleted file mode 100644 index 88a67c60ec5..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/wait-queue-fairness.json +++ /dev/null @@ -1,196 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must issue Connections to threads in the order that the threads entered the queue", - "poolOptions": { - "maxPoolSize": 1, - "waitQueueTimeoutMS": 5000 - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut", - "label": "conn0" - }, - { - "name": "start", - "target": "thread1" - }, - { - "name": "checkOut", - "thread": "thread1", - "label": "conn1" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckOutStarted", - "count": 2 - }, - { - "name": "wait", - "ms": 100 - }, - { - "name": "start", - "target": "thread2" - }, - { - "name": "checkOut", - "thread": "thread2", - "label": "conn2" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckOutStarted", - "count": 3 - }, - { - "name": "wait", - "ms": 100 - }, - { - "name": "start", - "target": "thread3" - }, - { - "name": "checkOut", - "thread": "thread3", - "label": "conn3" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckOutStarted", - "count": 4 - }, - { - "name": "wait", - "ms": 100 - }, - { - "name": "start", - "target": "thread4" - }, - { - "name": "checkOut", - "thread": "thread4", - "label": "conn4" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckOutStarted", - "count": 5 - }, - { - "name": "wait", - "ms": 100 - }, - { - "name": "checkIn", - "connection": "conn0" - }, - { - "name": "waitForThread", - "target": "thread1" - }, - { - "name": "checkIn", - "connection": "conn1" - }, - { - "name": "waitForThread", - "target": "thread2" - }, - { - "name": "checkIn", - "connection": "conn2" - }, - { - "name": "waitForThread", - "target": "thread3" - }, - { - "name": "checkIn", - "connection": "conn3" - }, - { - "name": "waitForThread", - "target": "thread4" - } - ], - "events": [ - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 42, - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42 - } - ], - "ignore": [ - "ConnectionCreated", - "ConnectionReady", - "ConnectionClosed", - "ConnectionPoolReady", - "ConnectionPoolCreated" - ] -} diff --git a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/wait-queue-timeout.json b/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/wait-queue-timeout.json deleted file mode 100644 index 8bd7c494991..00000000000 --- a/driver-core/src/test/resources/connection-monitoring-and-pooling/cmap-format/wait-queue-timeout.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "version": 1, - "style": "unit", - "description": "must aggressively timeout threads enqueued longer than waitQueueTimeoutMS", - "poolOptions": { - "maxPoolSize": 1, - "waitQueueTimeoutMS": 50 - }, - "operations": [ - { - "name": "ready" - }, - { - "name": "checkOut", - "label": "conn0" - }, - { - "name": "start", - "target": "thread1" - }, - { - "name": "checkOut", - "thread": "thread1" - }, - { - "name": "waitForEvent", - "event": "ConnectionCheckOutFailed", - "count": 1 - }, - { - "name": "checkIn", - "connection": "conn0" - }, - { - "name": "waitForThread", - "target": "thread1" - } - ], - "error": { - "type": "WaitQueueTimeoutError", - "message": "Timed out while checking out a connection from connection pool" - }, - "events": [ - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckedOut", - "connectionId": 42, - "address": 42, - "duration": 42 - }, - { - "type": "ConnectionCheckOutStarted", - "address": 42 - }, - { - "type": "ConnectionCheckOutFailed", - "reason": "timeout", - "address": 42, - "duration": 42 - }, - { - "type": "ConnectionCheckedIn", - "connectionId": 42, - "address": 42 - } - ], - "ignore": [ - "ConnectionCreated", - "ConnectionReady", - "ConnectionClosed", - "ConnectionPoolCreated", - "ConnectionPoolReady" - ] -} diff --git a/driver-core/src/test/resources/connection-string/invalid-uris.json b/driver-core/src/test/resources/connection-string/invalid-uris.json deleted file mode 100644 index a7accbd27d6..00000000000 --- a/driver-core/src/test/resources/connection-string/invalid-uris.json +++ /dev/null @@ -1,283 +0,0 @@ -{ - "tests": [ - { - "description": "Empty string", - "uri": "", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Invalid scheme", - "uri": "mongo://localhost:27017", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Missing host", - "uri": "mongodb://", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Double colon in host identifier", - "uri": "mongodb://localhost::27017", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Double colon in host identifier and trailing slash", - "uri": "mongodb://localhost::27017/", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Double colon in host identifier with missing host and port", - "uri": "mongodb://::", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Double colon in host identifier with missing port", - "uri": "mongodb://localhost,localhost::", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Double colon in host identifier and second host", - "uri": "mongodb://localhost::27017,abc", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Invalid port (negative number) with hostname", - "uri": "mongodb://localhost:-1", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Invalid port (zero) with hostname", - "uri": "mongodb://localhost:0/", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Invalid port (positive number) with hostname", - "uri": "mongodb://localhost:65536", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Invalid port (positive number) with hostname and trailing slash", - "uri": "mongodb://localhost:65536/", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Invalid port (non-numeric string) with hostname", - "uri": "mongodb://localhost:foo", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Invalid port (negative number) with IP literal", - "uri": "mongodb://[::1]:-1", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Invalid port (zero) with IP literal", - "uri": "mongodb://[::1]:0/", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Invalid port (positive number) with IP literal", - "uri": "mongodb://[::1]:65536", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Invalid port (positive number) with IP literal and trailing slash", - "uri": "mongodb://[::1]:65536/", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Invalid port (non-numeric string) with IP literal", - "uri": "mongodb://[::1]:foo", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Incomplete key value pair for option", - "uri": "mongodb://example.com/?w", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Username with password containing an unescaped colon", - "uri": "mongodb://alice:foo:bar@127.0.0.1", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Username containing an unescaped at-sign", - "uri": "mongodb://alice@@127.0.0.1", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Username with password containing an unescaped at-sign", - "uri": "mongodb://alice@foo:bar@127.0.0.1", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Username containing an unescaped slash", - "uri": "mongodb://alice/@localhost/db", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Username containing unescaped slash with password", - "uri": "mongodb://alice/bob:foo@localhost/db", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Username with password containing an unescaped slash", - "uri": "mongodb://alice:foo/bar@localhost/db", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Host with unescaped slash", - "uri": "mongodb:///tmp/mongodb-27017.sock/", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "mongodb+srv with multiple service names", - "uri": "mongodb+srv://test5.test.mongodb.com,test6.test.mongodb.com", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "mongodb+srv with port number", - "uri": "mongodb+srv://test7.test.mongodb.com:27018", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Username with password containing an unescaped percent sign", - "uri": "mongodb://alice%foo:bar@127.0.0.1", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Username with password containing an unescaped percent sign and an escaped one", - "uri": "mongodb://user%20%:password@localhost", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - }, - { - "description": "Username with password containing an unescaped percent sign (non hex digit)", - "uri": "mongodb://user%w:password@localhost", - "valid": false, - "warning": null, - "hosts": null, - "auth": null, - "options": null - } - ] -} diff --git a/driver-core/src/test/resources/connection-string/valid-auth.json b/driver-core/src/test/resources/connection-string/valid-auth.json deleted file mode 100644 index 176a54a096a..00000000000 --- a/driver-core/src/test/resources/connection-string/valid-auth.json +++ /dev/null @@ -1,333 +0,0 @@ -{ - "tests": [ - { - "description": "User info for single IPv4 host without database", - "uri": "mongodb://alice:foo@127.0.0.1", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": null - } - ], - "auth": { - "username": "alice", - "password": "foo", - "db": null - }, - "options": null - }, - { - "description": "User info for single IPv4 host with database", - "uri": "mongodb://alice:foo@127.0.0.1/test", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": null - } - ], - "auth": { - "username": "alice", - "password": "foo", - "db": "test" - }, - "options": null - }, - { - "description": "User info for single IP literal host without database", - "uri": "mongodb://bob:bar@[::1]:27018", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ip_literal", - "host": "::1", - "port": 27018 - } - ], - "auth": { - "username": "bob", - "password": "bar", - "db": null - }, - "options": null - }, - { - "description": "User info for single IP literal host with database", - "uri": "mongodb://bob:bar@[::1]:27018/admin", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ip_literal", - "host": "::1", - "port": 27018 - } - ], - "auth": { - "username": "bob", - "password": "bar", - "db": "admin" - }, - "options": null - }, - { - "description": "User info for single hostname without database", - "uri": "mongodb://eve:baz@example.com", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - } - ], - "auth": { - "username": "eve", - "password": "baz", - "db": null - }, - "options": null - }, - { - "description": "User info for single hostname with database", - "uri": "mongodb://eve:baz@example.com/db2", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - } - ], - "auth": { - "username": "eve", - "password": "baz", - "db": "db2" - }, - "options": null - }, - { - "description": "User info for multiple hosts without database", - "uri": "mongodb://alice:secret@127.0.0.1,example.com:27018", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": null - }, - { - "type": "hostname", - "host": "example.com", - "port": 27018 - } - ], - "auth": { - "username": "alice", - "password": "secret", - "db": null - }, - "options": null - }, - { - "description": "User info for multiple hosts with database", - "uri": "mongodb://alice:secret@example.com,[::1]:27019/admin", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - }, - { - "type": "ip_literal", - "host": "::1", - "port": 27019 - } - ], - "auth": { - "username": "alice", - "password": "secret", - "db": "admin" - }, - "options": null - }, - { - "description": "Username without password", - "uri": "mongodb://alice@127.0.0.1", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": null - } - ], - "auth": { - "username": "alice", - "password": null, - "db": null - }, - "options": null - }, - { - "description": "Username with empty password", - "uri": "mongodb://alice:@127.0.0.1", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": null - } - ], - "auth": { - "username": "alice", - "password": "", - "db": null - }, - "options": null - }, - { - "description": "Escaped username and database without password", - "uri": "mongodb://%40l%3Ace%2F%3D@example.com/my%3Ddb", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - } - ], - "auth": { - "username": "@l:ce/=", - "password": null, - "db": "my=db" - }, - "options": null - }, - { - "description": "Escaped user info and database (MONGODB-CR)", - "uri": "mongodb://%24am:f%3Azzb%40z%2Fz%3D@127.0.0.1/admin%3F?authMechanism=MONGODB-CR", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": null - } - ], - "auth": { - "username": "$am", - "password": "f:zzb@z/z=", - "db": "admin?" - }, - "options": { - "authmechanism": "MONGODB-CR" - } - }, - { - "description": "Subdelimiters in user/pass don't need escaping (MONGODB-CR)", - "uri": "mongodb://!$&'()*+,;=:!$&'()*+,;=@127.0.0.1/admin?authMechanism=MONGODB-CR", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": null - } - ], - "auth": { - "username": "!$&'()*+,;=", - "password": "!$&'()*+,;=", - "db": "admin" - }, - "options": { - "authmechanism": "MONGODB-CR" - } - }, - { - "description": "Escaped username (MONGODB-X509)", - "uri": "mongodb://CN%3DmyName%2COU%3DmyOrgUnit%2CO%3DmyOrg%2CL%3DmyLocality%2CST%3DmyState%2CC%3DmyCountry@localhost/?authMechanism=MONGODB-X509", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "localhost", - "port": null - } - ], - "auth": { - "username": "CN=myName,OU=myOrgUnit,O=myOrg,L=myLocality,ST=myState,C=myCountry", - "password": null, - "db": null - }, - "options": { - "authmechanism": "MONGODB-X509" - } - }, - { - "description": "Escaped username (GSSAPI)", - "uri": "mongodb://user%40EXAMPLE.COM:secret@localhost/?authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:forward,SERVICE_HOST:example.com&authMechanism=GSSAPI", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "localhost", - "port": null - } - ], - "auth": { - "username": "user@EXAMPLE.COM", - "password": "secret", - "db": null - }, - "options": { - "authmechanism": "GSSAPI", - "authmechanismproperties": { - "SERVICE_NAME": "other", - "SERVICE_HOST": "example.com", - "CANONICALIZE_HOST_NAME": "forward" - } - } - }, - { - "description": "At-signs in options aren't part of the userinfo", - "uri": "mongodb://alice:secret@example.com/admin?replicaset=my@replicaset", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - } - ], - "auth": { - "username": "alice", - "password": "secret", - "db": "admin" - }, - "options": { - "replicaset": "my@replicaset" - } - } - ] -} diff --git a/driver-core/src/test/resources/connection-string/valid-db-with-dotted-name.json b/driver-core/src/test/resources/connection-string/valid-db-with-dotted-name.json deleted file mode 100644 index 5b5aaa5ee3b..00000000000 --- a/driver-core/src/test/resources/connection-string/valid-db-with-dotted-name.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "tests": [ - { - "description": "Multiple Unix domain sockets and auth DB resembling a socket (relative path)", - "uri": "mongodb://rel%2Fmongodb-27017.sock,rel%2Fmongodb-27018.sock/admin.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "rel/mongodb-27018.sock", - "port": null - } - ], - "auth": { - "username": null, - "password": null, - "db": "admin.sock" - }, - "options": null - }, - { - "description": "Multiple Unix domain sockets with auth DB resembling a path (relative path)", - "uri": "mongodb://rel%2Fmongodb-27017.sock,rel%2Fmongodb-27018.sock/admin.shoe", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "rel/mongodb-27018.sock", - "port": null - } - ], - "auth": { - "username": null, - "password": null, - "db": "admin.shoe" - }, - "options": null - }, - { - "description": "Multiple Unix domain sockets and auth DB resembling a socket (absolute path)", - "uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock/admin.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "/tmp/mongodb-27018.sock", - "port": null - } - ], - "auth": { - "username": null, - "password": null, - "db": "admin.sock" - }, - "options": null - }, - { - "description": "Multiple Unix domain sockets with auth DB resembling a path (absolute path)", - "uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock/admin.shoe", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "/tmp/mongodb-27018.sock", - "port": null - } - ], - "auth": { - "username": null, - "password": null, - "db": "admin.shoe" - }, - "options": null - } - ] -} diff --git a/driver-core/src/test/resources/connection-string/valid-host_identifiers.json b/driver-core/src/test/resources/connection-string/valid-host_identifiers.json deleted file mode 100644 index e8833b4af29..00000000000 --- a/driver-core/src/test/resources/connection-string/valid-host_identifiers.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "tests": [ - { - "description": "Single IPv4 host without port", - "uri": "mongodb://127.0.0.1", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Single IPv4 host with port", - "uri": "mongodb://127.0.0.1:27018", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": 27018 - } - ], - "auth": null, - "options": null - }, - { - "description": "Single IP literal host without port", - "uri": "mongodb://[::1]", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ip_literal", - "host": "::1", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Single IP literal host with port", - "uri": "mongodb://[::1]:27019", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ip_literal", - "host": "::1", - "port": 27019 - } - ], - "auth": null, - "options": null - }, - { - "description": "Single hostname without port", - "uri": "mongodb://example.com", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Single hostname with port", - "uri": "mongodb://example.com:27020", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": 27020 - } - ], - "auth": null, - "options": null - }, - { - "description": "Single hostname (resembling IPv4) without port", - "uri": "mongodb://256.0.0.1", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "256.0.0.1", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Multiple hosts (mixed formats)", - "uri": "mongodb://127.0.0.1,[::1]:27018,example.com:27019", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": null - }, - { - "type": "ip_literal", - "host": "::1", - "port": 27018 - }, - { - "type": "hostname", - "host": "example.com", - "port": 27019 - } - ], - "auth": null, - "options": null - }, - { - "description": "UTF-8 hosts", - "uri": "mongodb://bücher.example.com,umläut.example.com/", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "bücher.example.com", - "port": null - }, - { - "type": "hostname", - "host": "umläut.example.com", - "port": null - } - ], - "auth": null, - "options": null - } - ] -} diff --git a/driver-core/src/test/resources/connection-string/valid-options.json b/driver-core/src/test/resources/connection-string/valid-options.json deleted file mode 100644 index 3c79fe7ae55..00000000000 --- a/driver-core/src/test/resources/connection-string/valid-options.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "tests": [ - { - "description": "Option names are normalized to lowercase", - "uri": "mongodb://alice:secret@example.com/admin?AUTHMechanism=MONGODB-CR", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - } - ], - "auth": { - "username": "alice", - "password": "secret", - "db": "admin" - }, - "options": { - "authmechanism": "MONGODB-CR" - } - }, - { - "description": "Missing delimiting slash between hosts and options", - "uri": "mongodb://example.com?tls=true", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - } - ], - "auth": null, - "options": { - "tls": true - } - }, - { - "description": "Colon in a key value pair", - "uri": "mongodb://example.com/?authMechanism=MONGODB-OIDC&authMechanismProperties=TOKEN_RESOURCE:mongodb://test-cluster", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - } - ], - "auth": null, - "options": { - "authmechanismProperties": { - "TOKEN_RESOURCE": "mongodb://test-cluster" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/connection-string/valid-unix_socket-absolute.json b/driver-core/src/test/resources/connection-string/valid-unix_socket-absolute.json deleted file mode 100644 index 66491db13ba..00000000000 --- a/driver-core/src/test/resources/connection-string/valid-unix_socket-absolute.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "tests": [ - { - "description": "Unix domain socket (absolute path with trailing slash)", - "uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock/", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/mongodb-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unix domain socket (absolute path without trailing slash)", - "uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/mongodb-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unix domain socket (mixed case)", - "uri": "mongodb://%2Ftmp%2FMongoDB-27017.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/MongoDB-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unix domain socket (absolute path with spaces in path)", - "uri": "mongodb://%2Ftmp%2F %2Fmongodb-27017.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/ /mongodb-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Multiple Unix domain sockets (absolute paths)", - "uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "/tmp/mongodb-27018.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Multiple hosts (absolute path and ipv4)", - "uri": "mongodb://127.0.0.1:27017,%2Ftmp%2Fmongodb-27017.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": 27017 - }, - { - "type": "unix", - "host": "/tmp/mongodb-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Multiple hosts (absolute path and hostname resembling relative path)", - "uri": "mongodb://mongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "/tmp/mongodb-27018.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unix domain socket with auth database (absolute path)", - "uri": "mongodb://alice:foo@%2Ftmp%2Fmongodb-27017.sock/admin", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/mongodb-27017.sock", - "port": null - } - ], - "auth": { - "username": "alice", - "password": "foo", - "db": "admin" - }, - "options": null - }, - { - "description": "Unix domain socket with path resembling socket file (absolute path with trailing slash)", - "uri": "mongodb://%2Ftmp%2Fpath.to.sock%2Fmongodb-27017.sock/", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/path.to.sock/mongodb-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unix domain socket with path resembling socket file (absolute path without trailing slash)", - "uri": "mongodb://%2Ftmp%2Fpath.to.sock%2Fmongodb-27017.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/path.to.sock/mongodb-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unix domain socket with path resembling socket file and auth (absolute path)", - "uri": "mongodb://bob:bar@%2Ftmp%2Fpath.to.sock%2Fmongodb-27017.sock/admin", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/path.to.sock/mongodb-27017.sock", - "port": null - } - ], - "auth": { - "username": "bob", - "password": "bar", - "db": "admin" - }, - "options": null - }, - { - "description": "Multiple Unix domain sockets and auth DB (absolute path)", - "uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock/admin", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "/tmp/mongodb-27018.sock", - "port": null - } - ], - "auth": { - "username": null, - "password": null, - "db": "admin" - }, - "options": null - }, - { - "description": "Multiple Unix domain sockets with auth DB (absolute path)", - "uri": "mongodb://%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock/admin", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "/tmp/mongodb-27018.sock", - "port": null - } - ], - "auth": { - "username": null, - "password": null, - "db": "admin" - }, - "options": null - }, - { - "description": "Multiple Unix domain sockets with auth and query string (absolute path)", - "uri": "mongodb://bob:bar@%2Ftmp%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock/admin?w=1", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "/tmp/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "/tmp/mongodb-27018.sock", - "port": null - } - ], - "auth": { - "username": "bob", - "password": "bar", - "db": "admin" - }, - "options": { - "w": 1 - } - } - ] -} diff --git a/driver-core/src/test/resources/connection-string/valid-unix_socket-relative.json b/driver-core/src/test/resources/connection-string/valid-unix_socket-relative.json deleted file mode 100644 index 788720920ba..00000000000 --- a/driver-core/src/test/resources/connection-string/valid-unix_socket-relative.json +++ /dev/null @@ -1,286 +0,0 @@ -{ - "tests": [ - { - "description": "Unix domain socket (relative path with trailing slash)", - "uri": "mongodb://rel%2Fmongodb-27017.sock/", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/mongodb-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unix domain socket (relative path without trailing slash)", - "uri": "mongodb://rel%2Fmongodb-27017.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/mongodb-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unix domain socket (mixed case)", - "uri": "mongodb://rel%2FMongoDB-27017.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/MongoDB-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unix domain socket (relative path with spaces)", - "uri": "mongodb://rel%2F %2Fmongodb-27017.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/ /mongodb-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Multiple Unix domain sockets (relative paths)", - "uri": "mongodb://rel%2Fmongodb-27017.sock,rel%2Fmongodb-27018.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "rel/mongodb-27018.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Multiple Unix domain sockets (relative and absolute paths)", - "uri": "mongodb://rel%2Fmongodb-27017.sock,%2Ftmp%2Fmongodb-27018.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "/tmp/mongodb-27018.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Multiple hosts (relative path and ipv4)", - "uri": "mongodb://127.0.0.1:27017,rel%2Fmongodb-27017.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "ipv4", - "host": "127.0.0.1", - "port": 27017 - }, - { - "type": "unix", - "host": "rel/mongodb-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Multiple hosts (relative path and hostname resembling relative path)", - "uri": "mongodb://mongodb-27017.sock,rel%2Fmongodb-27018.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "hostname", - "host": "mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "rel/mongodb-27018.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unix domain socket with auth database (relative path)", - "uri": "mongodb://alice:foo@rel%2Fmongodb-27017.sock/admin", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/mongodb-27017.sock", - "port": null - } - ], - "auth": { - "username": "alice", - "password": "foo", - "db": "admin" - }, - "options": null - }, - { - "description": "Unix domain socket with path resembling socket file (relative path with trailing slash)", - "uri": "mongodb://rel%2Fpath.to.sock%2Fmongodb-27017.sock/", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/path.to.sock/mongodb-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unix domain socket with path resembling socket file (relative path without trailing slash)", - "uri": "mongodb://rel%2Fpath.to.sock%2Fmongodb-27017.sock", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/path.to.sock/mongodb-27017.sock", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unix domain socket with path resembling socket file and auth (relative path)", - "uri": "mongodb://bob:bar@rel%2Fpath.to.sock%2Fmongodb-27017.sock/admin", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/path.to.sock/mongodb-27017.sock", - "port": null - } - ], - "auth": { - "username": "bob", - "password": "bar", - "db": "admin" - }, - "options": null - }, - { - "description": "Multiple Unix domain sockets and auth DB resembling a socket (relative path)", - "uri": "mongodb://rel%2Fmongodb-27017.sock,rel%2Fmongodb-27018.sock/admin", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "rel/mongodb-27018.sock", - "port": null - } - ], - "auth": { - "username": null, - "password": null, - "db": "admin" - }, - "options": null - }, - { - "description": "Multiple Unix domain sockets with auth DB resembling a path (relative path)", - "uri": "mongodb://rel%2Fmongodb-27017.sock,rel%2Fmongodb-27018.sock/admin", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "rel/mongodb-27018.sock", - "port": null - } - ], - "auth": { - "username": null, - "password": null, - "db": "admin" - }, - "options": null - }, - { - "description": "Multiple Unix domain sockets with auth and query string (relative path)", - "uri": "mongodb://bob:bar@rel%2Fmongodb-27017.sock,rel%2Fmongodb-27018.sock/admin?w=1", - "valid": true, - "warning": false, - "hosts": [ - { - "type": "unix", - "host": "rel/mongodb-27017.sock", - "port": null - }, - { - "type": "unix", - "host": "rel/mongodb-27018.sock", - "port": null - } - ], - "auth": { - "username": "bob", - "password": "bar", - "db": "admin" - }, - "options": { - "w": 1 - } - } - ] -} diff --git a/driver-core/src/test/resources/connection-string/valid-warnings.json b/driver-core/src/test/resources/connection-string/valid-warnings.json deleted file mode 100644 index f0e8288bc73..00000000000 --- a/driver-core/src/test/resources/connection-string/valid-warnings.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "tests": [ - { - "description": "Unrecognized option keys are ignored", - "uri": "mongodb://example.com/?foo=bar", - "valid": true, - "warning": true, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Unsupported option values are ignored", - "uri": "mongodb://example.com/?fsync=ifPossible", - "valid": true, - "warning": true, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Repeated option keys", - "uri": "mongodb://example.com/?replicaSet=test&replicaSet=test", - "valid": true, - "warning": true, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - } - ], - "auth": null, - "options": { - "replicaset": "test" - } - }, - { - "description": "Deprecated (or unknown) options are ignored if replacement exists", - "uri": "mongodb://example.com/?wtimeout=5&wtimeoutMS=10", - "valid": true, - "warning": true, - "hosts": [ - { - "type": "hostname", - "host": "example.com", - "port": null - } - ], - "auth": null, - "options": { - "wtimeoutms": 10 - } - }, - { - "description": "Empty integer option values are ignored", - "uri": "mongodb://localhost/?maxIdleTimeMS=", - "valid": true, - "warning": true, - "hosts": [ - { - "type": "hostname", - "host": "localhost", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Empty boolean option value are ignored", - "uri": "mongodb://localhost/?journal=", - "valid": true, - "warning": true, - "hosts": [ - { - "type": "hostname", - "host": "localhost", - "port": null - } - ], - "auth": null, - "options": null - }, - { - "description": "Comma in a key value pair causes a warning", - "uri": "mongodb://localhost?authMechanism=MONGODB-OIDC&authMechanismProperties=TOKEN_RESOURCE:mongodb://host1%2Chost2", - "valid": true, - "warning": true, - "hosts": [ - { - "type": "hostname", - "host": "localhost", - "port": null - } - ], - "auth": null, - "options": null - } - ] -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/README.md b/driver-core/src/test/resources/initial-dns-seedlist-discovery/README.md deleted file mode 100644 index 99a1e8e3f06..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/README.md +++ /dev/null @@ -1,182 +0,0 @@ -# Initial DNS Seedlist Discovery tests - -This directory contains platform-independent tests that drivers can use to prove their conformance to the Initial DNS -Seedlist Discovery spec. - -## Prose Tests - -For the following prose tests, it is assumed drivers are be able to stub DNS results to easily test invalid DNS -resolution results. - -### 1. Allow SRVs with fewer than 3 `.` separated parts - -When running validation on an SRV string before DNS resolution, do not throw a error due to number of SRV parts. - -- `mongodb+srv://localhost` -- `mongodb+srv://mongo.local` - -### 2. Throw when return address does not end with SRV domain - -When given a returned address that does NOT end with the original SRV's domain name, throw a runtime error. - -For this test, run each of the following cases: - -- the SRV `mongodb+srv://localhost` resolving to `localhost.mongodb` -- the SRV `mongodb+srv://mongo.local` resolving to `test_1.evil.local` -- the SRV `mongodb+srv://blogs.mongodb.com` resolving to `blogs.evil.com` - -Remember, the domain of an SRV with one or two `.` separated parts is the SRVs entire hostname. - -### 3. Throw when return address is identical to SRV hostname - -When given a returned address that is identical to the SRV hostname and the SRV hostname has fewer than three `.` -separated parts, throw a runtime error. - -For this test, run each of the following cases: - -- the SRV `mongodb+srv://localhost` resolving to `localhost` -- the SRV `mongodb+srv://mongo.local` resolving to `mongo.local` - -### 4. Throw when return address does not contain `.` separating shared part of domain - -When given a returned address that does NOT share the domain name of the SRV record because it's missing a `.`, throw a -runtime error. - -For this test, run each of the following cases: - -- the SRV `mongodb+srv://localhost` resolving to `test_1.cluster_1localhost` -- the SRV `mongodb+srv://mongo.local` resolving to `test_1.my_hostmongo.local` -- the SRV `mongodb+srv://blogs.mongodb.com` resolving to `cluster.testmongodb.com` - -## Test Setup - -The tests in the `replica-set` directory MUST be executed against a three-node replica set on localhost ports 27017, -27018, and 27019 with replica set name `repl0`. - -The tests in the `load-balanced` directory MUST be executed against a load-balanced sharded cluster with the mongos -servers running on localhost ports 27017 and 27018 and `--loadBalancerPort` 27050 and 27051, respectively (corresponding -to the script in -[drivers-evergreen-tools](https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/run-load-balancer.sh)). -The load balancers, shard servers, and config servers may run on any open ports. - -The tests in the `sharded` directory MUST be executed against a sharded cluster with the mongos servers running on -localhost ports 27017 and 27018. Shard servers and config servers may run on any open ports. - -In all cases, the clusters MUST be started with SSL enabled. - -To run the tests that accompany this spec, you need to configure the SRV and TXT records with a real name server. The -following records are required for these tests: - -``` -Record TTL Class Address -localhost.test.build.10gen.cc. 86400 IN A 127.0.0.1 -localhost.sub.test.build.10gen.cc. 86400 IN A 127.0.0.1 - -Record TTL Class Port Target -_mongodb._tcp.test1.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc. -_mongodb._tcp.test1.test.build.10gen.cc. 86400 IN SRV 27018 localhost.test.build.10gen.cc. -_mongodb._tcp.test2.test.build.10gen.cc. 86400 IN SRV 27018 localhost.test.build.10gen.cc. -_mongodb._tcp.test2.test.build.10gen.cc. 86400 IN SRV 27019 localhost.test.build.10gen.cc. -_mongodb._tcp.test3.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc. -_mongodb._tcp.test5.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc. -_mongodb._tcp.test6.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc. -_mongodb._tcp.test7.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc. -_mongodb._tcp.test8.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc. -_mongodb._tcp.test10.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc. -_mongodb._tcp.test11.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc. -_mongodb._tcp.test12.test.build.10gen.cc. 86400 IN SRV 27017 localhost.build.10gen.cc. -_mongodb._tcp.test13.test.build.10gen.cc. 86400 IN SRV 27017 test.build.10gen.cc. -_mongodb._tcp.test14.test.build.10gen.cc. 86400 IN SRV 27017 localhost.not-test.build.10gen.cc. -_mongodb._tcp.test15.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.not-build.10gen.cc. -_mongodb._tcp.test16.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.not-10gen.cc. -_mongodb._tcp.test17.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.not-cc. -_mongodb._tcp.test18.test.build.10gen.cc. 86400 IN SRV 27017 localhost.sub.test.build.10gen.cc. -_mongodb._tcp.test19.test.build.10gen.cc. 86400 IN SRV 27017 localhost.evil.build.10gen.cc. -_mongodb._tcp.test19.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc. -_mongodb._tcp.test20.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc. -_mongodb._tcp.test21.test.build.10gen.cc. 86400 IN SRV 27017 localhost.test.build.10gen.cc. -_customname._tcp.test22.test.build.10gen.cc 86400 IN SRV 27017 localhost.test.build.10gen.cc. -_mongodb._tcp.test23.test.build.10gen.cc. 86400 IN SRV 8000 localhost.test.build.10gen.cc. -_mongodb._tcp.test24.test.build.10gen.cc. 86400 IN SRV 8000 localhost.test.build.10gen.cc. - -Record TTL Class Text -test5.test.build.10gen.cc. 86400 IN TXT "replicaSet=repl0&authSource=thisDB" -test6.test.build.10gen.cc. 86400 IN TXT "replicaSet=repl0" -test6.test.build.10gen.cc. 86400 IN TXT "authSource=otherDB" -test7.test.build.10gen.cc. 86400 IN TXT "ssl=false" -test8.test.build.10gen.cc. 86400 IN TXT "authSource" -test10.test.build.10gen.cc. 86400 IN TXT "socketTimeoutMS=500" -test11.test.build.10gen.cc. 86400 IN TXT "replicaS" "et=rep" "l0" -test20.test.build.10gen.cc. 86400 IN TXT "loadBalanced=true" -test21.test.build.10gen.cc. 86400 IN TXT "loadBalanced=false" -test24.test.build.10gen.cc. 86400 IN TXT "loadBalanced=true" -``` - -Notes: - -- `test4` is omitted deliberately to test what happens with no SRV record. -- `test9` is missing because it was deleted during the development of the tests. -- The missing `test.` sub-domain in the SRV record target for `test12` is deliberate. -- `test22` is used to test a custom service name (`customname`). -- `test23` and `test24` point to port 8000 (HAProxy) and are used for load-balanced tests. - -In our tests we have used `localhost.test.build.10gen.cc` as the domain, and then configured -`localhost.test.build.10gen.cc` to resolve to 127.0.0.1. - -You need to adapt the records shown above to replace `test.build.10gen.cc` with your own domain name, and update the -"uri" field in the YAML or JSON files in this directory with the actual domain. - -## Test Format and Use - -These YAML and JSON files contain the following fields: - -- `uri`: a `mongodb+srv` connection string -- `seeds`: the expected set of initial seeds discovered from the SRV record -- `numSeeds`: the expected number of initial seeds discovered from the SRV record. This is mainly used to test - `srvMaxHosts`, since randomly selected hosts cannot be deterministically asserted. -- `hosts`: the discovered topology's list of hosts once SDAM completes a scan -- `numHosts`: the expected number of hosts discovered once SDAM completes a scan. This is mainly used to test - `srvMaxHosts`, since randomly selected hosts cannot be deterministically asserted. -- `options`: the parsed [URI options](../../uri-options/uri-options.md) as discovered from the - [Connection String](../../connection-string/connection-string-spec.md)'s "Connection Options" component and SRV - resolution (e.g. TXT records, implicit `tls` default). -- `parsed_options`: additional, parsed options from other - [Connection String](../../connection-string/connection-string-spec.md) components. This is mainly used for asserting - `UserInfo` (as `user` and `password`) and `Auth database` (as `auth_database`). -- `error`: indicates that the parsing of the URI, or the resolving or contents of the SRV or TXT records included - errors. -- `comment`: a comment to indicate why a test would fail. -- `ping`: if false, the test runner should not run a "ping" operation. - -For each YAML file: - -- Create a MongoClient initialized with the `mongodb+srv` connection string. -- Run a "ping" operation unless `ping` is false or `error` is true. - -Assertions: - -- If `seeds` is specified, drivers SHOULD verify that the set of hosts in the client's initial seedlist matches the list - in `seeds`. If `numSeeds` is specified, drivers SHOULD verify that the size of that set matches `numSeeds`. - -- If `hosts` is specified, drivers MUST verify that the set of ServerDescriptions in the client's TopologyDescription - eventually matches the list in `hosts`. If `numHosts` is specified, drivers MUST verify that the size of that set - matches `numHosts`. - -- If `options` is specified, drivers MUST verify each of the values under `options` match the MongoClient's parsed value - for that option. There may be other options parsed by the MongoClient as well, which a test does not verify. - -- If `parsed_options` is specified, drivers MUST verify that each of the values under `parsed_options` match the - MongoClient's parsed value for that option. Supported values include, but are not limited to, `user` and `password` - (parsed from `UserInfo`) and `auth_database` (parsed from `Auth database`). - -- If `error` is specified and `true`, drivers MUST verify that initializing the MongoClient throws an error. If `error` - is not specified or is `false`, both initializing the MongoClient and running a ping operation must succeed without - throwing any errors. - -- If `ping` is not specified or `true`, drivers MUST verify that running a "ping" operation using the initialized - MongoClient succeeds. If `ping` is `false`, drivers MUST NOT run a "ping" operation. - - > **Note:** These tests are expected to be run against MongoDB databases with and without authentication enabled. The - > "ping" operation does not require authentication so should succeed with URIs that contain no userinfo (i.e. no - > username and password). Tests with URIs that contain userinfo always set `ping` to `false` because some drivers will - > fail handshake on a connection if userinfo is provided but incorrect. diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-directConnection.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-directConnection.json deleted file mode 100644 index 6135defcdfe..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-directConnection.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "uri" : "mongodb+srv://test24.test.build.10gen.cc/?directConnection=false", - "seeds" : [ - "localhost.test.build.10gen.cc:8000" - ], - "hosts" : [ - "localhost.test.build.10gen.cc:8000" - ], - "options" : { - "loadBalanced" : true, - "ssl" : true, - "directConnection" : false - }, - "ping" : true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-no-results.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-no-results.json deleted file mode 100644 index 7f49416aa3a..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-no-results.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test4.test.build.10gen.cc/?loadBalanced=true", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because no SRV records are present for this URI." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-replicaSet-errors.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-replicaSet-errors.json deleted file mode 100644 index b68fb6741db..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-replicaSet-errors.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri" : "mongodb+srv://test24.test.build.10gen.cc/?replicaSet=replset", - "seeds" : [], - "hosts" : [], - "error" : true, - "comment" : "Should fail because loadBalanced=true is incompatible with replicaSet" -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-true-multiple-hosts.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-true-multiple-hosts.json deleted file mode 100644 index f425c06b305..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-true-multiple-hosts.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/?loadBalanced=true", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because loadBalanced is true but the SRV record resolves to multiple hosts" -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-true-txt.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-true-txt.json deleted file mode 100644 index bdeef6508f7..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/loadBalanced-true-txt.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "uri" : "mongodb+srv://test24.test.build.10gen.cc/", - "seeds" : [ - "localhost.test.build.10gen.cc:8000" - ], - "hosts" : [ - "localhost.test.build.10gen.cc:8000" - ], - "options" : { - "loadBalanced" : true, - "ssl" : true - }, - "ping" : true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/srvMaxHosts-conflicts_with_loadBalanced-true-txt.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/srvMaxHosts-conflicts_with_loadBalanced-true-txt.json deleted file mode 100644 index bec6458f432..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/srvMaxHosts-conflicts_with_loadBalanced-true-txt.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri" : "mongodb+srv://test24.test.build.10gen.cc/?srvMaxHosts=1", - "seeds" : [], - "hosts" : [], - "error" : true, - "comment" : "Should fail because positive integer for srvMaxHosts conflicts with loadBalanced=true (TXT)" -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/srvMaxHosts-conflicts_with_loadBalanced-true.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/srvMaxHosts-conflicts_with_loadBalanced-true.json deleted file mode 100644 index d03a174b1eb..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/srvMaxHosts-conflicts_with_loadBalanced-true.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test3.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=1", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because positive integer for srvMaxHosts conflicts with loadBalanced=true" -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/srvMaxHosts-zero-txt.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/srvMaxHosts-zero-txt.json deleted file mode 100644 index 36399de6a06..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/srvMaxHosts-zero-txt.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "uri" : "mongodb+srv://test24.test.build.10gen.cc/?srvMaxHosts=0", - "seeds" : [ - "localhost.test.build.10gen.cc:8000" - ], - "hosts" : [ - "localhost.test.build.10gen.cc:8000" - ], - "options" : { - "loadBalanced" : true, - "srvMaxHosts" : 0, - "ssl" : true - }, - "ping" : true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/srvMaxHosts-zero.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/srvMaxHosts-zero.json deleted file mode 100644 index f286437c049..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/load-balanced/srvMaxHosts-zero.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "uri" : "mongodb+srv://test23.test.build.10gen.cc/?loadBalanced=true&srvMaxHosts=0", - "seeds" : [ - "localhost.test.build.10gen.cc:8000" - ], - "hosts" : [ - "localhost.test.build.10gen.cc:8000" - ], - "options" : { - "loadBalanced" : true, - "srvMaxHosts" : 0, - "ssl" : true - }, - "ping" : true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/dbname-with-commas-escaped.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/dbname-with-commas-escaped.json deleted file mode 100644 index b5fcfd2c07b..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/dbname-with-commas-escaped.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/some%2Cdb?replicaSet=repl0", - "seeds": [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "ssl": true - }, - "parsed_options": { - "defaultDatabase": "some,db" - } -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/dbname-with-commas.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/dbname-with-commas.json deleted file mode 100644 index c1e85f4b99f..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/dbname-with-commas.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/some,db?replicaSet=repl0", - "seeds": [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "ssl": true - }, - "parsed_options": { - "defaultDatabase": "some,db" - } -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/direct-connection-false.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/direct-connection-false.json deleted file mode 100644 index 3f14ff94e73..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/direct-connection-false.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "uri": "mongodb+srv://test3.test.build.10gen.cc/?directConnection=false", - "seeds": [ - "localhost.test.build.10gen.cc:27017" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "ssl": true, - "directConnection": false - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/direct-connection-true.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/direct-connection-true.json deleted file mode 100644 index ace6700106e..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/direct-connection-true.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test3.test.build.10gen.cc/?directConnection=true", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because directConnection=true is incompatible with SRV URIs." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/encoded-userinfo-and-db.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/encoded-userinfo-and-db.json deleted file mode 100644 index 4493628be95..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/encoded-userinfo-and-db.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "uri": "mongodb+srv://b*b%40f3tt%3D:%244to%40L8%3DMC@test3.test.build.10gen.cc/mydb%3F?replicaSet=repl0", - "seeds": [ - "localhost.test.build.10gen.cc:27017" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "ssl": true - }, - "parsed_options": { - "user": "b*b@f3tt=", - "password": "$4to@L8=MC", - "db": "mydb?" - }, - "ping": false, - "comment": "Encoded user, pass, and DB parse correctly" -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/loadBalanced-false-txt.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/loadBalanced-false-txt.json deleted file mode 100644 index 682d32a7428..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/loadBalanced-false-txt.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "uri": "mongodb+srv://test21.test.build.10gen.cc/", - "seeds": [ - "localhost.test.build.10gen.cc:27017" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "loadBalanced": false, - "ssl": true - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/longer-parent-in-return.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/longer-parent-in-return.json deleted file mode 100644 index ebe3fe1e773..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/longer-parent-in-return.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "uri": "mongodb+srv://test18.test.build.10gen.cc/?replicaSet=repl0", - "seeds": [ - "localhost.sub.test.build.10gen.cc:27017" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "ssl": true - }, - "ping": true, - "comment": "Is correct, as returned host name shared the URI root \"test.build.10gen.cc\"." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/misformatted-option.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/misformatted-option.json deleted file mode 100644 index 3c8c29ace68..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/misformatted-option.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test8.test.build.10gen.cc/", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because the options in the TXT record are incorrectly formatted (misses value)." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/no-results.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/no-results.json deleted file mode 100644 index c1dc02d281d..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/no-results.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test4.test.build.10gen.cc/", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because no SRV records are present for this URI." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/one-result-default-port.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/one-result-default-port.json deleted file mode 100644 index 9f7733de80c..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/one-result-default-port.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "uri": "mongodb+srv://test3.test.build.10gen.cc/?replicaSet=repl0", - "seeds": [ - "localhost.test.build.10gen.cc:27017" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "ssl": true - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/one-txt-record-multiple-strings.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/one-txt-record-multiple-strings.json deleted file mode 100644 index 1d740b1b59c..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/one-txt-record-multiple-strings.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "uri": "mongodb+srv://test11.test.build.10gen.cc/", - "seeds": [ - "localhost.test.build.10gen.cc:27017" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "ssl": true - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/one-txt-record.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/one-txt-record.json deleted file mode 100644 index ecdb0a7e2a1..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/one-txt-record.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "uri": "mongodb+srv://test5.test.build.10gen.cc/", - "seeds": [ - "localhost.test.build.10gen.cc:27017" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "authSource": "thisDB", - "ssl": true - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch1.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch1.json deleted file mode 100644 index 8d0147a48b8..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test14.test.build.10gen.cc/", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because returned host name's part \"not-test\" mismatches URI parent part \"test\"." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch2.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch2.json deleted file mode 100644 index 996249eb99d..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test15.test.build.10gen.cc/", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because returned host name's part \"not-build\" mismatches URI parent part \"build\"." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch3.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch3.json deleted file mode 100644 index 69e724af6c7..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch3.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test16.test.build.10gen.cc/", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because returned host name's part \"not-10gen\" mismatches URI parent part \"10gen\"." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch4.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch4.json deleted file mode 100644 index 254168e34ca..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch4.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test17.test.build.10gen.cc/", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because returned host name's TLD \"not-cc\" mismatches URI TLD \"cc\"." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch5.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch5.json deleted file mode 100644 index 92c024b4f34..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/parent-part-mismatch5.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test19.test.build.10gen.cc/", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because one of the returned host names' domain name parts \"evil\" mismatches \"test\"." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/returned-parent-too-short.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/returned-parent-too-short.json deleted file mode 100644 index 676eb0c0d09..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/returned-parent-too-short.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test13.test.build.10gen.cc/", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because returned host name's parent (build.10gen.cc) misses \"test.\"" -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/returned-parent-wrong.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/returned-parent-wrong.json deleted file mode 100644 index 3aabfd81962..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/returned-parent-wrong.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test12.test.build.10gen.cc/", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because returned host name is too short and mismatches a parent." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srv-service-name.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srv-service-name.json deleted file mode 100644 index e320c2ca3e5..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srv-service-name.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "uri": "mongodb+srv://test22.test.build.10gen.cc/?srvServiceName=customname", - "seeds": [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "ssl": true, - "srvServiceName": "customname" - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-conflicts_with_replicaSet-txt.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-conflicts_with_replicaSet-txt.json deleted file mode 100644 index 6de1e37fa55..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-conflicts_with_replicaSet-txt.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test5.test.build.10gen.cc/?srvMaxHosts=1", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because positive integer for srvMaxHosts conflicts with replicaSet option (TXT)" -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-conflicts_with_replicaSet.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-conflicts_with_replicaSet.json deleted file mode 100644 index f968757502d..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-conflicts_with_replicaSet.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/?replicaSet=repl0&srvMaxHosts=1", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because positive integer for srvMaxHosts conflicts with replicaSet option" -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-equal_to_srv_records.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-equal_to_srv_records.json deleted file mode 100644 index 70edacfd068..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-equal_to_srv_records.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2", - "numSeeds": 2, - "seeds": [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "srvMaxHosts": 2, - "ssl": true - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-greater_than_srv_records.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-greater_than_srv_records.json deleted file mode 100644 index 72540ed408e..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-greater_than_srv_records.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=3", - "seeds": [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "srvMaxHosts": 3, - "ssl": true - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-less_than_srv_records.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-less_than_srv_records.json deleted file mode 100644 index a9d6dd6fd90..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-less_than_srv_records.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=1", - "numSeeds": 1, - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "srvMaxHosts": 1, - "ssl": true - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-zero-txt.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-zero-txt.json deleted file mode 100644 index e232edb9eb1..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-zero-txt.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "uri": "mongodb+srv://test5.test.build.10gen.cc/?srvMaxHosts=0", - "seeds": [ - "localhost.test.build.10gen.cc:27017" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "authSource": "thisDB", - "replicaSet": "repl0", - "srvMaxHosts": 0, - "ssl": true - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-zero.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-zero.json deleted file mode 100644 index 3421a35a3d9..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/srvMaxHosts-zero.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/?replicaSet=repl0&srvMaxHosts=0", - "seeds": [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "srvMaxHosts": 0, - "ssl": true - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/two-results-default-port.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/two-results-default-port.json deleted file mode 100644 index 43efcc63109..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/two-results-default-port.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/?replicaSet=repl0", - "seeds": [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "ssl": true - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/two-results-nonstandard-port.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/two-results-nonstandard-port.json deleted file mode 100644 index f6e8e415a7e..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/two-results-nonstandard-port.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "uri": "mongodb+srv://test2.test.build.10gen.cc/?replicaSet=repl0", - "seeds": [ - "localhost.test.build.10gen.cc:27018", - "localhost.test.build.10gen.cc:27019" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "ssl": true - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/two-txt-records.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/two-txt-records.json deleted file mode 100644 index f0654ef6cb2..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/two-txt-records.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test6.test.build.10gen.cc/", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because there are two TXT records." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/txt-record-not-allowed-option.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/txt-record-not-allowed-option.json deleted file mode 100644 index 2a5cf2f0070..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/txt-record-not-allowed-option.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test10.test.build.10gen.cc/?replicaSet=repl0", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because socketTimeoutMS is not an allowed option." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/txt-record-with-overridden-ssl-option.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/txt-record-with-overridden-ssl-option.json deleted file mode 100644 index 3d84cfe4469..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/txt-record-with-overridden-ssl-option.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "uri": "mongodb+srv://test5.test.build.10gen.cc/?ssl=false", - "seeds": [ - "localhost.test.build.10gen.cc:27017" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "authSource": "thisDB", - "ssl": false - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/txt-record-with-overridden-uri-option.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/txt-record-with-overridden-uri-option.json deleted file mode 100644 index 1a5a2406805..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/txt-record-with-overridden-uri-option.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "uri": "mongodb+srv://test5.test.build.10gen.cc/?authSource=otherDB", - "seeds": [ - "localhost.test.build.10gen.cc:27017" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "authSource": "otherDB", - "ssl": true - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/txt-record-with-unallowed-option.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/txt-record-with-unallowed-option.json deleted file mode 100644 index 0d333a459dd..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/txt-record-with-unallowed-option.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test7.test.build.10gen.cc/", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because \"ssl\" is not an allowed option." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/uri-with-admin-database.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/uri-with-admin-database.json deleted file mode 100644 index c5513a0dadd..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/uri-with-admin-database.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/adminDB?replicaSet=repl0", - "seeds": [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "ssl": true - }, - "parsed_options": { - "auth_database": "adminDB" - }, - "ping": true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/uri-with-auth.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/uri-with-auth.json deleted file mode 100644 index 872f997cc7b..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/uri-with-auth.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "uri": "mongodb+srv://auser:apass@test1.test.build.10gen.cc/?replicaSet=repl0", - "seeds": [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "hosts": [ - "localhost:27017", - "localhost:27018", - "localhost:27019" - ], - "options": { - "replicaSet": "repl0", - "ssl": true - }, - "parsed_options": { - "user": "auser", - "password": "apass" - }, - "ping": false, - "comment": "Should preserve auth credentials" -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/uri-with-port.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/uri-with-port.json deleted file mode 100644 index b981e2a1bfc..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/uri-with-port.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test5.test.build.10gen.cc:8123/?replicaSet=repl0", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because the mongodb+srv URI includes a port." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/uri-with-two-hosts.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/uri-with-two-hosts.json deleted file mode 100644 index 5261a39cfa7..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/replica-set/uri-with-two-hosts.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "uri": "mongodb+srv://test5.test.build.10gen.cc,test6.test.build.10gen.cc/?replicaSet=repl0", - "seeds": [], - "hosts": [], - "error": true, - "comment": "Should fail because the mongodb+srv URI includes two host names." -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/sharded/srvMaxHosts-equal_to_srv_records.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/sharded/srvMaxHosts-equal_to_srv_records.json deleted file mode 100644 index 4d3c6d8a2b4..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/sharded/srvMaxHosts-equal_to_srv_records.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2", - "numSeeds": 2, - "seeds": [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "hosts" : [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "options" : { - "srvMaxHosts" : 2, - "ssl" : true - }, - "ping" : true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/sharded/srvMaxHosts-greater_than_srv_records.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/sharded/srvMaxHosts-greater_than_srv_records.json deleted file mode 100644 index acf35fda5a2..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/sharded/srvMaxHosts-greater_than_srv_records.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=3", - "seeds": [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "hosts" : [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "options" : { - "srvMaxHosts" : 3, - "ssl" : true - }, - "ping" : true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/sharded/srvMaxHosts-less_than_srv_records.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/sharded/srvMaxHosts-less_than_srv_records.json deleted file mode 100644 index 62995464182..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/sharded/srvMaxHosts-less_than_srv_records.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "uri" : "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=1", - "numSeeds" : 1, - "numHosts" : 1, - "options" : { - "srvMaxHosts" : 1, - "ssl" : true - }, - "ping" : true -} diff --git a/driver-core/src/test/resources/initial-dns-seedlist-discovery/sharded/srvMaxHosts-zero.json b/driver-core/src/test/resources/initial-dns-seedlist-discovery/sharded/srvMaxHosts-zero.json deleted file mode 100644 index 06743c819c8..00000000000 --- a/driver-core/src/test/resources/initial-dns-seedlist-discovery/sharded/srvMaxHosts-zero.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=0", - "seeds": [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "hosts" : [ - "localhost.test.build.10gen.cc:27017", - "localhost.test.build.10gen.cc:27018" - ], - "options" : { - "srvMaxHosts" : 0, - "ssl" : true - }, - "ping" : true -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/README.rst b/driver-core/src/test/resources/max-staleness/server_selection/README.rst deleted file mode 100644 index b6d6f2c9781..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/README.rst +++ /dev/null @@ -1,72 +0,0 @@ -=================== -Max Staleness Tests -=================== - -This directory contains platform-independent tests that drivers can use -to prove their conformance to the Max Staleness Spec. The tests -are provided in both YAML and JSON formats, and drivers may test against -whichever format is more convenient for them. - -Test Format and Use -------------------- - -YAML files contain the following setup for each test: - -- ``heartbeatFrequencyMS``: optional int - -- ``topology_description``: the state of a mocked cluster - - - ``type``: the TopologyType - - - ``servers``: a list of ServerDescriptions, each with: - - - ``address``: a "host:port" - - - ``type``: a ServerType - - - ``avg_rtt_ms``: average round trip time in milliseconds [1]_ - - - ``lastWrite``: subdocument - - - ``lastWriteDate``: nonzero int64, milliseconds since some past time - - - ``maxWireVersion``: an int - - - ``lastUpdateTime``: milliseconds since the Unix epoch - -- ``read_preference``: a read preference document - -For each test, create a MongoClient. -Configure it with the heartbeatFrequencyMS specified by the test, -or accept the driver's default heartbeatFrequencyMS if the test omits this field. - -(Single-threaded and multi-threaded clients now make heartbeatFrequencyMS configurable. -This is a change in Server Discovery and Monitoring to support maxStalenessSeconds. -Before, multi-threaded clients were allowed to make it configurable or not.) - -For each test, create a new TopologyDescription object initialized with the -values from ``topology_description``. Initialize ServerDescriptions from the -provided data. Create a ReadPreference object initialized with the values -from ``read_preference``. Select servers that match the ReadPreference. - -Each test specifies that it expects an error, or specifies two sets of servers: - -- ``error: true`` -- ``suitable_servers``: the set of servers in the TopologyDescription - that are suitable for the ReadPreference, without taking ``avg_rtt_ms`` - into account. -- ``in_latency_window``: the set of suitable servers whose round trip time - qualifies them according to the default latency threshold of 15ms. - In each test there is one server in the latency window, to ensure - tests pass or fail deterministically. - -If the file contains ``error: true``, drivers MUST test that they throw an -error during server selection, due to an invalid read preference or -incompatible wire versions. For other files, drivers MUST test that they -correctly select the set of servers in ``in_latency_window``. - -Drivers MAY also test that before filtration by latency, they select the -specified set of "suitable" servers. - -.. [1] ``avg_rtt_ms`` is included merely for consistency with - Server Selection tests. It is not significant in Max Staleness tests. diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/DefaultNoMaxStaleness.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/DefaultNoMaxStaleness.json deleted file mode 100644 index 5afebbbdcb2..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/DefaultNoMaxStaleness.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "Nearest" - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/LastUpdateTime.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/LastUpdateTime.json deleted file mode 100644 index 492d8a2f625..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/LastUpdateTime.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 1, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 25002, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - }, - { - "address": "c:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 25001, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "maxWireVersion": 6 - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 150 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 1, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 25002, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 1, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/MaxStalenessTooSmall.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/MaxStalenessTooSmall.json deleted file mode 100644 index 28e5e2aa4a5..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/MaxStalenessTooSmall.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "Unknown" - }, - { - "address": "b:27017", - "type": "Unknown" - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 1 - }, - "error": true -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/Nearest.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/Nearest.json deleted file mode 100644 index 6602561c1dc..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/Nearest.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - }, - { - "address": "c:27017", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "type": "RSSecondary", - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "maxWireVersion": 6 - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 150 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/Nearest2.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/Nearest2.json deleted file mode 100644 index 16d9a673bd8..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/Nearest2.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - }, - { - "address": "c:27017", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "type": "RSSecondary", - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "maxWireVersion": 6 - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 150 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/NoKnownServers.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/NoKnownServers.json deleted file mode 100644 index 5905fcbc605..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/NoKnownServers.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "Unknown" - }, - { - "address": "b:27017", - "type": "Unknown" - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 90 - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/OneKnownTwoUnavailable.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/OneKnownTwoUnavailable.json deleted file mode 100644 index 54f318872fa..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/OneKnownTwoUnavailable.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "PossiblePrimary", - "avg_rtt_ms": 5, - "maxWireVersion": 0 - }, - { - "address": "b:27017", - "type": "Unknown", - "avg_rtt_ms": 5, - "maxWireVersion": 0 - }, - { - "address": "c:27017", - "type": "RSSecondary", - "maxWireVersion": 6, - "avg_rtt_ms": 5, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 120 - }, - "suitable_servers": [ - { - "address": "c:27017", - "type": "RSSecondary", - "maxWireVersion": 6, - "avg_rtt_ms": 5, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ], - "in_latency_window": [ - { - "address": "c:27017", - "type": "RSSecondary", - "maxWireVersion": 6, - "avg_rtt_ms": 5, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/PrimaryPreferred.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/PrimaryPreferred.json deleted file mode 100644 index 7956b8e516d..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/PrimaryPreferred.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "PrimaryPreferred", - "maxStalenessSeconds": 90 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/PrimaryPreferred_tags.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/PrimaryPreferred_tags.json deleted file mode 100644 index 453dce6605a..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/PrimaryPreferred_tags.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "tokyo" - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "nyc" - } - } - ] - }, - "read_preference": { - "mode": "PrimaryPreferred", - "maxStalenessSeconds": 150, - "tag_sets": [ - { - "data_center": "nyc" - }, - { - "data_center": "tokyo" - } - ] - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "tokyo" - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "tokyo" - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/Secondary.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/Secondary.json deleted file mode 100644 index b383f275dc4..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/Secondary.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "tags": { - "data_center": "tokyo" - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "tags": { - "data_center": "nyc" - } - }, - { - "address": "d:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "tokyo" - } - } - ] - }, - "read_preference": { - "mode": "Secondary", - "maxStalenessSeconds": 150, - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/SecondaryPreferred.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/SecondaryPreferred.json deleted file mode 100644 index 7bce7d0aa42..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/SecondaryPreferred.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "SecondaryPreferred", - "maxStalenessSeconds": 120 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/SecondaryPreferred_tags.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/SecondaryPreferred_tags.json deleted file mode 100644 index 32c9ca770bd..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/SecondaryPreferred_tags.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "tags": { - "data_center": "tokyo" - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "tags": { - "data_center": "nyc" - } - }, - { - "address": "d:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "tokyo" - } - } - ] - }, - "read_preference": { - "mode": "SecondaryPreferred", - "maxStalenessSeconds": 150, - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/ZeroMaxStaleness.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/ZeroMaxStaleness.json deleted file mode 100644 index fd84cd11931..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetNoPrimary/ZeroMaxStaleness.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 0 - }, - "error": true -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/DefaultNoMaxStaleness.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/DefaultNoMaxStaleness.json deleted file mode 100644 index 35eaa9d69d6..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/DefaultNoMaxStaleness.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "Nearest" - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/LastUpdateTime.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/LastUpdateTime.json deleted file mode 100644 index 18450beaedd..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/LastUpdateTime.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 50, - "lastUpdateTime": 1, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 125001, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - }, - { - "address": "c:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 125001, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "maxWireVersion": 6 - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 150 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 50, - "lastUpdateTime": 1, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 125001, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 125001, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/LongHeartbeat.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/LongHeartbeat.json deleted file mode 100644 index b9fb407f9e8..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/LongHeartbeat.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "heartbeatFrequencyMS": 120000, - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 130 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/LongHeartbeat2.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/LongHeartbeat2.json deleted file mode 100644 index b695e1caeb2..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/LongHeartbeat2.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "heartbeatFrequencyMS": 120000, - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 129 - }, - "error": true -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/MaxStalenessTooSmall.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/MaxStalenessTooSmall.json deleted file mode 100644 index 9b798d37da1..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/MaxStalenessTooSmall.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "heartbeatFrequencyMS": 500, - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 89 - }, - "error": true -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/MaxStalenessWithModePrimary.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/MaxStalenessWithModePrimary.json deleted file mode 100644 index 1fa7bb4dd06..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/MaxStalenessWithModePrimary.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "maxStalenessSeconds": 120 - }, - "error": true -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Nearest.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Nearest.json deleted file mode 100644 index 198be4a681d..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Nearest.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - }, - { - "address": "c:27017", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "type": "RSSecondary", - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "maxWireVersion": 6 - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 150 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Nearest2.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Nearest2.json deleted file mode 100644 index 3ae629c898b..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Nearest2.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - }, - { - "address": "c:27017", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "type": "RSSecondary", - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "maxWireVersion": 6 - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 150 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6 - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Nearest_tags.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Nearest_tags.json deleted file mode 100644 index 675df82631b..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Nearest_tags.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "tokyo" - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "nyc" - } - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 150, - "tag_sets": [ - { - "data_center": "nyc" - }, - { - "data_center": "tokyo" - } - ] - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "tokyo" - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "tokyo" - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/PrimaryPreferred.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/PrimaryPreferred.json deleted file mode 100644 index 795b47a1115..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/PrimaryPreferred.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "PrimaryPreferred", - "maxStalenessSeconds": 150 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/PrimaryPreferred_incompatible.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/PrimaryPreferred_incompatible.json deleted file mode 100644 index a6681f6a130..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/PrimaryPreferred_incompatible.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 5, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 4, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "PrimaryPreferred", - "maxStalenessSeconds": 150 - }, - "error": true -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/SecondaryPreferred.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/SecondaryPreferred.json deleted file mode 100644 index 5455708a70b..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/SecondaryPreferred.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "SecondaryPreferred", - "maxStalenessSeconds": 120 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/SecondaryPreferred_tags.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/SecondaryPreferred_tags.json deleted file mode 100644 index 6670b54c892..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/SecondaryPreferred_tags.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 1, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - }, - "tags": { - "data_center": "nyc" - } - }, - { - "address": "d:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "tags": { - "data_center": "nyc" - } - }, - { - "address": "e:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "tokyo" - } - } - ] - }, - "read_preference": { - "mode": "SecondaryPreferred", - "maxStalenessSeconds": 150, - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 1, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - }, - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/SecondaryPreferred_tags2.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/SecondaryPreferred_tags2.json deleted file mode 100644 index 642fee1fb30..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/SecondaryPreferred_tags2.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "tokyo" - } - }, - { - "address": "c:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "nyc" - } - } - ] - }, - "read_preference": { - "mode": "SecondaryPreferred", - "maxStalenessSeconds": 150, - "tag_sets": [ - { - "data_center": "nyc" - }, - { - "data_center": "tokyo" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "tokyo" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "tokyo" - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Secondary_tags.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Secondary_tags.json deleted file mode 100644 index 502120dce67..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Secondary_tags.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 1, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - }, - "tags": { - "data_center": "nyc" - } - }, - { - "address": "d:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "tags": { - "data_center": "nyc" - } - }, - { - "address": "e:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "tokyo" - } - } - ] - }, - "read_preference": { - "mode": "Secondary", - "maxStalenessSeconds": 150, - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "type": "RSSecondary", - "avg_rtt_ms": 50, - "lastUpdateTime": 1, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1000001" - } - }, - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Secondary_tags2.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Secondary_tags2.json deleted file mode 100644 index 6978a1807b8..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/Secondary_tags2.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "heartbeatFrequencyMS": 25000, - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "125002" - } - }, - "maxWireVersion": 6 - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "tokyo" - } - }, - { - "address": "c:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "nyc" - } - } - ] - }, - "read_preference": { - "mode": "Secondary", - "maxStalenessSeconds": 150, - "tag_sets": [ - { - "data_center": "nyc" - }, - { - "data_center": "tokyo" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "tokyo" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - }, - "maxWireVersion": 6, - "tags": { - "data_center": "tokyo" - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/ZeroMaxStaleness.json b/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/ZeroMaxStaleness.json deleted file mode 100644 index e1e4a7ffb73..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/ReplicaSetWithPrimary/ZeroMaxStaleness.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "type": "RSPrimary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "2" - } - } - }, - { - "address": "b:27017", - "type": "RSSecondary", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 0 - }, - "error": true -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/Sharded/SmallMaxStaleness.json b/driver-core/src/test/resources/max-staleness/server_selection/Sharded/SmallMaxStaleness.json deleted file mode 100644 index 91d89720d10..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/Sharded/SmallMaxStaleness.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "heartbeatFrequencyMS": 10000, - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "a:27017", - "type": "Mongos", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - }, - { - "address": "b:27017", - "type": "Mongos", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 1 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "Mongos", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - }, - { - "address": "b:27017", - "type": "Mongos", - "avg_rtt_ms": 50, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "type": "Mongos", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/Single/SmallMaxStaleness.json b/driver-core/src/test/resources/max-staleness/server_selection/Single/SmallMaxStaleness.json deleted file mode 100644 index b8d2db24be7..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/Single/SmallMaxStaleness.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "heartbeatFrequencyMS": 10000, - "topology_description": { - "type": "Single", - "servers": [ - { - "address": "a:27017", - "type": "Standalone", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 1 - }, - "suitable_servers": [ - { - "address": "a:27017", - "type": "Standalone", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "type": "Standalone", - "avg_rtt_ms": 5, - "lastUpdateTime": 0, - "maxWireVersion": 6, - "lastWrite": { - "lastWriteDate": { - "$numberLong": "1" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/max-staleness/server_selection/Unknown/SmallMaxStaleness.json b/driver-core/src/test/resources/max-staleness/server_selection/Unknown/SmallMaxStaleness.json deleted file mode 100644 index 8d69f46a1ea..00000000000 --- a/driver-core/src/test/resources/max-staleness/server_selection/Unknown/SmallMaxStaleness.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "heartbeatFrequencyMS": 10000, - "topology_description": { - "type": "Unknown", - "servers": [ - { - "address": "a:27017", - "type": "Unknown", - "maxWireVersion": 6 - } - ] - }, - "read_preference": { - "mode": "Nearest", - "maxStalenessSeconds": 1 - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/read-concern/connection-string/read-concern.json b/driver-core/src/test/resources/read-concern/connection-string/read-concern.json deleted file mode 100644 index 1ecad8c268d..00000000000 --- a/driver-core/src/test/resources/read-concern/connection-string/read-concern.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "tests": [ - { - "description": "Default", - "uri": "mongodb://localhost/", - "valid": true, - "warning": false, - "readConcern": {} - }, - { - "description": "local specified", - "uri": "mongodb://localhost/?readConcernLevel=local", - "valid": true, - "warning": false, - "readConcern": { - "level": "local" - } - }, - { - "description": "majority specified", - "uri": "mongodb://localhost/?readConcernLevel=majority", - "valid": true, - "warning": false, - "readConcern": { - "level": "majority" - } - }, - { - "description": "linearizable specified", - "uri": "mongodb://localhost/?readConcernLevel=linearizable", - "valid": true, - "warning": false, - "readConcern": { - "level": "linearizable" - } - }, - { - "description": "available specified", - "uri": "mongodb://localhost/?readConcernLevel=available", - "valid": true, - "warning": false, - "readConcern": { - "level": "available" - } - } - ] -} diff --git a/driver-core/src/test/resources/read-concern/document/read-concern.json b/driver-core/src/test/resources/read-concern/document/read-concern.json deleted file mode 100644 index 187397dae57..00000000000 --- a/driver-core/src/test/resources/read-concern/document/read-concern.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "tests": [ - { - "description": "Default", - "valid": true, - "readConcern": {}, - "readConcernDocument": {}, - "isServerDefault": true - }, - { - "description": "Majority", - "valid": true, - "readConcern": { - "level": "majority" - }, - "readConcernDocument": { - "level": "majority" - }, - "isServerDefault": false - }, - { - "description": "Local", - "valid": true, - "readConcern": { - "level": "local" - }, - "readConcernDocument": { - "level": "local" - }, - "isServerDefault": false - }, - { - "description": "Linearizable", - "valid": true, - "readConcern": { - "level": "linearizable" - }, - "readConcernDocument": { - "level": "linearizable" - }, - "isServerDefault": false - }, - { - "description": "Snapshot", - "valid": true, - "readConcern": { - "level": "snapshot" - }, - "readConcernDocument": { - "level": "snapshot" - }, - "isServerDefault": false - }, - { - "description": "Available", - "valid": true, - "readConcern": { - "level": "available" - }, - "readConcernDocument": { - "level": "available" - }, - "isServerDefault": false - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/README.rst b/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/README.rst deleted file mode 100644 index 7c741544ec2..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/README.rst +++ /dev/null @@ -1,12 +0,0 @@ -===================== -SDAM Monitoring Tests -===================== - -The YAML and JSON files in this directory tree are platform-independent tests -that drivers can use to prove their conformance to the SDAM Monitoring spec. - -Format ------- - -The format of the tests follows the standard SDAM test and should be able to leverage -the existing test runner in each language for the SDAM tests. diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/discovered_standalone.json b/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/discovered_standalone.json deleted file mode 100644 index dd8f7fc51ea..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/discovered_standalone.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "description": "Monitoring a discovered standalone connection", - "uri": "mongodb://a:27017/?directConnection=false", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "events": [ - { - "topology_opening_event": { - "topologyId": "42" - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Unknown", - "servers": [] - }, - "newDescription": { - "topologyType": "Unknown", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - } - } - }, - { - "server_opening_event": { - "topologyId": "42", - "address": "a:27017" - } - }, - { - "server_description_changed_event": { - "topologyId": "42", - "address": "a:27017", - "previousDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - "newDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Standalone" - } - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Unknown", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - }, - "newDescription": { - "topologyType": "Single", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Standalone" - } - ] - } - } - } - ] - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/load_balancer.json b/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/load_balancer.json deleted file mode 100644 index 09b15371934..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/load_balancer.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "description": "Monitoring a load balancer", - "uri": "mongodb://a:27017/?loadBalanced=true", - "phases": [ - { - "outcome": { - "events": [ - { - "topology_opening_event": { - "topologyId": "42" - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Unknown", - "servers": [] - }, - "newDescription": { - "topologyType": "LoadBalanced", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - } - } - }, - { - "server_opening_event": { - "topologyId": "42", - "address": "a:27017" - } - }, - { - "server_description_changed_event": { - "topologyId": "42", - "address": "a:27017", - "previousDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - "newDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "LoadBalancer" - } - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "LoadBalanced", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - }, - "newDescription": { - "topologyType": "LoadBalanced", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "LoadBalancer" - } - ] - } - } - } - ] - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/replica_set_with_no_primary.json b/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/replica_set_with_no_primary.json deleted file mode 100644 index 950e32efe11..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/replica_set_with_no_primary.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "description": "Monitoring a topology that is a replica set with no primary connected", - "uri": "mongodb://a,b", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "setVersion": 1, - "primary": "b:27017", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "events": [ - { - "topology_opening_event": { - "topologyId": "42" - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Unknown", - "servers": [] - }, - "newDescription": { - "topologyType": "Unknown", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - { - "address": "b:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - } - } - }, - { - "server_opening_event": { - "topologyId": "42", - "address": "a:27017" - } - }, - { - "server_opening_event": { - "topologyId": "42", - "address": "b:27017" - } - }, - { - "server_description_changed_event": { - "topologyId": "42", - "address": "a:27017", - "previousDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - "newDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [ - "a:27017", - "b:27017" - ], - "passives": [], - "primary": "b:27017", - "setName": "rs", - "type": "RSSecondary" - } - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Unknown", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - { - "address": "b:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - }, - "newDescription": { - "topologyType": "ReplicaSetNoPrimary", - "setName": "rs", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [ - "a:27017", - "b:27017" - ], - "passives": [], - "primary": "b:27017", - "setName": "rs", - "type": "RSSecondary" - }, - { - "address": "b:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "PossiblePrimary" - } - ] - } - } - } - ] - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/replica_set_with_primary.json b/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/replica_set_with_primary.json deleted file mode 100644 index 2ad94d6e6af..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/replica_set_with_primary.json +++ /dev/null @@ -1,150 +0,0 @@ -{ - "description": "Monitoring a topology that is a replica set with a primary connected", - "uri": "mongodb://a,b", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "setVersion": 1, - "primary": "a:27017", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "events": [ - { - "topology_opening_event": { - "topologyId": "42" - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Unknown", - "servers": [] - }, - "newDescription": { - "topologyType": "Unknown", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - { - "address": "b:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - } - } - }, - { - "server_opening_event": { - "topologyId": "42", - "address": "a:27017" - } - }, - { - "server_opening_event": { - "topologyId": "42", - "address": "b:27017" - } - }, - { - "server_description_changed_event": { - "topologyId": "42", - "address": "a:27017", - "previousDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - "newDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [ - "a:27017", - "b:27017" - ], - "passives": [], - "primary": "a:27017", - "setName": "rs", - "type": "RSPrimary" - } - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Unknown", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - { - "address": "b:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - }, - "newDescription": { - "topologyType": "ReplicaSetWithPrimary", - "setName": "rs", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [ - "a:27017", - "b:27017" - ], - "passives": [], - "primary": "a:27017", - "setName": "rs", - "type": "RSPrimary" - }, - { - "address": "b:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - } - } - } - ] - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/replica_set_with_removal.json b/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/replica_set_with_removal.json deleted file mode 100644 index ae28faa30cc..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/replica_set_with_removal.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "description": "Monitoring a replica set with non member", - "uri": "mongodb://a,b/", - "phases": [ - { - "responses": [], - "outcome": { - "events": [ - { - "topology_opening_event": { - "topologyId": "42" - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Unknown", - "servers": [] - }, - "newDescription": { - "topologyType": "Unknown", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - { - "address": "b:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - } - } - }, - { - "server_opening_event": { - "topologyId": "42", - "address": "a:27017" - } - }, - { - "server_opening_event": { - "topologyId": "42", - "address": "b:27017" - } - } - ] - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "setVersion": 1, - "primary": "a:27017", - "hosts": [ - "a:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true - } - ] - ], - "outcome": { - "events": [ - { - "server_description_changed_event": { - "topologyId": "42", - "address": "a:27017", - "previousDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - "newDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [ - "a:27017" - ], - "passives": [], - "primary": "a:27017", - "setName": "rs", - "type": "RSPrimary" - } - } - }, - { - "server_closed_event": { - "topologyId": "42", - "address": "b:27017" - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Unknown", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - { - "address": "b:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - }, - "newDescription": { - "topologyType": "ReplicaSetWithPrimary", - "setName": "rs", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [ - "a:27017" - ], - "passives": [], - "primary": "a:27017", - "setName": "rs", - "type": "RSPrimary" - } - ] - } - } - } - ] - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/required_replica_set.json b/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/required_replica_set.json deleted file mode 100644 index 401c5d99c56..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/required_replica_set.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "description": "Monitoring a topology that is required to be a replica set", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "setVersion": 1, - "primary": "a:27017", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "events": [ - { - "topology_opening_event": { - "topologyId": "42" - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Unknown", - "servers": [] - }, - "newDescription": { - "topologyType": "ReplicaSetNoPrimary", - "setName": "rs", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - { - "address": "b:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - } - } - }, - { - "server_opening_event": { - "topologyId": "42", - "address": "a:27017" - } - }, - { - "server_opening_event": { - "topologyId": "42", - "address": "b:27017" - } - }, - { - "server_description_changed_event": { - "topologyId": "42", - "address": "a:27017", - "previousDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - "newDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [ - "a:27017", - "b:27017" - ], - "passives": [], - "primary": "a:27017", - "setName": "rs", - "type": "RSPrimary" - } - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "ReplicaSetNoPrimary", - "setName": "rs", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - { - "address": "b:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - }, - "newDescription": { - "topologyType": "ReplicaSetWithPrimary", - "setName": "rs", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [ - "a:27017", - "b:27017" - ], - "passives": [], - "primary": "a:27017", - "setName": "rs", - "type": "RSPrimary" - }, - { - "address": "b:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - } - } - } - ] - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/standalone.json b/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/standalone.json deleted file mode 100644 index 821a1525d41..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/standalone.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "description": "Monitoring a direct connection", - "uri": "mongodb://a:27017/?directConnection=true", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "events": [ - { - "topology_opening_event": { - "topologyId": "42" - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Unknown", - "servers": [] - }, - "newDescription": { - "topologyType": "Single", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - } - } - }, - { - "server_opening_event": { - "topologyId": "42", - "address": "a:27017" - } - }, - { - "server_description_changed_event": { - "topologyId": "42", - "address": "a:27017", - "previousDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - "newDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Standalone" - } - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Single", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - }, - "newDescription": { - "topologyType": "Single", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Standalone" - } - ] - } - } - } - ] - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/standalone_suppress_equal_description_changes.json b/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/standalone_suppress_equal_description_changes.json deleted file mode 100644 index 5958e2d26c7..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring-monitoring/standalone_suppress_equal_description_changes.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "description": "Monitoring a direct connection - suppress update events for equal server descriptions", - "uri": "mongodb://a:27017/?directConnection=true", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "events": [ - { - "topology_opening_event": { - "topologyId": "42" - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Unknown", - "servers": [] - }, - "newDescription": { - "topologyType": "Single", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - } - } - }, - { - "server_opening_event": { - "topologyId": "42", - "address": "a:27017" - } - }, - { - "server_description_changed_event": { - "topologyId": "42", - "address": "a:27017", - "previousDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - }, - "newDescription": { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Standalone" - } - } - }, - { - "topology_description_changed_event": { - "topologyId": "42", - "previousDescription": { - "topologyType": "Single", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Unknown" - } - ] - }, - "newDescription": { - "topologyType": "Single", - "servers": [ - { - "address": "a:27017", - "arbiters": [], - "hosts": [], - "passives": [], - "type": "Standalone" - } - ] - } - } - } - ] - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/README.rst b/driver-core/src/test/resources/server-discovery-and-monitoring/README.rst deleted file mode 100644 index 2d90d592c29..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/README.rst +++ /dev/null @@ -1,437 +0,0 @@ -===================================== -Server Discovery And Monitoring Tests -===================================== - -.. contents:: - ----- - -The YAML and JSON files in this directory tree are platform-independent tests -that drivers can use to prove their conformance to the -Server Discovery And Monitoring Spec. - -Additional prose tests, that cannot be represented as spec tests, are -described and MUST be implemented. - -Version -------- - -Files in the "specifications" repository have no version scheme. They are not -tied to a MongoDB server version. - -Format ------- - -Each YAML file has the following keys: - -- description: A textual description of the test. -- uri: A connection string. -- phases: An array of "phase" objects. - A phase of the test optionally sends inputs to the client, - then tests the client's resulting TopologyDescription. - -Each phase object has the following keys: - -- description: (optional) A textual description of this phase. -- responses: (optional) An array of "response" objects. If not provided, - the test runner should construct the client and perform assertions specified - in the outcome object without processing any responses. -- applicationErrors: (optional) An array of "applicationError" objects. -- outcome: An "outcome" object representing the TopologyDescription. - -A response is a pair of values: - -- The source, for example "a:27017". - This is the address the client sent the "ismaster" command to. -- An ismaster response, for example ``{ok: 1, ismaster: true}``. - If the response includes an electionId it is shown in extended JSON like - ``{"$oid": "000000000000000000000002"}``. - The empty response `{}` indicates a network error - when attempting to call "ismaster". - -An "applicationError" object has the following keys: - -- address: The source address, for example "a:27017". -- generation: (optional) The error's generation number, for example ``1``. - When absent this value defaults to the pool's current generation number. -- maxWireVersion: The ``maxWireVersion`` of the connection the error occurs - on, for example ``9``. Added to support testing the behavior of "not master" - errors on <4.2 and >=4.2 servers. -- when: A string describing when this mock error should occur. Supported - values are: - - - "beforeHandshakeCompletes": Simulate this mock error as if it occurred - during a new connection's handshake for an application operation. - - "afterHandshakeCompletes": Simulate this mock error as if it occurred - on an established connection for an application operation (i.e. after - the connection pool check out succeeds). - -- type: The type of error to mock. Supported values are: - - - "command": A command error. Always accompanied with a "response". - - "network": A non-timeout network error. - - "timeout": A network timeout error. - -- response: (optional) A command error response, for example - ``{ok: 0, errmsg: "not master"}``. Present if and only if ``type`` is - "command". - -In non-monitoring tests, an "outcome" represents the correct -TopologyDescription that results from processing the responses in the phases -so far. It has the following keys: - -- topologyType: A string like "ReplicaSetNoPrimary". -- setName: A string with the expected replica set name, or null. -- servers: An object whose keys are addresses like "a:27017", and whose values - are "server" objects. -- logicalSessionTimeoutMinutes: null or an integer. -- maxSetVersion: absent or an integer. -- maxElectionId: absent or a BSON ObjectId. -- compatible: absent or a bool. - -A "server" object represents a correct ServerDescription within the client's -current TopologyDescription. It has the following keys: - -- type: A ServerType name, like "RSSecondary". -- setName: A string with the expected replica set name, or null. -- setVersion: absent or an integer. -- electionId: absent, null, or an ObjectId. -- logicalSessionTimeoutMinutes: absent, null, or an integer. -- minWireVersion: absent or an integer. -- maxWireVersion: absent or an integer. -- topologyVersion: absent, null, or a topologyVersion document. -- pool: (optional) A "pool" object. - -A "pool" object represents a correct connection pool for a given server. -It has the following keys: - -- generation: This server's expected pool generation, like ``0``. - -In monitoring tests, an "outcome" contains a list of SDAM events that should -have been published by the client as a result of processing ismaster responses -in the current phase. Any SDAM events published by the client during its -construction (that is, prior to processing any of the responses) should be -combined with the events published during processing of ismaster responses -of the first phase of the test. A test MAY explicitly verify events published -during client construction by providing an empty responses array for the -first phase. - - -Use as unittests ----------------- - -Mocking -~~~~~~~ - -Drivers should be able to test their server discovery and monitoring logic -without any network I/O, by parsing ismaster and application error from the -test file and passing them into the driver code. Parts of the client and -monitoring code may need to be mocked or subclassed to achieve this. -`A reference implementation for PyMongo 3.10.1 is available here -`_. - -Initialization -~~~~~~~~~~~~~~ - -For each file, create a fresh client object initialized with the file's "uri". - -All files in the "single" directory include a connection string with one host -and no "replicaSet" option. -Set the client's initial TopologyType to Single, however that is achieved using the client's API. -(The spec says "The user MUST be able to set the initial TopologyType to Single" -without specifying how.) - -All files in the "sharded" directory include a connection string with multiple hosts -and no "replicaSet" option. -Set the client's initial TopologyType to Unknown or Sharded, depending on the client's API. - -All files in the "rs" directory include a connection string with a "replicaSet" option. -Set the client's initial TopologyType to ReplicaSetNoPrimary. -(For most clients, parsing a connection string with a "replicaSet" option -automatically sets the TopologyType to ReplicaSetNoPrimary.) - -Set up a listener to collect SDAM events published by the client, including -events published during client construction. - -Test Phases -~~~~~~~~~~~ - -For each phase in the file: - -#. Parse the "responses" array. Pass in the responses in order to the driver - code. If a response is the empty object ``{}``, simulate a network error. - -#. Parse the "applicationErrors" array. For each element, simulate the given - error as if it occurred while running an application operation. Note that - it is sufficient to construct a mock error and call the procedure which - updates the topology, e.g. - ``topology.handleApplicationError(address, generation, maxWireVersion, error)``. - -For non-monitoring tests, -once all responses are processed, assert that the phase's "outcome" object -is equivalent to the driver's current TopologyDescription. - -For monitoring tests, once all responses are processed, assert that the -events collected so far by the SDAM event listener are equivalent to the -events specified in the phase. - -Some fields such as "logicalSessionTimeoutMinutes", "compatible", and -"topologyVersion" were added later and haven't been added to all test files. -If these fields are present, test that they are equivalent to the fields of -the driver's current TopologyDescription or ServerDescription. - -For monitoring tests, clear the list of events collected so far. - -Continue until all phases have been executed. - -Integration Tests ------------------ - -Integration tests are provided in the "integration" directory. - -Test Format -~~~~~~~~~~~ - -The same as the `Transactions Spec Test format -`_. - -Special Test Operations -~~~~~~~~~~~~~~~~~~~~~~~ - -Certain operations that appear in the "operations" array do not correspond to -API methods but instead represent special test operations. Such operations are -defined on the "testRunner" object and are documented in the -`Transactions Spec Test -`_. - -Additional, SDAM test specific operations are documented here: - -configureFailPoint -'''''''''''''''''' - -The "configureFailPoint" operation instructs the test runner to configure -the given server failpoint on the "admin" database. The runner MUST disable -this failpoint at the end of the test. For example:: - - - name: configureFailPoint - object: testRunner - arguments: - failPoint: - configureFailPoint: failCommand - mode: { times: 1 } - data: - failCommands: ["insert"] - closeConnection: true - -Tests that use the "configureFailPoint" operation do not include -``configureFailPoint`` commands in their command expectations. Drivers MUST -ensure that ``configureFailPoint`` commands do not appear in the list of logged -commands, either by manually filtering it from the list of observed commands or -by using a different MongoClient to execute ``configureFailPoint``. - -wait -'''' - -The "wait" operation instructs the test runner to sleep for "ms" -milliseconds. For example:: - - - name: wait - object: testRunner - arguments: - ms: 1000 - -waitForEvent -'''''''''''' - -The "waitForEvent" operation instructs the test runner to wait until the test's -MongoClient has published a specific event a given number of times. For -example, the following instructs the test runner to wait for at least one -PoolClearedEvent to be published:: - - - name: waitForEvent - object: testRunner - arguments: - event: PoolClearedEvent - count: 1 - -Note that "count" includes events that were published while running previous -operations. - -ServerMarkedUnknownEvent -```````````````````````` - -The ServerMarkedUnknownEvent may appear as an event in `waitForEvent`_ and -`assertEventCount`_. This event is defined as ServerDescriptionChangedEvent -where newDescription.type is ``Unknown``. - -assertEventCount -'''''''''''''''' - -The "assertEventCount" operation instructs the test runner to assert the test's -MongoClient has published a specific event a given number of times. For -example, the following instructs the test runner to assert that a single -PoolClearedEvent was published:: - - - name: waitForEvent - object: testRunner - arguments: - event: PoolClearedEvent - count: 1 - -recordPrimary -''''''''''''' - -The "recordPrimary" operation instructs the test runner to record the current -primary of the test's MongoClient. For example:: - - - name: recordPrimary - object: testRunner - -runAdminCommand -''''''''''''''' - -The "runAdminCommand" operation instructs the test runner to run the given -command on the admin database. Drivers MUST run this command on a different -MongoClient from the one used for test operations. For example:: - - - name: runAdminCommand - object: testRunner - command_name: replSetStepDown - arguments: - command: - replSetStepDown: 20 - force: false - -waitForPrimaryChange -'''''''''''''''''''' - -The "waitForPrimaryChange" operation instructs the test runner to wait up to -"timeoutMS" milliseconds for the MongoClient to discover a new primary server. -The new primary should be different from the one recorded by "recordPrimary". -For example:: - - - name: waitForPrimaryChange - object: testRunner - arguments: - timeoutMS: 15000 - -To implement, Drivers can subscribe to ServerDescriptionChangedEvents and wait -for an event where newDescription.type is ``RSPrimary`` and the address is -different from the one previously recorded by "recordPrimary". - -startThread -''''''''''' - -The "startThread" operation instructs the test runner to start a new thread -with the provided "name". The `runOnThread`_ and `waitForThread`_ operations -reference a thread by its "name". For example:: - - - name: startThread - object: testRunner - arguments: - name: thread1 - -runOnThread -''''''''''' - -The "runOnThread" operation instructs the test runner to schedule an operation -to be run on the given thread. runOnThread MUST NOT wait for the scheduled -operation to complete. For example:: - - - name: runOnThread - object: testRunner - arguments: - name: thread1 - operation: - name: insertOne - object: collection - arguments: - document: - _id: 2 - error: true - -waitForThread -''''''''''''' - -The "waitForThread" operation instructs the test runner to stop the given -thread, wait for it to complete, and assert that the thread exited without -any errors. For example:: - - - name: waitForThread - object: testRunner - arguments: - name: thread1 - -Prose Tests ------------ - -The following prose tests cannot be represented as spec tests and MUST be -implemented. - -Streaming protocol Tests -~~~~~~~~~~~~~~~~~~~~~~~~ - -Drivers that implement the streaming protocol (multi-threaded or -asynchronous drivers) must implement the following tests. Each test should be -run against a standalone, replica set, and sharded cluster unless otherwise -noted. - -Some of these cases should already be tested with the old protocol; in -that case just verify the test cases succeed with the new protocol. - -1. Configure the client with heartbeatFrequencyMS set to 500, - overriding the default of 10000. Assert the client processes - isMaster replies more frequently (approximately every 500ms). - -RTT Tests -~~~~~~~~~ - -Run the following test(s) on MongoDB 4.4+. - -1. Test that RTT is continuously updated. - - #. Create a client with ``heartbeatFrequencyMS=500``, - ``appName=streamingRttTest``, and subscribe to server events. - - #. Run a find command to wait for the server to be discovered. - - #. Sleep for 2 seconds. This must be long enough for multiple heartbeats - to succeed. - - #. Assert that each ``ServerDescriptionChangedEvent`` includes a non-zero - RTT. - - #. Configure the following failpoint to block isMaster commands for 250ms - which should add extra latency to each RTT check:: - - db.adminCommand({ - configureFailPoint: "failCommand", - mode: {times: 1000}, - data: { - failCommands: ["isMaster"], - blockConnection: true, - blockTimeMS: 500, - appName: "streamingRttTest", - }, - }); - - #. Wait for the server's RTT to exceed 250ms. Eventually the average RTT - should also exceed 500ms but we use 250ms to speed up the test. Note - that the `Server Description Equality`_ rule means that - ServerDescriptionChangedEvents will not be published. This test may - need to use a driver specific helper to obtain the latest RTT instead. - - #. Disable the failpoint:: - - db.adminCommand({ - configureFailPoint: "failCommand", - mode: "off", - }); - -.. Section for links. - -.. _Server Description Equality: /source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#server-description-equality - -.. Section for links. - -.. _Server Description Equality: /source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#server-description-equality diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/error_handling_handshake.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/error_handling_handshake.json deleted file mode 100644 index 56ca7d11328..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/error_handling_handshake.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "description": "Network timeouts before and after the handshake completes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore network timeout application error (afterHandshakeCompletes)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "timeout" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Mark server unknown on network timeout application error (beforeHandshakeCompletes)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "beforeHandshakeCompletes", - "maxWireVersion": 9, - "type": "timeout" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-network-error.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-network-error.json deleted file mode 100644 index c22a47dc8ac..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-network-error.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "description": "Non-stale network error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale network error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-network-timeout-error.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-network-timeout-error.json deleted file mode 100644 index 03dc5b66c96..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-network-timeout-error.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "description": "Non-stale network timeout error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale network timeout error does not mark server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "timeout" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-InterruptedAtShutdown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-InterruptedAtShutdown.json deleted file mode 100644 index 777e703a3cc..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-InterruptedAtShutdown.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion greater InterruptedAtShutdown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion greater InterruptedAtShutdown error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedAtShutdown", - "code": 11600, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-InterruptedDueToReplStateChange.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-InterruptedDueToReplStateChange.json deleted file mode 100644 index c4aa7fb71ba..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-InterruptedDueToReplStateChange.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion greater InterruptedDueToReplStateChange error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion greater InterruptedDueToReplStateChange error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedDueToReplStateChange", - "code": 11602, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-LegacyNotPrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-LegacyNotPrimary.json deleted file mode 100644 index 2a9bc8a5cfc..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-LegacyNotPrimary.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion greater LegacyNotPrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion greater LegacyNotPrimary error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "LegacyNotPrimary", - "code": 10058, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-NotPrimaryNoSecondaryOk.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-NotPrimaryNoSecondaryOk.json deleted file mode 100644 index 638aa306cb6..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-NotPrimaryNoSecondaryOk.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion greater NotPrimaryNoSecondaryOk error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion greater NotPrimaryNoSecondaryOk error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryNoSecondaryOk", - "code": 13435, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-NotPrimaryOrSecondary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-NotPrimaryOrSecondary.json deleted file mode 100644 index f327954a9db..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-NotPrimaryOrSecondary.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion greater NotPrimaryOrSecondary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion greater NotPrimaryOrSecondary error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryOrSecondary", - "code": 13436, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-NotWritablePrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-NotWritablePrimary.json deleted file mode 100644 index 0ac02fb19b6..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-NotWritablePrimary.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion greater NotWritablePrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion greater NotWritablePrimary error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotWritablePrimary", - "code": 10107, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-PrimarySteppedDown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-PrimarySteppedDown.json deleted file mode 100644 index daf2a7e8e10..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-PrimarySteppedDown.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion greater PrimarySteppedDown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion greater PrimarySteppedDown error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "PrimarySteppedDown", - "code": 189, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-ShutdownInProgress.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-ShutdownInProgress.json deleted file mode 100644 index a7d9e1fe24e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-greater-ShutdownInProgress.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion greater ShutdownInProgress error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion greater ShutdownInProgress error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "ShutdownInProgress", - "code": 91, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-InterruptedAtShutdown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-InterruptedAtShutdown.json deleted file mode 100644 index 2c59e785ab3..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-InterruptedAtShutdown.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "description": "Non-stale topologyVersion missing InterruptedAtShutdown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion missing InterruptedAtShutdown error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedAtShutdown", - "code": 11600 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-InterruptedDueToReplStateChange.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-InterruptedDueToReplStateChange.json deleted file mode 100644 index f2cb834e838..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-InterruptedDueToReplStateChange.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "description": "Non-stale topologyVersion missing InterruptedDueToReplStateChange error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion missing InterruptedDueToReplStateChange error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedDueToReplStateChange", - "code": 11602 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-LegacyNotPrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-LegacyNotPrimary.json deleted file mode 100644 index 095128d615c..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-LegacyNotPrimary.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "description": "Non-stale topologyVersion missing LegacyNotPrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion missing LegacyNotPrimary error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "LegacyNotPrimary", - "code": 10058 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-NotPrimaryNoSecondaryOk.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-NotPrimaryNoSecondaryOk.json deleted file mode 100644 index 3d7312d4a5e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-NotPrimaryNoSecondaryOk.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "description": "Non-stale topologyVersion missing NotPrimaryNoSecondaryOk error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion missing NotPrimaryNoSecondaryOk error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryNoSecondaryOk", - "code": 13435 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-NotPrimaryOrSecondary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-NotPrimaryOrSecondary.json deleted file mode 100644 index a457ba30728..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-NotPrimaryOrSecondary.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "description": "Non-stale topologyVersion missing NotPrimaryOrSecondary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion missing NotPrimaryOrSecondary error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryOrSecondary", - "code": 13436 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-NotWritablePrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-NotWritablePrimary.json deleted file mode 100644 index b7427a3f3d9..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-NotWritablePrimary.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "description": "Non-stale topologyVersion missing NotWritablePrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion missing NotWritablePrimary error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotWritablePrimary", - "code": 10107 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-PrimarySteppedDown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-PrimarySteppedDown.json deleted file mode 100644 index 8146a60d6e5..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-PrimarySteppedDown.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "description": "Non-stale topologyVersion missing PrimarySteppedDown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion missing PrimarySteppedDown error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "PrimarySteppedDown", - "code": 189 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-ShutdownInProgress.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-ShutdownInProgress.json deleted file mode 100644 index c7597007d73..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-missing-ShutdownInProgress.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "description": "Non-stale topologyVersion missing ShutdownInProgress error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion missing ShutdownInProgress error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "ShutdownInProgress", - "code": 91 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-InterruptedAtShutdown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-InterruptedAtShutdown.json deleted file mode 100644 index 8448c605992..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-InterruptedAtShutdown.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion proccessId changed InterruptedAtShutdown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion proccessId changed InterruptedAtShutdown error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedAtShutdown", - "code": 11600, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-InterruptedDueToReplStateChange.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-InterruptedDueToReplStateChange.json deleted file mode 100644 index 9d601c4ede3..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-InterruptedDueToReplStateChange.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion proccessId changed InterruptedDueToReplStateChange error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion proccessId changed InterruptedDueToReplStateChange error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedDueToReplStateChange", - "code": 11602, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-LegacyNotPrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-LegacyNotPrimary.json deleted file mode 100644 index 8be833f1046..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-LegacyNotPrimary.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion proccessId changed LegacyNotPrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion proccessId changed LegacyNotPrimary error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "LegacyNotPrimary", - "code": 10058, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-NotPrimaryNoSecondaryOk.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-NotPrimaryNoSecondaryOk.json deleted file mode 100644 index f2f94c0d007..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-NotPrimaryNoSecondaryOk.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion proccessId changed NotPrimaryNoSecondaryOk error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion proccessId changed NotPrimaryNoSecondaryOk error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryNoSecondaryOk", - "code": 13435, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-NotPrimaryOrSecondary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-NotPrimaryOrSecondary.json deleted file mode 100644 index 6d3b397566e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-NotPrimaryOrSecondary.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion proccessId changed NotPrimaryOrSecondary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion proccessId changed NotPrimaryOrSecondary error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryOrSecondary", - "code": 13436, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-NotWritablePrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-NotWritablePrimary.json deleted file mode 100644 index 332ddf5ec12..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-NotWritablePrimary.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion proccessId changed NotWritablePrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion proccessId changed NotWritablePrimary error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotWritablePrimary", - "code": 10107, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-PrimarySteppedDown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-PrimarySteppedDown.json deleted file mode 100644 index c22a537f582..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-PrimarySteppedDown.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion proccessId changed PrimarySteppedDown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion proccessId changed PrimarySteppedDown error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "PrimarySteppedDown", - "code": 189, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-ShutdownInProgress.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-ShutdownInProgress.json deleted file mode 100644 index eaaab79273e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/non-stale-topologyVersion-proccessId-changed-ShutdownInProgress.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Non-stale topologyVersion proccessId changed ShutdownInProgress error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale topologyVersion proccessId changed ShutdownInProgress error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "ShutdownInProgress", - "code": 91, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-InterruptedAtShutdown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-InterruptedAtShutdown.json deleted file mode 100644 index 40c4ed6c803..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-InterruptedAtShutdown.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Post-4.2 InterruptedAtShutdown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 8 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Post-4.2 InterruptedAtShutdown error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 8, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedAtShutdown", - "code": 11600 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-InterruptedDueToReplStateChange.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-InterruptedDueToReplStateChange.json deleted file mode 100644 index 5c489f5ecba..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-InterruptedDueToReplStateChange.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Post-4.2 InterruptedDueToReplStateChange error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 8 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Post-4.2 InterruptedDueToReplStateChange error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 8, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedDueToReplStateChange", - "code": 11602 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-LegacyNotPrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-LegacyNotPrimary.json deleted file mode 100644 index f0851b299e4..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-LegacyNotPrimary.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Post-4.2 LegacyNotPrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 8 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Post-4.2 LegacyNotPrimary error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 8, - "type": "command", - "response": { - "ok": 0, - "errmsg": "LegacyNotPrimary", - "code": 10058 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-NotPrimaryNoSecondaryOk.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-NotPrimaryNoSecondaryOk.json deleted file mode 100644 index a675f0ca543..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-NotPrimaryNoSecondaryOk.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Post-4.2 NotPrimaryNoSecondaryOk error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 8 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Post-4.2 NotPrimaryNoSecondaryOk error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 8, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryNoSecondaryOk", - "code": 13435 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-NotPrimaryOrSecondary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-NotPrimaryOrSecondary.json deleted file mode 100644 index ea9bf1d16bd..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-NotPrimaryOrSecondary.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Post-4.2 NotPrimaryOrSecondary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 8 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Post-4.2 NotPrimaryOrSecondary error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 8, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryOrSecondary", - "code": 13436 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-NotWritablePrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-NotWritablePrimary.json deleted file mode 100644 index 10211fca708..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-NotWritablePrimary.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Post-4.2 NotWritablePrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 8 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Post-4.2 NotWritablePrimary error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 8, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotWritablePrimary", - "code": 10107 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-PrimarySteppedDown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-PrimarySteppedDown.json deleted file mode 100644 index fa98d0bf069..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-PrimarySteppedDown.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Post-4.2 PrimarySteppedDown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 8 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Post-4.2 PrimarySteppedDown error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 8, - "type": "command", - "response": { - "ok": 0, - "errmsg": "PrimarySteppedDown", - "code": 189 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-ShutdownInProgress.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-ShutdownInProgress.json deleted file mode 100644 index cd587205b62..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/post-42-ShutdownInProgress.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Post-4.2 ShutdownInProgress error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 8 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Post-4.2 ShutdownInProgress error marks server Unknown", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 8, - "type": "command", - "response": { - "ok": 0, - "errmsg": "ShutdownInProgress", - "code": 91 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-InterruptedAtShutdown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-InterruptedAtShutdown.json deleted file mode 100644 index 9f6ea212e5c..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-InterruptedAtShutdown.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 InterruptedAtShutdown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 InterruptedAtShutdown error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedAtShutdown", - "code": 11600 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-InterruptedDueToReplStateChange.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-InterruptedDueToReplStateChange.json deleted file mode 100644 index 7e5f2357134..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-InterruptedDueToReplStateChange.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 InterruptedDueToReplStateChange error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 InterruptedDueToReplStateChange error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedDueToReplStateChange", - "code": 11602 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-LegacyNotPrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-LegacyNotPrimary.json deleted file mode 100644 index 1635f1a8568..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-LegacyNotPrimary.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 LegacyNotPrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 LegacyNotPrimary error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "LegacyNotPrimary", - "code": 10058 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-NotPrimaryNoSecondaryOk.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-NotPrimaryNoSecondaryOk.json deleted file mode 100644 index 0e70ede02c9..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-NotPrimaryNoSecondaryOk.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 NotPrimaryNoSecondaryOk error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 NotPrimaryNoSecondaryOk error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryNoSecondaryOk", - "code": 13435 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-NotPrimaryOrSecondary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-NotPrimaryOrSecondary.json deleted file mode 100644 index 3fefb216634..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-NotPrimaryOrSecondary.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 NotPrimaryOrSecondary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 NotPrimaryOrSecondary error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryOrSecondary", - "code": 13436 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-NotWritablePrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-NotWritablePrimary.json deleted file mode 100644 index d010da0a5bc..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-NotWritablePrimary.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 NotWritablePrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 NotWritablePrimary error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotWritablePrimary", - "code": 10107 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-PrimarySteppedDown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-PrimarySteppedDown.json deleted file mode 100644 index 02956d201dd..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-PrimarySteppedDown.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 PrimarySteppedDown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 PrimarySteppedDown error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "PrimarySteppedDown", - "code": 189 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-ShutdownInProgress.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-ShutdownInProgress.json deleted file mode 100644 index fc3a5aa6fee..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/pre-42-ShutdownInProgress.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "Pre-4.2 ShutdownInProgress error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Pre-4.2 ShutdownInProgress error marks server Unknown and clears the pool", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 7, - "type": "command", - "response": { - "ok": 0, - "errmsg": "ShutdownInProgress", - "code": 91 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/prefer-error-code.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/prefer-error-code.json deleted file mode 100644 index eb00b696131..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/prefer-error-code.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "description": "Do not check errmsg when code exists", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "errmsg \"not master\" gets ignored when error code exists", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "not master", - "code": 1 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "errmsg \"node is recovering\" gets ignored when error code exists", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "node is recovering", - "code": 1 - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-InterruptedAtShutdown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-InterruptedAtShutdown.json deleted file mode 100644 index 2f7c7fd13b1..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-InterruptedAtShutdown.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation InterruptedAtShutdown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale InterruptedAtShutdown error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedAtShutdown", - "code": 11600, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-InterruptedDueToReplStateChange.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-InterruptedDueToReplStateChange.json deleted file mode 100644 index b0b51ef676f..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-InterruptedDueToReplStateChange.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation InterruptedDueToReplStateChange error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale InterruptedDueToReplStateChange error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedDueToReplStateChange", - "code": 11602, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-NotPrimaryNoSecondaryOk.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-NotPrimaryNoSecondaryOk.json deleted file mode 100644 index b68e23b7a78..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-NotPrimaryNoSecondaryOk.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation NotPrimaryNoSecondaryOk error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotPrimaryNoSecondaryOk error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryNoSecondaryOk", - "code": 13435, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-NotPrimaryOrSecondary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-NotPrimaryOrSecondary.json deleted file mode 100644 index d9b35626545..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-NotPrimaryOrSecondary.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation NotPrimaryOrSecondary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotPrimaryOrSecondary error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryOrSecondary", - "code": 13436, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-NotWritablePrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-NotWritablePrimary.json deleted file mode 100644 index 90889356dd3..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-NotWritablePrimary.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation NotWritablePrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotWritablePrimary error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotWritablePrimary", - "code": 10107, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-PrimarySteppedDown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-PrimarySteppedDown.json deleted file mode 100644 index 0a707a1c071..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-PrimarySteppedDown.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation PrimarySteppedDown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale PrimarySteppedDown error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "PrimarySteppedDown", - "code": 189, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-ShutdownInProgress.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-ShutdownInProgress.json deleted file mode 100644 index 5da3413d5bb..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-ShutdownInProgress.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation ShutdownInProgress error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale ShutdownInProgress error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "ShutdownInProgress", - "code": 91, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-InterruptedAtShutdown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-InterruptedAtShutdown.json deleted file mode 100644 index d29310fb619..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-InterruptedAtShutdown.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation InterruptedAtShutdown error afterHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale InterruptedAtShutdown error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedAtShutdown", - "code": 11600, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-InterruptedDueToReplStateChange.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-InterruptedDueToReplStateChange.json deleted file mode 100644 index 376bb937702..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-InterruptedDueToReplStateChange.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation InterruptedDueToReplStateChange error afterHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale InterruptedDueToReplStateChange error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedDueToReplStateChange", - "code": 11602, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-LegacyNotPrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-LegacyNotPrimary.json deleted file mode 100644 index 990fc45e4e9..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-LegacyNotPrimary.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation LegacyNotPrimary error afterHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale LegacyNotPrimary error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "LegacyNotPrimary", - "code": 10058, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-NotPrimaryNoSecondaryOk.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-NotPrimaryNoSecondaryOk.json deleted file mode 100644 index 1744a82f77e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-NotPrimaryNoSecondaryOk.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation NotPrimaryNoSecondaryOk error afterHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotPrimaryNoSecondaryOk error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryNoSecondaryOk", - "code": 13435, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-NotPrimaryOrSecondary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-NotPrimaryOrSecondary.json deleted file mode 100644 index 57ca1cf158b..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-NotPrimaryOrSecondary.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation NotPrimaryOrSecondary error afterHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotPrimaryOrSecondary error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryOrSecondary", - "code": 13436, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-NotWritablePrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-NotWritablePrimary.json deleted file mode 100644 index 995453c82bd..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-NotWritablePrimary.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation NotWritablePrimary error afterHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotWritablePrimary error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotWritablePrimary", - "code": 10107, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-PrimarySteppedDown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-PrimarySteppedDown.json deleted file mode 100644 index bf4c85d24f3..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-PrimarySteppedDown.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation PrimarySteppedDown error afterHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale PrimarySteppedDown error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "PrimarySteppedDown", - "code": 189, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-ShutdownInProgress.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-ShutdownInProgress.json deleted file mode 100644 index 9374900e066..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-ShutdownInProgress.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation ShutdownInProgress error afterHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale ShutdownInProgress error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "ShutdownInProgress", - "code": 91, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-network.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-network.json deleted file mode 100644 index f5d01b65402..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-network.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "description": "Stale generation network error afterHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale network error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-timeout.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-timeout.json deleted file mode 100644 index fa84343b0b1..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-afterHandshakeCompletes-timeout.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "description": "Stale generation timeout error afterHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale timeout error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "timeout" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-InterruptedAtShutdown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-InterruptedAtShutdown.json deleted file mode 100644 index 72fac9a86ec..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-InterruptedAtShutdown.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation InterruptedAtShutdown error beforeHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale InterruptedAtShutdown error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "beforeHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedAtShutdown", - "code": 11600, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-InterruptedDueToReplStateChange.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-InterruptedDueToReplStateChange.json deleted file mode 100644 index 3c713592a30..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-InterruptedDueToReplStateChange.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation InterruptedDueToReplStateChange error beforeHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale InterruptedDueToReplStateChange error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "beforeHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedDueToReplStateChange", - "code": 11602, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-LegacyNotPrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-LegacyNotPrimary.json deleted file mode 100644 index 257b6ec6fbf..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-LegacyNotPrimary.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation LegacyNotPrimary error beforeHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale LegacyNotPrimary error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "beforeHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "LegacyNotPrimary", - "code": 10058, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-NotPrimaryNoSecondaryOk.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-NotPrimaryNoSecondaryOk.json deleted file mode 100644 index dcb5716f445..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-NotPrimaryNoSecondaryOk.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation NotPrimaryNoSecondaryOk error beforeHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotPrimaryNoSecondaryOk error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "beforeHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryNoSecondaryOk", - "code": 13435, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-NotPrimaryOrSecondary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-NotPrimaryOrSecondary.json deleted file mode 100644 index 58cefafae9e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-NotPrimaryOrSecondary.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation NotPrimaryOrSecondary error beforeHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotPrimaryOrSecondary error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "beforeHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryOrSecondary", - "code": 13436, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-NotWritablePrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-NotWritablePrimary.json deleted file mode 100644 index c92b01e0540..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-NotWritablePrimary.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation NotWritablePrimary error beforeHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotWritablePrimary error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "beforeHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotWritablePrimary", - "code": 10107, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-PrimarySteppedDown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-PrimarySteppedDown.json deleted file mode 100644 index 62759b6ad90..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-PrimarySteppedDown.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation PrimarySteppedDown error beforeHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale PrimarySteppedDown error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "beforeHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "PrimarySteppedDown", - "code": 189, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-ShutdownInProgress.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-ShutdownInProgress.json deleted file mode 100644 index 4661632c4f3..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-ShutdownInProgress.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "description": "Stale generation ShutdownInProgress error beforeHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale ShutdownInProgress error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "beforeHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "ShutdownInProgress", - "code": 91, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-network.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-network.json deleted file mode 100644 index 15b044fc73d..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-network.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "description": "Stale generation network error beforeHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale network error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "beforeHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-timeout.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-timeout.json deleted file mode 100644 index acbb9e581e4..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-generation-beforeHandshakeCompletes-timeout.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "description": "Stale generation timeout error beforeHandshakeCompletes", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Non-stale application network error", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "network" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Primary A is rediscovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale timeout error (stale generation)", - "applicationErrors": [ - { - "address": "a:27017", - "generation": 0, - "when": "beforeHandshakeCompletes", - "maxWireVersion": 9, - "type": "timeout" - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 1 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-InterruptedAtShutdown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-InterruptedAtShutdown.json deleted file mode 100644 index f2207a04d59..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-InterruptedAtShutdown.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "Stale topologyVersion InterruptedAtShutdown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale InterruptedAtShutdown error (topologyVersion less)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedAtShutdown", - "code": 11600, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "0" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale InterruptedAtShutdown error (topologyVersion equal)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedAtShutdown", - "code": 11600, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-InterruptedDueToReplStateChange.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-InterruptedDueToReplStateChange.json deleted file mode 100644 index 4387451ce6c..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-InterruptedDueToReplStateChange.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "Stale topologyVersion InterruptedDueToReplStateChange error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale InterruptedDueToReplStateChange error (topologyVersion less)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedDueToReplStateChange", - "code": 11602, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "0" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale InterruptedDueToReplStateChange error (topologyVersion equal)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "InterruptedDueToReplStateChange", - "code": 11602, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-LegacyNotPrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-LegacyNotPrimary.json deleted file mode 100644 index 8c0cf00f22c..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-LegacyNotPrimary.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "Stale topologyVersion LegacyNotPrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale LegacyNotPrimary error (topologyVersion less)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "LegacyNotPrimary", - "code": 10058, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "0" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale LegacyNotPrimary error (topologyVersion equal)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "LegacyNotPrimary", - "code": 10058, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-NotPrimaryNoSecondaryOk.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-NotPrimaryNoSecondaryOk.json deleted file mode 100644 index 99a828326ca..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-NotPrimaryNoSecondaryOk.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "Stale topologyVersion NotPrimaryNoSecondaryOk error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotPrimaryNoSecondaryOk error (topologyVersion less)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryNoSecondaryOk", - "code": 13435, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "0" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotPrimaryNoSecondaryOk error (topologyVersion equal)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryNoSecondaryOk", - "code": 13435, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-NotPrimaryOrSecondary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-NotPrimaryOrSecondary.json deleted file mode 100644 index ba2ea87106b..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-NotPrimaryOrSecondary.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "Stale topologyVersion NotPrimaryOrSecondary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotPrimaryOrSecondary error (topologyVersion less)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryOrSecondary", - "code": 13436, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "0" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotPrimaryOrSecondary error (topologyVersion equal)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotPrimaryOrSecondary", - "code": 13436, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-NotWritablePrimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-NotWritablePrimary.json deleted file mode 100644 index 8edd317a73e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-NotWritablePrimary.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "Stale topologyVersion NotWritablePrimary error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotWritablePrimary error (topologyVersion less)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotWritablePrimary", - "code": 10107, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "0" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale NotWritablePrimary error (topologyVersion equal)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "NotWritablePrimary", - "code": 10107, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-PrimarySteppedDown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-PrimarySteppedDown.json deleted file mode 100644 index da8e4755ebe..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-PrimarySteppedDown.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "Stale topologyVersion PrimarySteppedDown error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale PrimarySteppedDown error (topologyVersion less)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "PrimarySteppedDown", - "code": 189, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "0" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale PrimarySteppedDown error (topologyVersion equal)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "PrimarySteppedDown", - "code": 189, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-ShutdownInProgress.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-ShutdownInProgress.json deleted file mode 100644 index aa252e1dc4f..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/stale-topologyVersion-ShutdownInProgress.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "Stale topologyVersion ShutdownInProgress error", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale ShutdownInProgress error (topologyVersion less)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "ShutdownInProgress", - "code": 91, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "0" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore stale ShutdownInProgress error (topologyVersion equal)", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 0, - "errmsg": "ShutdownInProgress", - "code": 91, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/write_errors_ignored.json b/driver-core/src/test/resources/server-discovery-and-monitoring/errors/write_errors_ignored.json deleted file mode 100644 index b588807e08a..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/errors/write_errors_ignored.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "description": "writeErrors field is ignored", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "description": "Primary A is discovered", - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "description": "Ignore command error with writeErrors field", - "applicationErrors": [ - { - "address": "a:27017", - "when": "afterHandshakeCompletes", - "maxWireVersion": 9, - "type": "command", - "response": { - "ok": 1, - "writeErrors": [ - { - "errmsg": "NotPrimaryNoSecondaryOk", - "code": 13435, - "index": 0 - } - ] - } - } - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - }, - "pool": { - "generation": 0 - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/load-balanced/discover_load_balancer.json b/driver-core/src/test/resources/server-discovery-and-monitoring/load-balanced/discover_load_balancer.json deleted file mode 100644 index d2e34478e64..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/load-balanced/discover_load_balancer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "description": "Load balancer can be discovered and only has the address property set", - "uri": "mongodb://a/?loadBalanced=true", - "phases": [ - { - "outcome": { - "servers": { - "a:27017": { - "type": "LoadBalancer", - "setName": null, - "setVersion": null, - "electionId": null, - "logicalSessionTimeoutMinutes": null, - "minWireVersion": null, - "maxWireVersion": null, - "topologyVersion": null - } - }, - "topologyType": "LoadBalanced", - "setName": null, - "logicalSessionTimeoutMinutes": null, - "maxSetVersion": null, - "maxElectionId": null, - "compatible": true - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/compatible.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/compatible.json deleted file mode 100644 index dfd5d57dfab..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/compatible.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "description": "Replica set member with large maxWireVersion", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 21 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 1000 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "setName": "rs", - "logicalSessionTimeoutMinutes": null, - "compatible": true - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/compatible_unknown.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/compatible_unknown.json deleted file mode 100644 index 95e03ea958e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/compatible_unknown.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "description": "Replica set member and an unknown server", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 21 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "setName": "rs", - "logicalSessionTimeoutMinutes": null, - "compatible": true - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_arbiters.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_arbiters.json deleted file mode 100644 index 53709b0cee9..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_arbiters.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "description": "Discover arbiters with directConnection URI option", - "uri": "mongodb://a/?directConnection=false", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "arbiters": [ - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.json deleted file mode 100644 index 64fb49f4fcd..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_arbiters_replicaset.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "description": "Discover arbiters with replicaSet URI option", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "arbiters": [ - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_ghost.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_ghost.json deleted file mode 100644 index 2e24c83e0b7..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_ghost.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "description": "Discover ghost with directConnection URI option", - "uri": "mongodb://b/?directConnection=false", - "phases": [ - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "isreplicaset": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "b:27017": { - "type": "RSGhost", - "setName": null - } - }, - "topologyType": "Unknown", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_ghost_replicaset.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_ghost_replicaset.json deleted file mode 100644 index cf5fe83a542..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_ghost_replicaset.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "description": "Discover ghost with replicaSet URI option", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "isreplicaset": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - }, - "b:27017": { - "type": "RSGhost", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_hidden.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_hidden.json deleted file mode 100644 index e4a90f1f9cd..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_hidden.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "description": "Discover hidden with directConnection URI option", - "uri": "mongodb://a/?directConnection=false", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hidden": true, - "hosts": [ - "c:27017", - "d:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSOther", - "setName": "rs" - }, - "c:27017": { - "type": "Unknown", - "setName": null - }, - "d:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_hidden_replicaset.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_hidden_replicaset.json deleted file mode 100644 index 04420596f00..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_hidden_replicaset.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "description": "Discover hidden with replicaSet URI option", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hidden": true, - "hosts": [ - "c:27017", - "d:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSOther", - "setName": "rs" - }, - "c:27017": { - "type": "Unknown", - "setName": null - }, - "d:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_passives.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_passives.json deleted file mode 100644 index 30258409f64..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_passives.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "description": "Discover passives with directConnection URI option", - "uri": "mongodb://a/?directConnection=false", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "passives": [ - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "passive": true, - "hosts": [ - "a:27017" - ], - "passives": [ - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_passives_replicaset.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_passives_replicaset.json deleted file mode 100644 index 266eaa52344..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_passives_replicaset.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "description": "Discover passives with replicaSet URI option", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "passives": [ - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "passive": true, - "hosts": [ - "a:27017" - ], - "passives": [ - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_primary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_primary.json deleted file mode 100644 index 2d1292bbd47..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_primary.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "description": "Discover primary with directConnection URI option", - "uri": "mongodb://a/?directConnection=false", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_primary_replicaset.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_primary_replicaset.json deleted file mode 100644 index 54dfefba5fd..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_primary_replicaset.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "description": "Discover primary with replicaSet URI option", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_rsother.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_rsother.json deleted file mode 100644 index 4ab25667f01..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_rsother.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "description": "Discover RSOther with directConnection URI option", - "uri": "mongodb://b/?directConnection=false", - "phases": [ - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": false, - "hosts": [ - "c:27017", - "d:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "b:27017": { - "type": "RSOther", - "setName": "rs" - }, - "c:27017": { - "type": "Unknown", - "setName": null - }, - "d:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_rsother_replicaset.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_rsother_replicaset.json deleted file mode 100644 index e3958d70adb..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_rsother_replicaset.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "description": "Discover RSOther with replicaSet URI option", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hidden": true, - "hosts": [ - "c:27017", - "d:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": false, - "hosts": [ - "c:27017", - "d:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSOther", - "setName": "rs" - }, - "b:27017": { - "type": "RSOther", - "setName": "rs" - }, - "c:27017": { - "type": "Unknown", - "setName": null - }, - "d:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_secondary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_secondary.json deleted file mode 100644 index 22325d4e03a..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_secondary.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "description": "Discover secondary with directConnection URI option", - "uri": "mongodb://b/?directConnection=false", - "phases": [ - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_secondary_replicaset.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_secondary_replicaset.json deleted file mode 100644 index d903b6444d7..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discover_secondary_replicaset.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "description": "Discover secondary with replicaSet URI option", - "uri": "mongodb://b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discovery.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discovery.json deleted file mode 100644 index 50e1269223a..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/discovery.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "description": "Replica set discovery", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017", - "c:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - }, - "c:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "primary": "d:27017", - "hosts": [ - "b:27017", - "c:27017", - "d:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "c:27017": { - "type": "Unknown", - "setName": null - }, - "d:27017": { - "type": "PossiblePrimary", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "d:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "b:27017", - "c:27017", - "d:27017", - "e:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "c:27017": { - "type": "Unknown", - "setName": null - }, - "d:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "e:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "c:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017", - "c:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "c:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "d:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "e:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/electionId_precedence_setVersion.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/electionId_precedence_setVersion.json deleted file mode 100644 index 25d2b180034..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/electionId_precedence_setVersion.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "description" : "ElectionId is considered higher precedence than setVersion", - "uri" : "mongodb://a/?replicaSet=rs", - "phases" : [ - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000001" - }, - "minWireVersion" : 0, - "maxWireVersion" : 17 - } - ], - [ - "b:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 2, - "electionId" : { - "$oid" : "000000000000000000000001" - }, - "minWireVersion" : 0, - "maxWireVersion" : 17 - } - ], - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000002" - }, - "minWireVersion" : 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000002" - } - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null, - "setVersion" : null, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1, - "maxElectionId" : { - "$oid" : "000000000000000000000002" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/equal_electionids.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/equal_electionids.json deleted file mode 100644 index 17df3207fa8..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/equal_electionids.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "description": "New primary with equal electionId", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null, - "setVersion": null, - "electionId": null - }, - "b:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000001" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/hosts_differ_from_seeds.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/hosts_differ_from_seeds.json deleted file mode 100644 index 4e02304c619..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/hosts_differ_from_seeds.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "description": "Host list differs from seeds", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/incompatible_arbiter.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/incompatible_arbiter.json deleted file mode 100644 index f0539cb3373..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/incompatible_arbiter.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "description": "Incompatible arbiter", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "arbiterOnly": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 1 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSArbiter", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "setName": "rs", - "logicalSessionTimeoutMinutes": null, - "compatible": false - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/incompatible_ghost.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/incompatible_ghost.json deleted file mode 100644 index 824e953f906..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/incompatible_ghost.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "description": "Incompatible ghost", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isreplicaset": true, - "minWireVersion": 0, - "maxWireVersion": 1 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSGhost", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "setName": "rs", - "logicalSessionTimeoutMinutes": null, - "compatible": false - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/incompatible_other.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/incompatible_other.json deleted file mode 100644 index 6f301ef5de3..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/incompatible_other.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "description": "Incompatible other", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "hidden": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 1 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSOther", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "setName": "rs", - "logicalSessionTimeoutMinutes": null, - "compatible": false - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/ls_timeout.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/ls_timeout.json deleted file mode 100644 index 96389d3b769..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/ls_timeout.json +++ /dev/null @@ -1,279 +0,0 @@ -{ - "description": "Parse logicalSessionTimeoutMinutes from replica set", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017", - "c:27017", - "d:27017", - "e:27017" - ], - "setName": "rs", - "logicalSessionTimeoutMinutes": 3, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown" - }, - "c:27017": { - "type": "Unknown" - }, - "d:27017": { - "type": "Unknown" - }, - "e:27017": { - "type": "Unknown" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": 3, - "setName": "rs" - } - }, - { - "responses": [ - [ - "d:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "isreplicaset": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown" - }, - "c:27017": { - "type": "Unknown" - }, - "d:27017": { - "type": "RSGhost" - }, - "e:27017": { - "type": "Unknown" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": 3, - "setName": "rs" - } - }, - { - "responses": [ - [ - "e:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "hosts": [ - "a:27017", - "b:27017", - "c:27017", - "d:27017", - "e:27017" - ], - "setName": "rs", - "arbiterOnly": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown" - }, - "c:27017": { - "type": "Unknown" - }, - "d:27017": { - "type": "RSGhost" - }, - "e:27017": { - "type": "RSArbiter", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": 3, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hosts": [ - "a:27017", - "b:27017", - "c:27017", - "d:27017", - "e:27017" - ], - "setName": "rs", - "logicalSessionTimeoutMinutes": 2, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "c:27017": { - "type": "Unknown" - }, - "d:27017": { - "type": "RSGhost" - }, - "e:27017": { - "type": "RSArbiter", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": 2, - "setName": "rs" - } - }, - { - "responses": [ - [ - "c:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "setName": "rs", - "hidden": true, - "logicalSessionTimeoutMinutes": 1, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "c:27017": { - "type": "RSOther", - "setName": "rs" - }, - "d:27017": { - "type": "RSGhost" - }, - "e:27017": { - "type": "RSArbiter", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": 2, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hosts": [ - "a:27017", - "b:27017", - "c:27017", - "d:27017", - "e:27017" - ], - "setName": "rs", - "logicalSessionTimeoutMinutes": null, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "c:27017": { - "type": "RSOther", - "setName": "rs" - }, - "d:27017": { - "type": "RSGhost" - }, - "e:27017": { - "type": "RSArbiter", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/member_reconfig.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/member_reconfig.json deleted file mode 100644 index 0e2c2c462ea..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/member_reconfig.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "description": "Member removed by reconfig", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/member_standalone.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/member_standalone.json deleted file mode 100644 index 0756003a89f..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/member_standalone.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "description": "Member brought up as standalone", - "uri": "mongodb://a,b", - "phases": [ - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "Unknown", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/new_primary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/new_primary.json deleted file mode 100644 index ed1a6245f96..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/new_primary.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "description": "New primary", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - }, - "b:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/new_primary_new_electionid.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/new_primary_new_electionid.json deleted file mode 100644 index ccb3a41f757..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/new_primary_new_electionid.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "New primary with greater setVersion and electionId", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - } - }, - "b:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000001" - } - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000002" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - }, - "b:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000002" - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000002" - } - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - }, - "b:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000002" - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000002" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/new_primary_new_setversion.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/new_primary_new_setversion.json deleted file mode 100644 index 415a0f66aa9..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/new_primary_new_setversion.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "New primary with greater setVersion", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - } - }, - "b:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000001" - } - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 2, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - }, - "b:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 2, - "electionId": { - "$oid": "000000000000000000000001" - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 2, - "maxElectionId": { - "$oid": "000000000000000000000001" - } - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - }, - "b:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 2, - "electionId": { - "$oid": "000000000000000000000001" - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 2, - "maxElectionId": { - "$oid": "000000000000000000000001" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/new_primary_wrong_set_name.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/new_primary_wrong_set_name.json deleted file mode 100644 index d7b19cfe8f1..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/new_primary_wrong_set_name.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "description": "New primary with wrong setName", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "wrong", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/non_rs_member.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/non_rs_member.json deleted file mode 100644 index 538077ef099..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/non_rs_member.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "description": "Non replicaSet member responds", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/normalize_case.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/normalize_case.json deleted file mode 100644 index 96a944f0c35..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/normalize_case.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "description": "Replica set case normalization", - "uri": "mongodb://A/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "A:27017" - ], - "passives": [ - "B:27017" - ], - "arbiters": [ - "C:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - }, - "c:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/normalize_case_me.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/normalize_case_me.json deleted file mode 100644 index ab1720cefc0..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/normalize_case_me.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "description": "Replica set mixed case normalization", - "uri": "mongodb://A/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "me": "A:27017", - "hosts": [ - "A:27017" - ], - "passives": [ - "B:27017" - ], - "arbiters": [ - "C:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - }, - "c:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "me": "B:27017", - "hosts": [ - "A:27017" - ], - "passives": [ - "B:27017" - ], - "arbiters": [ - "C:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "c:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/null_election_id-pre-6.0.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/null_election_id-pre-6.0.json deleted file mode 100644 index 5adc1482ead..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/null_election_id-pre-6.0.json +++ /dev/null @@ -1,203 +0,0 @@ -{ - "description" : "Pre 6.0 Primaries with and without electionIds", - "uri" : "mongodb://a/?replicaSet=rs", - "phases" : [ - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017", - "c:27017" - ], - "setVersion" : 1, - "setName" : "rs", - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : null - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - }, - "c:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1 - } - }, - { - "responses" : [ - [ - "b:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017", - "c:27017" - ], - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000002" - }, - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - }, - "b:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000002" - } - }, - "c:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1, - "maxElectionId" : { - "$oid" : "000000000000000000000002" - } - } - }, - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017", - "c:27017" - ], - "setVersion" : 1, - "setName" : "rs", - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : null - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - }, - "c:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1, - "maxElectionId" : { - "$oid" : "000000000000000000000002" - } - } - }, - { - "responses" : [ - [ - "c:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017", - "c:27017" - ], - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000001" - }, - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : null - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - }, - "c:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1, - "maxElectionId" : { - "$oid" : "000000000000000000000002" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/null_election_id.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/null_election_id.json deleted file mode 100644 index d8901f40693..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/null_election_id.json +++ /dev/null @@ -1,209 +0,0 @@ -{ - "description": "Primaries with and without electionIds", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017", - "c:27017" - ], - "setVersion": 1, - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 1, - "electionId": null - }, - "b:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - }, - "c:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1 - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017", - "c:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000002" - }, - "minWireVersion": 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - }, - "b:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000002" - } - }, - "c:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000002" - } - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017", - "c:27017" - ], - "setVersion": 1, - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome": { - "servers": { - "a:27017" : { - "type" : "Unknown", - "setName" : null, - "setVersion" : null, - "electionId" : null - }, - "b:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000002" - } - }, - "c:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000002" - } - } - }, - { - "responses": [ - [ - "c:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017", - "c:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome": { - "servers": { - "a:27017" : { - "type" : "Unknown", - "setName" : null, - "setVersion" : null, - "electionId" : null - }, - "b:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000002" - } - }, - "c:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000002" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_becomes_ghost.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_becomes_ghost.json deleted file mode 100644 index 9c54b39856e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_becomes_ghost.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "description": "Primary becomes ghost", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "isreplicaset": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSGhost", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_becomes_mongos.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_becomes_mongos.json deleted file mode 100644 index ac416e57d5f..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_becomes_mongos.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "description": "Primary becomes mongos", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": {}, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_becomes_standalone.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_becomes_standalone.json deleted file mode 100644 index a64524d0ca4..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_becomes_standalone.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "description": "Primary becomes standalone", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": {}, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_changes_set_name.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_changes_set_name.json deleted file mode 100644 index bf70ca3014b..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_changes_set_name.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "description": "Primary changes setName", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "wrong", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": {}, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_disconnect.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_disconnect.json deleted file mode 100644 index 3db854f0859..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_disconnect.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "description": "Disconnected from primary", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - {} - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_disconnect_electionid.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_disconnect_electionid.json deleted file mode 100644 index 3a80b150fe3..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_disconnect_electionid.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "description": "Disconnected from primary, reject primary with stale electionId", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000002" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - }, - "b:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000002" - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000002" - } - } - }, - { - "responses": [ - [ - "b:27017", - {} - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - }, - "b:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000002" - } - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - }, - "b:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000002" - } - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000003" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000003" - } - }, - "b:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000003" - } - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000003" - } - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000003" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_disconnect_setversion.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_disconnect_setversion.json deleted file mode 100644 index 32e03fb7d4b..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_disconnect_setversion.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "description": "Disconnected from primary, reject primary with stale setVersion", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 2, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - }, - "b:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 2, - "electionId": { - "$oid": "000000000000000000000001" - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 2, - "maxElectionId": { - "$oid": "000000000000000000000001" - } - } - }, - { - "responses": [ - [ - "b:27017", - {} - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - }, - "b:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 2, - "maxElectionId": { - "$oid": "000000000000000000000001" - } - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - }, - "b:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 2, - "maxElectionId": { - "$oid": "000000000000000000000001" - } - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 2, - "electionId": { - "$oid": "000000000000000000000002" - }, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 2, - "electionId": { - "$oid": "000000000000000000000002" - } - }, - "b:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 2, - "maxElectionId": { - "$oid": "000000000000000000000002" - } - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 2, - "electionId": { - "$oid": "000000000000000000000002" - } - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 2, - "maxElectionId": { - "$oid": "000000000000000000000002" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_hint_from_secondary_with_mismatched_me.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_hint_from_secondary_with_mismatched_me.json deleted file mode 100644 index bc02cc95712..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_hint_from_secondary_with_mismatched_me.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "description": "Secondary with mismatched 'me' tells us who the primary is", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "me": "c:27017", - "hosts": [ - "b:27017" - ], - "setName": "rs", - "primary": "b:27017", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "b:27017": { - "type": "PossiblePrimary", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "me": "b:27017", - "hosts": [ - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "b:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_mismatched_me.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_mismatched_me.json deleted file mode 100644 index 2d2c0f40d8d..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_mismatched_me.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "description": "Primary mismatched me", - "phases": [ - { - "outcome": { - "servers": { - "a:27017": { - "setName": null, - "type": "Unknown" - }, - "b:27017": { - "setName": null, - "type": "Unknown" - } - }, - "setName": "rs", - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null - }, - "responses": [ - [ - "localhost:27017", - { - "me": "a:27017", - "hosts": [ - "a:27017", - "b:27017" - ], - "helloOk": true, - "isWritablePrimary": true, - "ok": 1, - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ] - } - ], - "uri": "mongodb://localhost:27017/?replicaSet=rs" -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_mismatched_me_not_removed.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_mismatched_me_not_removed.json deleted file mode 100644 index 4c400936594..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_mismatched_me_not_removed.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "description": "Primary mismatched me is not removed", - "uri": "mongodb://localhost:27017,localhost:27018/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "localhost:27017", - { - "ok": 1, - "hosts": [ - "localhost:27017", - "localhost:27018" - ], - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "primary": "localhost:27017", - "me": "a:27017", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "localhost:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "localhost:27018": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "localhost:27018", - { - "ok": 1, - "hosts": [ - "localhost:27017", - "localhost:27018" - ], - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "primary": "localhost:27017", - "me": "localhost:27018", - "minWireVersion": 0, - "maxWireVersion": 7 - } - ] - ], - "outcome": { - "servers": { - "localhost:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "localhost:27018": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_reports_new_member.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_reports_new_member.json deleted file mode 100644 index ac0d9374f0d..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_reports_new_member.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "description": "Primary reports a new member", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "b:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017", - "c:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "b:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "c:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "c:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "primary": "b:27017", - "hosts": [ - "a:27017", - "b:27017", - "c:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSSecondary", - "setName": "rs" - }, - "b:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "c:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_to_no_primary_mismatched_me.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_to_no_primary_mismatched_me.json deleted file mode 100644 index 6dbd73dadc1..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_to_no_primary_mismatched_me.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "description": "Primary to no primary with mismatched me", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "me": "a:27017", - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "c:27017", - "d:27017" - ], - "me": "c:27017", - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "c:27017": { - "type": "Unknown", - "setName": null - }, - "d:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_wrong_set_name.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_wrong_set_name.json deleted file mode 100644 index cc0691fb8c7..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/primary_wrong_set_name.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "description": "Primary wrong setName", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "wrong", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": {}, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/repeated.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/repeated.json deleted file mode 100644 index 610aeae0ac7..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/repeated.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "description": "Repeated isWritablePrimary response must be processed", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hidden": true, - "hosts": [ - "a:27017", - "c:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSOther", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown" - }, - "c:27017": { - "type": "Unknown" - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "c:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSOther", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown" - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hidden": true, - "hosts": [ - "a:27017", - "c:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSOther", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown" - }, - "c:27017": { - "type": "Unknown" - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "c:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "c:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSOther", - "setName": "rs" - }, - "c:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/replicaset_rsnp.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/replicaset_rsnp.json deleted file mode 100644 index 3148e1c141f..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/replicaset_rsnp.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "description": "replicaSet URI option causes starting topology to be RSNP", - "uri": "mongodb://a/?replicaSet=rs&directConnection=false", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": {}, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/response_from_removed.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/response_from_removed.json deleted file mode 100644 index 87a66d9e728..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/response_from_removed.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "description": "Response from removed server", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/sec_not_auth.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/sec_not_auth.json deleted file mode 100644 index a39855e654a..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/sec_not_auth.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "description": "Secondary's host list is not authoritative", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "hosts": [ - "b:27017", - "c:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_ignore_ok_0-pre-6.0.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_ignore_ok_0-pre-6.0.json deleted file mode 100644 index aa52a577e79..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_ignore_ok_0-pre-6.0.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "description" : "Pre 6.0 New primary", - "uri" : "mongodb://a,b/?replicaSet=rs", - "phases" : [ - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "setName" : "rs", - "hosts" : [ - "a:27017", - "b:27017" - ], - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ], - [ - "b:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : false, - "secondary" : true, - "setName" : "rs", - "hosts" : [ - "a:27017", - "b:27017" - ], - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs" - }, - "b:27017" : { - "type" : "RSSecondary", - "setName" : "rs" - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs" - } - }, - { - "responses" : [ - [ - "b:27017", - { - "ok" : 0, - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs" - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_ignore_ok_0.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_ignore_ok_0.json deleted file mode 100644 index 28381ee12a0..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_ignore_ok_0.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "description" : "Secondary ignored when ok is zero", - "uri" : "mongodb://a,b/?replicaSet=rs", - "phases" : [ - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "setName" : "rs", - "hosts" : [ - "a:27017", - "b:27017" - ], - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 0, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_mismatched_me.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_mismatched_me.json deleted file mode 100644 index 6f1b9b59866..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_mismatched_me.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "description": "Secondary mismatched me", - "uri": "mongodb://localhost:27017/?replicaSet=rs", - "phases": [ - { - "outcome": { - "servers": { - "a:27017": { - "setName": null, - "type": "Unknown" - }, - "b:27017": { - "setName": null, - "type": "Unknown" - } - }, - "setName": "rs", - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null - }, - "responses": [ - [ - "localhost:27017", - { - "me": "a:27017", - "hosts": [ - "a:27017", - "b:27017" - ], - "helloOk": true, - "isWritablePrimary": false, - "ok": 1, - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ] - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_wrong_set_name.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_wrong_set_name.json deleted file mode 100644 index 8d2f152f594..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_wrong_set_name.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "description": "Secondary wrong setName", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hosts": [ - "a:27017" - ], - "setName": "wrong", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": {}, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_wrong_set_name_with_primary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_wrong_set_name_with_primary.json deleted file mode 100644 index b7ef2d6d6ab..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/secondary_wrong_set_name_with_primary.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "description": "Secondary wrong setName with primary", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "wrong", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/set_version_can_rollback.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/set_version_can_rollback.json deleted file mode 100644 index e605e2d5eb1..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/set_version_can_rollback.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description" : "Set version rolls back after new primary with higher election Id", - "uri" : "mongodb://a/?replicaSet=rs", - "phases" : [ - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 2, - "electionId" : { - "$oid" : "000000000000000000000001" - }, - "minWireVersion" : 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 2, - "electionId" : { - "$oid" : "000000000000000000000001" - } - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 2, - "maxElectionId" : { - "$oid" : "000000000000000000000001" - } - } - }, - { - "responses" : [ - [ - "b:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000002" - }, - "minWireVersion" : 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - }, - "b:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000002" - } - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1, - "maxElectionId" : { - "$oid" : "000000000000000000000002" - } - } - }, - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 2, - "electionId" : { - "$oid" : "000000000000000000000001" - }, - "minWireVersion" : 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - }, - "b:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000002" - } - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1, - "maxElectionId" : { - "$oid" : "000000000000000000000002" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/setversion_equal_max_without_electionid.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/setversion_equal_max_without_electionid.json deleted file mode 100644 index 95283095523..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/setversion_equal_max_without_electionid.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "description" : "setVersion version that is equal is treated the same as greater than if there is no electionId", - "uri" : "mongodb://a/?replicaSet=rs", - "phases" : [ - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 1, - "minWireVersion" : 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : null - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1 - } - }, - { - "responses" : [ - [ - "b:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 1, - "minWireVersion" : 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - }, - "b:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1 - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/setversion_greaterthan_max_without_electionid.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/setversion_greaterthan_max_without_electionid.json deleted file mode 100644 index 3adca17009f..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/setversion_greaterthan_max_without_electionid.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "description" : "setVersion that is greater than maxSetVersion is used if there is no electionId", - "uri" : "mongodb://a/?replicaSet=rs", - "phases" : [ - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 1, - "minWireVersion" : 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : null - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1 - } - }, - { - "responses" : [ - [ - "b:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 2, - "minWireVersion" : 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - }, - "b:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 2, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 2 - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/setversion_without_electionid-pre-6.0.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/setversion_without_electionid-pre-6.0.json deleted file mode 100644 index 9342d681082..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/setversion_without_electionid-pre-6.0.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "description" : "Pre 6.0 setVersion is ignored if there is no electionId", - "uri" : "mongodb://a/?replicaSet=rs", - "phases" : [ - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 2, - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 2, - "electionId" : null - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 2 - } - }, - { - "responses" : [ - [ - "b:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 1, - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - }, - "b:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 2 - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/setversion_without_electionid.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/setversion_without_electionid.json deleted file mode 100644 index 8db13bf9228..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/setversion_without_electionid.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "description" : "setVersion that is less than maxSetVersion is ignored if there is no electionId", - "uri" : "mongodb://a/?replicaSet=rs", - "phases" : [ - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 2, - "minWireVersion" : 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 2, - "electionId": null - }, - "b:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 2 - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "minWireVersion": 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome": { - "servers": { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 2, - "electionId" : null - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 2 - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/stepdown_change_set_name.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/stepdown_change_set_name.json deleted file mode 100644 index e9075f97f22..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/stepdown_change_set_name.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "description": "Primary becomes a secondary with wrong setName", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hosts": [ - "a:27017" - ], - "setName": "wrong", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": {}, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/too_new.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/too_new.json deleted file mode 100644 index 0433d27a368..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/too_new.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "description": "Replica set member with large minWireVersion", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 999, - "maxWireVersion": 1000 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "setName": "rs", - "logicalSessionTimeoutMinutes": null, - "compatible": false - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/too_old.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/too_old.json deleted file mode 100644 index 461d00acc4c..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/too_old.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "description": "Replica set member with default maxWireVersion of 0", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ], - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "setName": "rs", - "hosts": [ - "a:27017", - "b:27017" - ] - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - }, - "b:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "ReplicaSetWithPrimary", - "setName": "rs", - "logicalSessionTimeoutMinutes": null, - "compatible": false - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/topology_version_equal.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/topology_version_equal.json deleted file mode 100644 index d3baa13479d..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/topology_version_equal.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "description": "Primary with equal topologyVersion", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - }, - "b:27017": { - "type": "Unknown", - "topologyVersion": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/topology_version_greater.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/topology_version_greater.json deleted file mode 100644 index f296ccee627..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/topology_version_greater.json +++ /dev/null @@ -1,259 +0,0 @@ -{ - "description": "Primary with newer topologyVersion", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "2" - } - } - }, - "b:27017": { - "type": "Unknown", - "topologyVersion": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "c:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "0" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000002" - }, - "counter": { - "$numberLong": "0" - } - } - }, - "c:27017": { - "type": "Unknown", - "topologyVersion": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "d:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": null - }, - "d:27017": { - "type": "Unknown", - "topologyVersion": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "e:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000003" - }, - "counter": { - "$numberLong": "0" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000003" - }, - "counter": { - "$numberLong": "0" - } - } - }, - "e:27017": { - "type": "Unknown", - "topologyVersion": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - {} - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "topologyVersion": null - }, - "e:27017": { - "type": "Unknown", - "topologyVersion": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/topology_version_less.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/topology_version_less.json deleted file mode 100644 index 435337ff25e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/topology_version_less.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "description": "Primary with older topologyVersion", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 9, - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "0" - } - } - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "topologyVersion": { - "processId": { - "$oid": "000000000000000000000001" - }, - "counter": { - "$numberLong": "1" - } - } - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/unexpected_mongos.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/unexpected_mongos.json deleted file mode 100644 index cc19a961f2c..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/unexpected_mongos.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "description": "Unexpected mongos", - "uri": "mongodb://b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": {}, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/use_setversion_without_electionid-pre-6.0.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/use_setversion_without_electionid-pre-6.0.json deleted file mode 100644 index 786d859efbe..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/use_setversion_without_electionid-pre-6.0.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "description" : "Pre 6.0 Record max setVersion, even from primary without electionId", - "uri" : "mongodb://a/?replicaSet=rs", - "phases" : [ - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000001" - }, - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000001" - } - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1, - "maxElectionId" : { - "$oid" : "000000000000000000000001" - } - } - }, - { - "responses" : [ - [ - "b:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 2, - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - }, - "b:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 2 - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 2, - "maxElectionId" : { - "$oid" : "000000000000000000000001" - } - } - }, - { - "responses" : [ - [ - "a:27017", - { - "ok" : 1, - "helloOk" : true, - "isWritablePrimary" : true, - "hosts" : [ - "a:27017", - "b:27017" - ], - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000002" - }, - "minWireVersion" : 0, - "maxWireVersion" : 6 - } - ] - ], - "outcome" : { - "servers" : { - "a:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - }, - "b:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 2 - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 2, - "maxElectionId" : { - "$oid" : "000000000000000000000001" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/use_setversion_without_electionid.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/use_setversion_without_electionid.json deleted file mode 100644 index 5d66300f844..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/use_setversion_without_electionid.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "description": "Record max setVersion, even from primary without electionId", - "uri": "mongodb://a/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - }, - "minWireVersion": 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000001" - } - }, - "b:27017": { - "type": "Unknown", - "setName": null, - "electionId": null - } - }, - "topologyType": "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs", - "maxSetVersion": 1, - "maxElectionId": { - "$oid": "000000000000000000000001" - } - } - }, - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 2, - "minWireVersion": 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome": { - "servers": { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000001" - } - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1, - "maxElectionId" : { - "$oid" : "000000000000000000000001" - } - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "setVersion": 1, - "electionId": { - "$oid": "000000000000000000000002" - }, - "minWireVersion": 0, - "maxWireVersion" : 17 - } - ] - ], - "outcome": { - "servers": { - "a:27017" : { - "type" : "RSPrimary", - "setName" : "rs", - "setVersion" : 1, - "electionId" : { - "$oid" : "000000000000000000000002" - } - }, - "b:27017" : { - "type" : "Unknown", - "setName" : null, - "electionId" : null - } - }, - "topologyType" : "ReplicaSetWithPrimary", - "logicalSessionTimeoutMinutes" : null, - "setName" : "rs", - "maxSetVersion" : 1, - "maxElectionId" : { - "$oid" : "000000000000000000000002" - } - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/wrong_set_name.json b/driver-core/src/test/resources/server-discovery-and-monitoring/rs/wrong_set_name.json deleted file mode 100644 index 9654ff7b79b..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/rs/wrong_set_name.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "description": "Wrong setName", - "uri": "mongodb://a,b/?replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hosts": [ - "b:27017", - "c:27017" - ], - "setName": "wrong", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "ReplicaSetNoPrimary", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/compatible.json b/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/compatible.json deleted file mode 100644 index ceb0ec24c4c..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/compatible.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "description": "Multiple mongoses with large maxWireVersion", - "uri": "mongodb://a,b", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 1000 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 21 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Mongos", - "setName": null - }, - "b:27017": { - "type": "Mongos", - "setName": null - } - }, - "topologyType": "Sharded", - "logicalSessionTimeoutMinutes": null, - "setName": null, - "compatible": true - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/discover_single_mongos.json b/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/discover_single_mongos.json deleted file mode 100644 index 9e877a0840d..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/discover_single_mongos.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "description": "Discover single mongos", - "uri": "mongodb://a/?directConnection=false", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Mongos", - "setName": null - } - }, - "topologyType": "Sharded", - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/ls_timeout_mongos.json b/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/ls_timeout_mongos.json deleted file mode 100644 index 93fa398d52e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/ls_timeout_mongos.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "description": "Parse logicalSessionTimeoutMinutes from mongoses", - "uri": "mongodb://a,b", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "logicalSessionTimeoutMinutes": 1, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "logicalSessionTimeoutMinutes": 2, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Mongos", - "setName": null - }, - "b:27017": { - "type": "Mongos", - "setName": null - } - }, - "topologyType": "Sharded", - "logicalSessionTimeoutMinutes": 1, - "setName": null - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "logicalSessionTimeoutMinutes": 1, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Mongos", - "setName": null - }, - "b:27017": { - "type": "Mongos", - "setName": null - } - }, - "topologyType": "Sharded", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/mongos_disconnect.json b/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/mongos_disconnect.json deleted file mode 100644 index 50a93eda5ff..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/mongos_disconnect.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "Mongos disconnect", - "uri": "mongodb://a,b", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Mongos", - "setName": null - }, - "b:27017": { - "type": "Mongos", - "setName": null - } - }, - "topologyType": "Sharded", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - }, - { - "responses": [ - [ - "a:27017", - {} - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - }, - "b:27017": { - "type": "Mongos", - "setName": null - } - }, - "topologyType": "Sharded", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Mongos", - "setName": null - }, - "b:27017": { - "type": "Mongos", - "setName": null - } - }, - "topologyType": "Sharded", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/multiple_mongoses.json b/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/multiple_mongoses.json deleted file mode 100644 index 311592d715a..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/multiple_mongoses.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "description": "Multiple mongoses", - "uri": "mongodb://a,b", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Mongos", - "setName": null - }, - "b:27017": { - "type": "Mongos", - "setName": null - } - }, - "topologyType": "Sharded", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/non_mongos_removed.json b/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/non_mongos_removed.json deleted file mode 100644 index d74375ebbfd..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/non_mongos_removed.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "description": "Non-Mongos server in sharded cluster", - "uri": "mongodb://a,b", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Mongos", - "setName": null - } - }, - "topologyType": "Sharded", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/normalize_uri_case.json b/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/normalize_uri_case.json deleted file mode 100644 index 4aa7cb08b61..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/normalize_uri_case.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "description": "Normalize URI case", - "uri": "mongodb://A,B", - "phases": [ - { - "responses": [], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - }, - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "Unknown", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/too_new.json b/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/too_new.json deleted file mode 100644 index 4b997d21639..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/too_new.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "description": "Multiple mongoses with large minWireVersion", - "uri": "mongodb://a,b", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 999, - "maxWireVersion": 1000 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid" - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Mongos", - "setName": null - }, - "b:27017": { - "type": "Mongos", - "setName": null - } - }, - "topologyType": "Sharded", - "logicalSessionTimeoutMinutes": null, - "setName": null, - "compatible": false - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/too_old.json b/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/too_old.json deleted file mode 100644 index 688e1db0f5a..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/sharded/too_old.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "description": "Multiple mongoses with default maxWireVersion of 0", - "uri": "mongodb://a,b", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 2, - "maxWireVersion": 6 - } - ], - [ - "b:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid" - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Mongos", - "setName": null - }, - "b:27017": { - "type": "Mongos", - "setName": null - } - }, - "topologyType": "Sharded", - "logicalSessionTimeoutMinutes": null, - "setName": null, - "compatible": false - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/compatible.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/compatible.json deleted file mode 100644 index 493d9b748e6..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/compatible.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "description": "Standalone with large maxWireVersion", - "uri": "mongodb://a", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 21 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Standalone", - "setName": null - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null, - "compatible": true - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_external_ip.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_external_ip.json deleted file mode 100644 index 90676a8f9b0..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_external_ip.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "description": "Direct connection to RSPrimary via external IP", - "uri": "mongodb://a/?directConnection=true", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_mongos.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_mongos.json deleted file mode 100644 index 25fe9651856..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_mongos.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "description": "Direct connection to mongos", - "uri": "mongodb://a/?directConnection=true", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "msg": "isdbgrid", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Mongos", - "setName": null - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_replicaset.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_replicaset.json deleted file mode 100644 index cd8660888a0..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_replicaset.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "description": "Direct connection with replicaSet URI option", - "uri": "mongodb://a/?replicaSet=rs&directConnection=true", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_rsarbiter.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_rsarbiter.json deleted file mode 100644 index e2049560566..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_rsarbiter.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "description": "Direct connection to RSArbiter", - "uri": "mongodb://a/?directConnection=true", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "arbiterOnly": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSArbiter", - "setName": "rs" - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_rsprimary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_rsprimary.json deleted file mode 100644 index 409e8502b3c..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_rsprimary.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "description": "Direct connection to RSPrimary", - "uri": "mongodb://a/?directConnection=true", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_rssecondary.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_rssecondary.json deleted file mode 100644 index 305f283b527..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_rssecondary.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "description": "Direct connection to RSSecondary", - "uri": "mongodb://a/?directConnection=true", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": false, - "secondary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSSecondary", - "setName": "rs" - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_standalone.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_standalone.json deleted file mode 100644 index b47278482a7..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_standalone.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "description": "Direct connection to standalone", - "uri": "mongodb://a/?directConnection=true", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Standalone", - "setName": null - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_unavailable_seed.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_unavailable_seed.json deleted file mode 100644 index 16f2735da54..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_unavailable_seed.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Direct connection to unavailable seed", - "uri": "mongodb://a/?directConnection=true", - "phases": [ - { - "responses": [ - [ - "a:27017", - {} - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_wrong_set_name.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_wrong_set_name.json deleted file mode 100644 index 71080e6810e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/direct_connection_wrong_set_name.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "description": "Direct connection to RSPrimary with wrong set name", - "uri": "mongodb://a/?directConnection=true&replicaSet=rs", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "wrong", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown" - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "hosts": [ - "a:27017", - "b:27017" - ], - "setName": "rs", - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "RSPrimary", - "setName": "rs" - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": "rs" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/discover_standalone.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/discover_standalone.json deleted file mode 100644 index 858cbdaf638..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/discover_standalone.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "description": "Discover standalone", - "uri": "mongodb://a/?directConnection=false", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Standalone", - "setName": null - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/discover_unavailable_seed.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/discover_unavailable_seed.json deleted file mode 100644 index b1f306c2be6..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/discover_unavailable_seed.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "description": "Discover unavailable seed", - "uri": "mongodb://a/?directConnection=false", - "phases": [ - { - "responses": [ - [ - "a:27017", - {} - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "Unknown", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/ls_timeout_standalone.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/ls_timeout_standalone.json deleted file mode 100644 index 87b3e4e8a10..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/ls_timeout_standalone.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "description": "Parse logicalSessionTimeoutMinutes from standalone", - "uri": "mongodb://a", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "logicalSessionTimeoutMinutes": 7, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Standalone", - "setName": null - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": 7, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/not_ok_response.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/not_ok_response.json deleted file mode 100644 index 8e7c2a10e37..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/not_ok_response.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "description": "Handle a not-ok isWritablePrimary response", - "uri": "mongodb://a", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ], - [ - "a:27017", - { - "ok": 0, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/standalone_removed.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/standalone_removed.json deleted file mode 100644 index 57f8f861b18..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/standalone_removed.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "description": "Standalone removed from multi-server topology", - "uri": "mongodb://a,b", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "b:27017": { - "type": "Unknown", - "setName": null - } - }, - "topologyType": "Unknown", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/standalone_using_legacy_hello.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/standalone_using_legacy_hello.json deleted file mode 100644 index 46660fa8de5..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/standalone_using_legacy_hello.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "description": "Connect to standalone using legacy hello", - "uri": "mongodb://a", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "ismaster": true, - "minWireVersion": 0, - "maxWireVersion": 6 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Standalone", - "setName": null - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/too_new.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/too_new.json deleted file mode 100644 index 8dd57d33483..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/too_new.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "description": "Standalone with large minWireVersion", - "uri": "mongodb://a", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 999, - "maxWireVersion": 1000 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Standalone", - "setName": null - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null, - "compatible": false - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/too_old.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/too_old.json deleted file mode 100644 index 8c027e01db6..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/too_old.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "description": "Standalone with default maxWireVersion of 0", - "uri": "mongodb://a", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Standalone", - "setName": null - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null, - "compatible": false - } - } - ] -} diff --git a/driver-core/src/test/resources/server-discovery-and-monitoring/single/too_old_then_upgraded.json b/driver-core/src/test/resources/server-discovery-and-monitoring/single/too_old_then_upgraded.json deleted file mode 100644 index c3dd98cf62e..00000000000 --- a/driver-core/src/test/resources/server-discovery-and-monitoring/single/too_old_then_upgraded.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "description": "Standalone with default maxWireVersion of 0 is upgraded to one with maxWireVersion 21", - "uri": "mongodb://a", - "phases": [ - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Standalone", - "setName": null - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null, - "compatible": false - } - }, - { - "responses": [ - [ - "a:27017", - { - "ok": 1, - "helloOk": true, - "isWritablePrimary": true, - "minWireVersion": 0, - "maxWireVersion": 21 - } - ] - ], - "outcome": { - "servers": { - "a:27017": { - "type": "Standalone", - "setName": null - } - }, - "topologyType": "Single", - "logicalSessionTimeoutMinutes": null, - "setName": null, - "compatible": true - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/in_window/equilibrium.json b/driver-core/src/test/resources/server-selection/in_window/equilibrium.json deleted file mode 100644 index c5f177d49b9..00000000000 --- a/driver-core/src/test/resources/server-selection/in_window/equilibrium.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "description": "When in equilibrium selection is evenly distributed", - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "b:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "c:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "mocked_topology_state": [ - { - "address": "a:27017", - "operation_count": 5 - }, - { - "address": "b:27017", - "operation_count": 5 - }, - { - "address": "c:27017", - "operation_count": 5 - } - ], - "iterations": 2000, - "outcome": { - "tolerance": 0.05, - "expected_frequencies": { - "a:27017": 0.33, - "b:27017": 0.33, - "c:27017": 0.33 - } - } -} diff --git a/driver-core/src/test/resources/server-selection/in_window/many-choices.json b/driver-core/src/test/resources/server-selection/in_window/many-choices.json deleted file mode 100644 index 7e940513ef6..00000000000 --- a/driver-core/src/test/resources/server-selection/in_window/many-choices.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "description": "Selections from many choices occur at correct frequencies", - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "b:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "c:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "d:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "e:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "f:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "g:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "i:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "mocked_topology_state": [ - { - "address": "a:27017", - "operation_count": 0 - }, - { - "address": "b:27017", - "operation_count": 5 - }, - { - "address": "c:27017", - "operation_count": 5 - }, - { - "address": "d:27017", - "operation_count": 10 - }, - { - "address": "e:27017", - "operation_count": 10 - }, - { - "address": "f:27017", - "operation_count": 20 - }, - { - "address": "g:27017", - "operation_count": 20 - }, - { - "address": "h:27017", - "operation_count": 50 - }, - { - "address": "i:27017", - "operation_count": 60 - } - ], - "iterations": 10000, - "outcome": { - "tolerance": 0.03, - "expected_frequencies": { - "a:27017": 0.22, - "b:27017": 0.18, - "c:27017": 0.18, - "d:27017": 0.125, - "e:27017": 0.125, - "f:27017": 0.074, - "g:27017": 0.074, - "h:27017": 0.0277, - "i:27017": 0 - } - } -} diff --git a/driver-core/src/test/resources/server-selection/in_window/one-least-two-tied.json b/driver-core/src/test/resources/server-selection/in_window/one-least-two-tied.json deleted file mode 100644 index ed7526e7166..00000000000 --- a/driver-core/src/test/resources/server-selection/in_window/one-least-two-tied.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "description": "Least operations gets most selections, two tied share the rest", - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "b:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "c:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "mocked_topology_state": [ - { - "address": "a:27017", - "operation_count": 16 - }, - { - "address": "b:27017", - "operation_count": 10 - }, - { - "address": "c:27017", - "operation_count": 16 - } - ], - "iterations": 2000, - "outcome": { - "tolerance": 0.05, - "expected_frequencies": { - "a:27017": 0.165, - "b:27017": 0.66, - "c:27017": 0.165 - } - } -} diff --git a/driver-core/src/test/resources/server-selection/in_window/rs-equilibrium.json b/driver-core/src/test/resources/server-selection/in_window/rs-equilibrium.json deleted file mode 100644 index 61c6687e500..00000000000 --- a/driver-core/src/test/resources/server-selection/in_window/rs-equilibrium.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "description": "When in equilibrium selection is evenly distributed (replica set)", - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 35, - "type": "RSPrimary" - }, - { - "address": "b:27017", - "avg_rtt_ms": 35, - "type": "RSSecondary" - }, - { - "address": "c:27017", - "avg_rtt_ms": 35, - "type": "RSSecondary" - } - ] - }, - "mocked_topology_state": [ - { - "address": "a:27017", - "operation_count": 6 - }, - { - "address": "b:27017", - "operation_count": 6 - }, - { - "address": "c:27017", - "operation_count": 6 - } - ], - "iterations": 2000, - "outcome": { - "tolerance": 0.05, - "expected_frequencies": { - "a:27017": 0.33, - "b:27017": 0.33, - "c:27017": 0.33 - } - } -} diff --git a/driver-core/src/test/resources/server-selection/in_window/rs-three-choices.json b/driver-core/src/test/resources/server-selection/in_window/rs-three-choices.json deleted file mode 100644 index 3fdc15205ce..00000000000 --- a/driver-core/src/test/resources/server-selection/in_window/rs-three-choices.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "description": "Selections from three servers occur at proper distributions (replica set)", - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 35, - "type": "RSPrimary" - }, - { - "address": "b:27017", - "avg_rtt_ms": 35, - "type": "RSSecondary" - }, - { - "address": "c:27017", - "avg_rtt_ms": 35, - "type": "RSSecondary" - } - ] - }, - "mocked_topology_state": [ - { - "address": "a:27017", - "operation_count": 3 - }, - { - "address": "b:27017", - "operation_count": 6 - }, - { - "address": "c:27017", - "operation_count": 20 - } - ], - "iterations": 2000, - "outcome": { - "tolerance": 0.05, - "expected_frequencies": { - "a:27017": 0.66, - "b:27017": 0.33, - "c:27017": 0 - } - } -} diff --git a/driver-core/src/test/resources/server-selection/in_window/three-choices.json b/driver-core/src/test/resources/server-selection/in_window/three-choices.json deleted file mode 100644 index 7b5b414549d..00000000000 --- a/driver-core/src/test/resources/server-selection/in_window/three-choices.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "description": "Selections from three servers occur at proper distributions", - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "b:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "c:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "mocked_topology_state": [ - { - "address": "a:27017", - "operation_count": 3 - }, - { - "address": "b:27017", - "operation_count": 6 - }, - { - "address": "c:27017", - "operation_count": 20 - } - ], - "iterations": 2000, - "outcome": { - "tolerance": 0.05, - "expected_frequencies": { - "a:27017": 0.66, - "b:27017": 0.33, - "c:27017": 0 - } - } -} diff --git a/driver-core/src/test/resources/server-selection/in_window/two-choices.json b/driver-core/src/test/resources/server-selection/in_window/two-choices.json deleted file mode 100644 index 2c7a605d8d7..00000000000 --- a/driver-core/src/test/resources/server-selection/in_window/two-choices.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "description": "Better of two choices always selected", - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "b:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "mocked_topology_state": [ - { - "address": "a:27017", - "operation_count": 0 - }, - { - "address": "b:27017", - "operation_count": 5 - } - ], - "iterations": 100, - "outcome": { - "tolerance": 0, - "expected_frequencies": { - "a:27017": 1, - "b:27017": 0 - } - } -} diff --git a/driver-core/src/test/resources/server-selection/in_window/two-least.json b/driver-core/src/test/resources/server-selection/in_window/two-least.json deleted file mode 100644 index 73214fc6472..00000000000 --- a/driver-core/src/test/resources/server-selection/in_window/two-least.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "description": "Two tied for least operations share all selections", - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "b:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - }, - { - "address": "c:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "mocked_topology_state": [ - { - "address": "a:27017", - "operation_count": 10 - }, - { - "address": "b:27017", - "operation_count": 10 - }, - { - "address": "c:27017", - "operation_count": 16 - } - ], - "iterations": 2000, - "outcome": { - "tolerance": 0.05, - "expected_frequencies": { - "a:27017": 0.5, - "b:27017": 0.5, - "c:27017": 0 - } - } -} diff --git a/driver-core/src/test/resources/server-selection/rtt/first_value.json b/driver-core/src/test/resources/server-selection/rtt/first_value.json deleted file mode 100755 index 421944da366..00000000000 --- a/driver-core/src/test/resources/server-selection/rtt/first_value.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "avg_rtt_ms": "NULL", - "new_rtt_ms": 10, - "new_avg_rtt": 10 -} diff --git a/driver-core/src/test/resources/server-selection/rtt/first_value_zero.json b/driver-core/src/test/resources/server-selection/rtt/first_value_zero.json deleted file mode 100755 index d5bfc41b25d..00000000000 --- a/driver-core/src/test/resources/server-selection/rtt/first_value_zero.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "avg_rtt_ms": "NULL", - "new_rtt_ms": 0, - "new_avg_rtt": 0 -} diff --git a/driver-core/src/test/resources/server-selection/rtt/value_test_1.json b/driver-core/src/test/resources/server-selection/rtt/value_test_1.json deleted file mode 100755 index ed6a80ce29b..00000000000 --- a/driver-core/src/test/resources/server-selection/rtt/value_test_1.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "avg_rtt_ms": 0, - "new_rtt_ms": 5, - "new_avg_rtt": 1 -} diff --git a/driver-core/src/test/resources/server-selection/rtt/value_test_2.json b/driver-core/src/test/resources/server-selection/rtt/value_test_2.json deleted file mode 100755 index ccb5a0173b6..00000000000 --- a/driver-core/src/test/resources/server-selection/rtt/value_test_2.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "avg_rtt_ms": 3.1, - "new_rtt_ms": 36, - "new_avg_rtt": 9.68 -} diff --git a/driver-core/src/test/resources/server-selection/rtt/value_test_3.json b/driver-core/src/test/resources/server-selection/rtt/value_test_3.json deleted file mode 100755 index 6921c94d36c..00000000000 --- a/driver-core/src/test/resources/server-selection/rtt/value_test_3.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "avg_rtt_ms": 9.12, - "new_rtt_ms": 9.12, - "new_avg_rtt": 9.12 -} diff --git a/driver-core/src/test/resources/server-selection/rtt/value_test_4.json b/driver-core/src/test/resources/server-selection/rtt/value_test_4.json deleted file mode 100755 index d9ce3800b82..00000000000 --- a/driver-core/src/test/resources/server-selection/rtt/value_test_4.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "avg_rtt_ms": 1, - "new_rtt_ms": 1000, - "new_avg_rtt": 200.8 -} diff --git a/driver-core/src/test/resources/server-selection/rtt/value_test_5.json b/driver-core/src/test/resources/server-selection/rtt/value_test_5.json deleted file mode 100755 index 9ae33bc1434..00000000000 --- a/driver-core/src/test/resources/server-selection/rtt/value_test_5.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "avg_rtt_ms": 0, - "new_rtt_ms": 0.25, - "new_avg_rtt": 0.05 -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/Nearest.json b/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/Nearest.json deleted file mode 100644 index 76fa336d553..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/Nearest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "topology_description": { - "type": "LoadBalanced", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Nearest", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/Primary.json b/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/Primary.json deleted file mode 100644 index 5a4a0aa93ac..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/Primary.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "topology_description": { - "type": "LoadBalanced", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Primary" - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/PrimaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/PrimaryPreferred.json deleted file mode 100644 index 9aa151cd06e..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/PrimaryPreferred.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "topology_description": { - "type": "LoadBalanced", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "PrimaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/Secondary.json b/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/Secondary.json deleted file mode 100644 index c49e30370b4..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/Secondary.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "topology_description": { - "type": "LoadBalanced", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Secondary", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/SecondaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/SecondaryPreferred.json deleted file mode 100644 index 18e46877b49..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/read/SecondaryPreferred.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "topology_description": { - "type": "LoadBalanced", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/Nearest.json b/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/Nearest.json deleted file mode 100644 index e52e343332a..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/Nearest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "topology_description": { - "type": "LoadBalanced", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "Nearest", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/Primary.json b/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/Primary.json deleted file mode 100644 index 9061b25208e..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/Primary.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "topology_description": { - "type": "LoadBalanced", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "Primary" - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/PrimaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/PrimaryPreferred.json deleted file mode 100644 index 5c94dc410df..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/PrimaryPreferred.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "topology_description": { - "type": "LoadBalanced", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "PrimaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/Secondary.json b/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/Secondary.json deleted file mode 100644 index 5493867e12d..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/Secondary.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "topology_description": { - "type": "LoadBalanced", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "Secondary", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/SecondaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/SecondaryPreferred.json deleted file mode 100644 index f7905f1d5f6..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/LoadBalanced/write/SecondaryPreferred.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "topology_description": { - "type": "LoadBalanced", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 0, - "type": "LoadBalancer" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Nearest.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Nearest.json deleted file mode 100755 index aa48679e866..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Nearest.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Nearest", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Nearest_multiple.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Nearest_multiple.json deleted file mode 100644 index 1fcfd52a477..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Nearest_multiple.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 10, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 20, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Nearest", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 10, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 20, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "avg_rtt_ms": 10, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 20, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Nearest_non_matching.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Nearest_non_matching.json deleted file mode 100755 index b72895d8a83..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Nearest_non_matching.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Nearest", - "tag_sets": [ - { - "data_center": "sf" - } - ] - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/PossiblePrimary.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/PossiblePrimary.json deleted file mode 100644 index 4d286af830f..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/PossiblePrimary.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "PossiblePrimary" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Primary", - "tag_sets": [ - {} - ] - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/PossiblePrimaryNearest.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/PossiblePrimaryNearest.json deleted file mode 100644 index bf9c70b420e..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/PossiblePrimaryNearest.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "PossiblePrimary" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Nearest", - "tag_sets": [ - {} - ] - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Primary.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Primary.json deleted file mode 100755 index f0f3fa9ea15..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Primary.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Primary" - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/PrimaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/PrimaryPreferred.json deleted file mode 100755 index f87ef4f6170..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/PrimaryPreferred.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "PrimaryPreferred", - "tag_sets": [ - {} - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/PrimaryPreferred_non_matching.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/PrimaryPreferred_non_matching.json deleted file mode 100755 index ee962299270..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/PrimaryPreferred_non_matching.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "PrimaryPreferred", - "tag_sets": [ - { - "data_center": "sf" - } - ] - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Secondary.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Secondary.json deleted file mode 100755 index 3b8f1e97cd6..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Secondary.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Secondary", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/SecondaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/SecondaryPreferred.json deleted file mode 100755 index c3142ec1154..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/SecondaryPreferred.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/SecondaryPreferred_non_matching.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/SecondaryPreferred_non_matching.json deleted file mode 100755 index a2c18bb7d22..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/SecondaryPreferred_non_matching.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "sf" - } - ] - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Secondary_multi_tags.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Secondary_multi_tags.json deleted file mode 100644 index b319918e926..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Secondary_multi_tags.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "rack": "one", - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "rack": "two", - "data_center": "sf" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Secondary", - "tag_sets": [ - { - "data_center": "nyc", - "rack": "one" - }, - { - "other_tag": "doesntexist" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "rack": "one", - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "rack": "one", - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Secondary_multi_tags2.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Secondary_multi_tags2.json deleted file mode 100644 index 8f64d95ecb8..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Secondary_multi_tags2.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "rack": "one", - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "rack": "two", - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Secondary", - "tag_sets": [ - { - "data_center": "nyc", - "rack": "one" - }, - { - "other_tag": "doesntexist" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "rack": "one", - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "rack": "one", - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Secondary_non_matching.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Secondary_non_matching.json deleted file mode 100755 index 4931e1019a4..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/read/Secondary_non_matching.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Secondary", - "tag_sets": [ - { - "data_center": "sf" - } - ] - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/write/SecondaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/write/SecondaryPreferred.json deleted file mode 100755 index e136cf12a4f..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetNoPrimary/write/SecondaryPreferred.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetNoPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Nearest.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Nearest.json deleted file mode 100755 index cfe4965938d..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Nearest.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Nearest", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Nearest_multiple.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Nearest_multiple.json deleted file mode 100644 index 67296d434fe..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Nearest_multiple.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 10, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 20, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Nearest", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 10, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 20, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "avg_rtt_ms": 10, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 20, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Nearest_non_matching.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Nearest_non_matching.json deleted file mode 100755 index a3a85c9a83e..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Nearest_non_matching.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Nearest", - "tag_sets": [ - { - "data_center": "sf" - } - ] - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Primary.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Primary.json deleted file mode 100755 index 8da1482e967..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Primary.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Primary" - }, - "suitable_servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/PrimaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/PrimaryPreferred.json deleted file mode 100755 index 306171f3a20..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/PrimaryPreferred.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "PrimaryPreferred", - "tag_sets": [ - {} - ] - }, - "suitable_servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/PrimaryPreferred_non_matching.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/PrimaryPreferred_non_matching.json deleted file mode 100755 index 722f1cfb1a9..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/PrimaryPreferred_non_matching.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "PrimaryPreferred", - "tag_sets": [ - { - "data_center": "sf" - } - ] - }, - "suitable_servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Secondary.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Secondary.json deleted file mode 100755 index 23864a278c4..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Secondary.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Secondary", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred.json deleted file mode 100755 index d07c24218d3..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred_non_matching.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred_non_matching.json deleted file mode 100755 index f893cc9f828..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred_non_matching.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "sf" - } - ] - }, - "suitable_servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred_tags.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred_tags.json deleted file mode 100644 index a74a2dbf33b..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/SecondaryPreferred_tags.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 5, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "sf" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 5, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "avg_rtt_ms": 5, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Secondary_non_matching.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Secondary_non_matching.json deleted file mode 100755 index 12721806665..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/read/Secondary_non_matching.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Secondary", - "tag_sets": [ - { - "data_center": "sf" - } - ] - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/write/SecondaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/write/SecondaryPreferred.json deleted file mode 100755 index 65ab3dc6404..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/ReplicaSetWithPrimary/write/SecondaryPreferred.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "topology_description": { - "type": "ReplicaSetWithPrimary", - "servers": [ - { - "address": "b:27017", - "avg_rtt_ms": 5, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "c:27017", - "avg_rtt_ms": 100, - "type": "RSSecondary", - "tags": { - "data_center": "nyc" - } - }, - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "avg_rtt_ms": 26, - "type": "RSPrimary", - "tags": { - "data_center": "nyc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/Nearest.json b/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/Nearest.json deleted file mode 100644 index 705a784a0b1..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/Nearest.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Nearest", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/Primary.json b/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/Primary.json deleted file mode 100644 index 7a321be2bbd..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/Primary.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Primary" - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/PrimaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/PrimaryPreferred.json deleted file mode 100644 index e9bc1421f95..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/PrimaryPreferred.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "PrimaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/Secondary.json b/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/Secondary.json deleted file mode 100644 index 49813f7b9e3..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/Secondary.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Secondary", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/SecondaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/SecondaryPreferred.json deleted file mode 100755 index 62fa13f297d..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Sharded/read/SecondaryPreferred.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/Nearest.json b/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/Nearest.json deleted file mode 100644 index aef7f02ec70..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/Nearest.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "Nearest", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/Primary.json b/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/Primary.json deleted file mode 100644 index f6ce2e75c1b..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/Primary.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "Primary" - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/PrimaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/PrimaryPreferred.json deleted file mode 100644 index 25f56a53596..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/PrimaryPreferred.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "PrimaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/Secondary.json b/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/Secondary.json deleted file mode 100644 index 1fa026f716f..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/Secondary.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "Secondary", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/SecondaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/SecondaryPreferred.json deleted file mode 100755 index f9467472aa8..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Sharded/write/SecondaryPreferred.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "topology_description": { - "type": "Sharded", - "servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - }, - { - "address": "h:27017", - "avg_rtt_ms": 35, - "type": "Mongos" - } - ], - "in_latency_window": [ - { - "address": "g:27017", - "avg_rtt_ms": 5, - "type": "Mongos" - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Single/read/SecondaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/Single/read/SecondaryPreferred.json deleted file mode 100755 index e60496dfdfe..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Single/read/SecondaryPreferred.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "topology_description": { - "type": "Single", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 5, - "type": "Standalone", - "tags": { - "data_center": "dc" - } - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 5, - "type": "Standalone", - "tags": { - "data_center": "dc" - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "avg_rtt_ms": 5, - "type": "Standalone", - "tags": { - "data_center": "dc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Single/write/SecondaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/Single/write/SecondaryPreferred.json deleted file mode 100755 index 34fe91d5a21..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Single/write/SecondaryPreferred.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "topology_description": { - "type": "Single", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 5, - "type": "Standalone", - "tags": { - "data_center": "dc" - } - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 5, - "type": "Standalone", - "tags": { - "data_center": "dc" - } - } - ], - "in_latency_window": [ - { - "address": "a:27017", - "avg_rtt_ms": 5, - "type": "Standalone", - "tags": { - "data_center": "dc" - } - } - ] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Unknown/read/SecondaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/Unknown/read/SecondaryPreferred.json deleted file mode 100755 index 0ae8075fba3..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Unknown/read/SecondaryPreferred.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "topology_description": { - "type": "Unknown", - "servers": [] - }, - "operation": "read", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Unknown/read/ghost.json b/driver-core/src/test/resources/server-selection/server_selection/Unknown/read/ghost.json deleted file mode 100644 index 76d3d774e8d..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Unknown/read/ghost.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "topology_description": { - "type": "Unknown", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 5, - "type": "RSGhost" - } - ] - }, - "operation": "read", - "read_preference": { - "mode": "Nearest" - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Unknown/write/SecondaryPreferred.json b/driver-core/src/test/resources/server-selection/server_selection/Unknown/write/SecondaryPreferred.json deleted file mode 100755 index a70eece62cd..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Unknown/write/SecondaryPreferred.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "topology_description": { - "type": "Unknown", - "servers": [] - }, - "operation": "write", - "read_preference": { - "mode": "SecondaryPreferred", - "tag_sets": [ - { - "data_center": "nyc" - } - ] - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/server-selection/server_selection/Unknown/write/ghost.json b/driver-core/src/test/resources/server-selection/server_selection/Unknown/write/ghost.json deleted file mode 100644 index 65caa4cd0a9..00000000000 --- a/driver-core/src/test/resources/server-selection/server_selection/Unknown/write/ghost.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "topology_description": { - "type": "Unknown", - "servers": [ - { - "address": "a:27017", - "avg_rtt_ms": 5, - "type": "RSGhost" - } - ] - }, - "operation": "write", - "read_preference": { - "mode": "Nearest" - }, - "suitable_servers": [], - "in_latency_window": [] -} diff --git a/driver-core/src/test/resources/specifications b/driver-core/src/test/resources/specifications new file mode 160000 index 00000000000..a039bb4485b --- /dev/null +++ b/driver-core/src/test/resources/specifications @@ -0,0 +1 @@ +Subproject commit a039bb4485b56c30bcda6d318b83f07ad741fb95 diff --git a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/aggregate.json b/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/aggregate.json deleted file mode 100644 index 68a3467c71c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/aggregate.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "description": "aggregate", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "driverdata" - } - } - ], - "tests": [ - { - "description": "Aggregate with pipeline (project, sort, limit)", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 0 - } - }, - { - "$sort": { - "a": 1 - } - }, - { - "$limit": 2 - } - ] - }, - "expectResult": [ - { - "a": 1, - "b": 2, - "c": 3 - }, - { - "a": 2, - "b": 3, - "c": 4 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "driverdata" - }, - "commandName": "aggregate", - "databaseName": "test" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/estimatedDocumentCount.json b/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/estimatedDocumentCount.json deleted file mode 100644 index b7515a44182..00000000000 --- a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/estimatedDocumentCount.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "description": "estimatedDocumentCount", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "driverdata" - } - } - ], - "tests": [ - { - "description": "estimatedDocumentCount succeeds", - "operations": [ - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 15 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "driverdata" - }, - "commandName": "count", - "databaseName": "test" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/find.json b/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/find.json deleted file mode 100644 index d0652dc720f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/find.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "description": "find", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "driverdata" - } - } - ], - "tests": [ - { - "description": "Find with projection and sort", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "b": { - "$gt": 5 - } - }, - "projection": { - "_id": 0 - }, - "sort": { - "a": 1 - }, - "limit": 5 - }, - "expectResult": [ - { - "a": 5, - "b": 6, - "c": 7 - }, - { - "a": 6, - "b": 7, - "c": 8 - }, - { - "a": 7, - "b": 8, - "c": 9 - }, - { - "a": 8, - "b": 9, - "c": 10 - }, - { - "a": 9, - "b": 10, - "c": 11 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "driverdata" - }, - "commandName": "find", - "databaseName": "test" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/getMore.json b/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/getMore.json deleted file mode 100644 index e7c600d5258..00000000000 --- a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/getMore.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "description": "getMore", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "driverdata" - } - } - ], - "tests": [ - { - "description": "A successful find event with getMore", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "a": { - "$gte": 2 - } - }, - "sort": { - "a": 1 - }, - "batchSize": 3, - "limit": 4 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "driverdata", - "filter": { - "a": { - "$gte": 2 - } - }, - "sort": { - "a": 1 - }, - "batchSize": 3, - "limit": 4 - }, - "commandName": "find", - "databaseName": "test" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": { - "$$type": "string" - }, - "batchSize": 3 - }, - "commandName": "getMore", - "databaseName": "cursors" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/listCollections.json b/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/listCollections.json deleted file mode 100644 index 642e7ed328a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/listCollections.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "description": "listCollections", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "test" - } - } - ], - "tests": [ - { - "description": "ListCollections succeeds", - "operations": [ - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - }, - "commandName": "listCollections", - "databaseName": "test" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/listDatabases.json b/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/listDatabases.json deleted file mode 100644 index 64506ee54e4..00000000000 --- a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/listDatabases.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "description": "listDatabases", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ], - "tests": [ - { - "description": "ListCollections succeeds", - "operations": [ - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - }, - "commandName": "listDatabases", - "databaseName": "admin" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/runCommand.json b/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/runCommand.json deleted file mode 100644 index 325b6b3f30a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/atlas-data-lake-testing/runCommand.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "description": "runCommand", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "test" - } - } - ], - "tests": [ - { - "description": "ping succeeds using runCommand", - "operations": [ - { - "object": "database0", - "name": "runCommand", - "arguments": { - "command": { - "ping": 1 - }, - "commandName": "ping" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "commandName": "ping", - "databaseName": "test" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/auth/mongodb-oidc-no-retry.json b/driver-core/src/test/resources/unified-test-format/auth/mongodb-oidc-no-retry.json deleted file mode 100644 index eac17137f2f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/auth/mongodb-oidc-no-retry.json +++ /dev/null @@ -1,422 +0,0 @@ -{ - "description": "MONGODB-OIDC authentication with retry disabled", - "schemaVersion": "1.19", - "runOnRequirements": [ - { - "minServerVersion": "7.0", - "auth": true, - "authMechanism": "MONGODB-OIDC", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client0", - "uriOptions": { - "authMechanism": "MONGODB-OIDC", - "authMechanismProperties": { - "$$placeholder": 1 - }, - "retryReads": false, - "retryWrites": false - }, - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collName" - } - } - ], - "initialData": [ - { - "collectionName": "collName", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "A read operation should succeed", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {} - }, - "expectResult": [] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collName", - "filter": {} - } - } - }, - { - "commandSucceededEvent": { - "commandName": "find" - } - } - ] - } - ] - }, - { - "description": "A write operation should succeed", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "collName", - "documents": [ - { - "_id": 1, - "x": 1 - } - ] - } - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "Read commands should reauthenticate and retry when a ReauthenticationRequired error happens", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 391 - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {} - }, - "expectResult": [] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collName", - "filter": {} - } - } - }, - { - "commandFailedEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collName", - "filter": {} - } - } - }, - { - "commandSucceededEvent": { - "commandName": "find" - } - } - ] - } - ] - }, - { - "description": "Write commands should reauthenticate and retry when a ReauthenticationRequired error happens", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 391 - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "collName", - "documents": [ - { - "_id": 1, - "x": 1 - } - ] - } - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "collName", - "documents": [ - { - "_id": 1, - "x": 1 - } - ] - } - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "Handshake with cached token should use speculative authentication", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "x": 1 - } - }, - "expectError": { - "isClientError": true - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "saslStart" - ], - "errorCode": 18 - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "collName", - "documents": [ - { - "_id": 1, - "x": 1 - } - ] - } - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "collName", - "documents": [ - { - "_id": 1, - "x": 1 - } - ] - } - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "Handshake without cached token should not use speculative authentication", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "saslStart" - ], - "errorCode": 18 - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "x": 1 - } - }, - "expectError": { - "errorCode": 18 - } - } - ] - } - ] -} \ No newline at end of file diff --git a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-clusterTime.json b/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-clusterTime.json deleted file mode 100644 index 2b09e548f1d..00000000000 --- a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-clusterTime.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "description": "change-streams-clusterTime", - "schemaVersion": "1.4", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - } - ], - "runOnRequirements": [ - { - "minServerVersion": "4.0.0", - "topologies": [ - "replicaset", - "load-balanced", - "sharded" - ], - "serverless": "forbid" - } - ], - "initialData": [ - { - "collectionName": "collection0", - "databaseName": "database0", - "documents": [] - } - ], - "tests": [ - { - "description": "clusterTime is present", - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "ns": { - "db": "database0", - "coll": "collection0" - }, - "clusterTime": { - "$$exists": true - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-disambiguatedPaths.json b/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-disambiguatedPaths.json deleted file mode 100644 index e6cc5ef66ed..00000000000 --- a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-disambiguatedPaths.json +++ /dev/null @@ -1,251 +0,0 @@ -{ - "description": "disambiguatedPaths", - "schemaVersion": "1.4", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - } - ], - "runOnRequirements": [ - { - "minServerVersion": "6.1.0", - "topologies": [ - "replicaset", - "load-balanced", - "sharded" - ], - "serverless": "forbid" - } - ], - "initialData": [ - { - "collectionName": "collection0", - "databaseName": "database0", - "documents": [] - } - ], - "tests": [ - { - "description": "disambiguatedPaths is not present when showExpandedEvents is false/unset", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": { - "1": 1 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "a.1": 2 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "updateDescription": { - "updatedFields": { - "$$exists": true - }, - "removedFields": { - "$$exists": true - }, - "truncatedArrays": { - "$$exists": true - }, - "disambiguatedPaths": { - "$$exists": false - } - } - } - } - ] - }, - { - "description": "disambiguatedPaths is present on updateDescription when an ambiguous path is present", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": { - "1": 1 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "showExpandedEvents": true - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "a.1": 2 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "updateDescription": { - "updatedFields": { - "$$exists": true - }, - "removedFields": { - "$$exists": true - }, - "truncatedArrays": { - "$$exists": true - }, - "disambiguatedPaths": { - "a.1": [ - "a", - "1" - ] - } - } - } - } - ] - }, - { - "description": "disambiguatedPaths returns array indices as integers", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": [ - { - "1": 1 - } - ] - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "showExpandedEvents": true - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "a.0.1": 2 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "updateDescription": { - "updatedFields": { - "$$exists": true - }, - "removedFields": { - "$$exists": true - }, - "truncatedArrays": { - "$$exists": true - }, - "disambiguatedPaths": { - "a.0.1": [ - "a", - { - "$$type": "int" - }, - "1" - ] - } - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-errors.json b/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-errors.json deleted file mode 100644 index 65e99e541ed..00000000000 --- a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-errors.json +++ /dev/null @@ -1,246 +0,0 @@ -{ - "description": "change-streams-errors", - "schemaVersion": "1.7", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ], - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "globalClient", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - }, - { - "database": { - "id": "globalDatabase0", - "client": "globalClient", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "globalCollection0", - "database": "globalDatabase0", - "collectionName": "collection0" - } - } - ], - "initialData": [ - { - "collectionName": "collection0", - "databaseName": "database0", - "documents": [] - } - ], - "tests": [ - { - "description": "The watch helper must not throw a custom exception when executed against a single server topology, but instead depend on a server error", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "topologies": [ - "single" - ] - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "expectError": { - "errorCode": 40573 - } - } - ] - }, - { - "description": "Change Stream should error when an invalid aggregation stage is passed in", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$unsupported": "foo" - } - ] - }, - "expectError": { - "errorCode": 40324 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - }, - { - "$unsupported": "foo" - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Change Stream should error when _id is projected out", - "runOnRequirements": [ - { - "minServerVersion": "4.1.11", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 0 - } - } - ] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "z": 3 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectError": { - "errorCode": 280 - } - } - ] - }, - { - "description": "change stream errors on ElectionInProgress", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 216, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "z": 3 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectError": { - "errorCode": 216 - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-pre_and_post_images.json b/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-pre_and_post_images.json deleted file mode 100644 index e62fc034596..00000000000 --- a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-pre_and_post_images.json +++ /dev/null @@ -1,827 +0,0 @@ -{ - "description": "change-streams-pre_and_post_images", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "6.0.0", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "collMod", - "insert", - "update", - "getMore", - "killCursors" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "change-stream-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "change-stream-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ], - "tests": [ - { - "description": "fullDocument:whenAvailable with changeStreamPreAndPostImages enabled", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "collMod", - "command": { - "collMod": "test", - "changeStreamPreAndPostImages": { - "enabled": true - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "fullDocument": "whenAvailable" - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "change-stream-tests", - "coll": "test" - }, - "updateDescription": { - "$$type": "object" - }, - "fullDocument": { - "_id": 1, - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$changeStream": { - "fullDocument": "whenAvailable" - } - } - ] - } - } - } - ] - } - ] - }, - { - "description": "fullDocument:whenAvailable with changeStreamPreAndPostImages disabled", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "collMod", - "command": { - "collMod": "test", - "changeStreamPreAndPostImages": { - "enabled": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "fullDocument": "whenAvailable" - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "change-stream-tests", - "coll": "test" - }, - "updateDescription": { - "$$type": "object" - }, - "fullDocument": null - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$changeStream": { - "fullDocument": "whenAvailable" - } - } - ] - } - } - } - ] - } - ] - }, - { - "description": "fullDocument:required with changeStreamPreAndPostImages enabled", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "collMod", - "command": { - "collMod": "test", - "changeStreamPreAndPostImages": { - "enabled": true - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "fullDocument": "required" - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "change-stream-tests", - "coll": "test" - }, - "updateDescription": { - "$$type": "object" - }, - "fullDocument": { - "_id": 1, - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$changeStream": { - "fullDocument": "required" - } - } - ] - } - } - } - ] - } - ] - }, - { - "description": "fullDocument:required with changeStreamPreAndPostImages disabled", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "collMod", - "command": { - "collMod": "test", - "changeStreamPreAndPostImages": { - "enabled": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "fullDocument": "required" - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$changeStream": { - "fullDocument": "required" - } - } - ] - } - } - } - ] - } - ] - }, - { - "description": "fullDocumentBeforeChange:whenAvailable with changeStreamPreAndPostImages enabled", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "collMod", - "command": { - "collMod": "test", - "changeStreamPreAndPostImages": { - "enabled": true - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "fullDocumentBeforeChange": "whenAvailable" - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "change-stream-tests", - "coll": "test" - }, - "updateDescription": { - "$$type": "object" - }, - "fullDocumentBeforeChange": { - "_id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$changeStream": { - "fullDocumentBeforeChange": "whenAvailable" - } - } - ] - } - } - } - ] - } - ] - }, - { - "description": "fullDocumentBeforeChange:whenAvailable with changeStreamPreAndPostImages disabled", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "collMod", - "command": { - "collMod": "test", - "changeStreamPreAndPostImages": { - "enabled": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "fullDocumentBeforeChange": "whenAvailable" - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "change-stream-tests", - "coll": "test" - }, - "updateDescription": { - "$$type": "object" - }, - "fullDocumentBeforeChange": null - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$changeStream": { - "fullDocumentBeforeChange": "whenAvailable" - } - } - ] - } - } - } - ] - } - ] - }, - { - "description": "fullDocumentBeforeChange:required with changeStreamPreAndPostImages enabled", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "collMod", - "command": { - "collMod": "test", - "changeStreamPreAndPostImages": { - "enabled": true - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "fullDocumentBeforeChange": "required" - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "change-stream-tests", - "coll": "test" - }, - "updateDescription": { - "$$type": "object" - }, - "fullDocumentBeforeChange": { - "_id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$changeStream": { - "fullDocumentBeforeChange": "required" - } - } - ] - } - } - } - ] - } - ] - }, - { - "description": "fullDocumentBeforeChange:required with changeStreamPreAndPostImages disabled", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "collMod", - "command": { - "collMod": "test", - "changeStreamPreAndPostImages": { - "enabled": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "fullDocumentBeforeChange": "required" - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$changeStream": { - "fullDocumentBeforeChange": "required" - } - } - ] - } - } - } - ] - } - ] - }, - { - "description": "fullDocumentBeforeChange:off with changeStreamPreAndPostImages enabled", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "collMod", - "command": { - "collMod": "test", - "changeStreamPreAndPostImages": { - "enabled": true - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "fullDocumentBeforeChange": "off" - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "change-stream-tests", - "coll": "test" - }, - "updateDescription": { - "$$type": "object" - }, - "fullDocumentBeforeChange": { - "$$exists": false - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$changeStream": { - "fullDocumentBeforeChange": "off" - } - } - ] - } - } - } - ] - } - ] - }, - { - "description": "fullDocumentBeforeChange:off with changeStreamPreAndPostImages disabled", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "collMod", - "command": { - "collMod": "test", - "changeStreamPreAndPostImages": { - "enabled": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "fullDocumentBeforeChange": "off" - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "change-stream-tests", - "coll": "test" - }, - "updateDescription": { - "$$type": "object" - }, - "fullDocumentBeforeChange": { - "$$exists": false - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$changeStream": { - "fullDocumentBeforeChange": "off" - } - } - ] - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-resume-allowlist.json b/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-resume-allowlist.json deleted file mode 100644 index 1ec72b432be..00000000000 --- a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-resume-allowlist.json +++ /dev/null @@ -1,2348 +0,0 @@ -{ - "description": "change-streams-resume-allowlist", - "schemaVersion": "1.7", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ], - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "globalClient", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - }, - { - "database": { - "id": "globalDatabase0", - "client": "globalClient", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "globalCollection0", - "database": "globalDatabase0", - "collectionName": "collection0" - } - } - ], - "tests": [ - { - "description": "change stream resumes after a network error", - "runOnRequirements": [ - { - "minServerVersion": "4.2" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "closeConnection": true - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after HostUnreachable", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 6, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after HostNotFound", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 7, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after NetworkTimeout", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 89, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after ShutdownInProgress", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 91, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after PrimarySteppedDown", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 189, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after ExceededTimeLimit", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 262, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after SocketException", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 9001, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after NotWritablePrimary", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 10107, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after InterruptedAtShutdown", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 11600, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after InterruptedDueToReplStateChange", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 11602, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after NotPrimaryNoSecondaryOk", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 13435, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after NotPrimaryOrSecondary", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 13436, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after StaleShardVersion", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 63, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after StaleEpoch", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 150, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after RetryChangeStream", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 234, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after FailedToSatisfyReadPreference", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 133, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after CursorNotFound", - "runOnRequirements": [ - { - "minServerVersion": "4.2" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 43, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-resume-errorLabels.json b/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-resume-errorLabels.json deleted file mode 100644 index 7fd70108f07..00000000000 --- a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-resume-errorLabels.json +++ /dev/null @@ -1,2130 +0,0 @@ -{ - "description": "change-streams-resume-errorlabels", - "schemaVersion": "1.7", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ], - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "globalClient", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - }, - { - "database": { - "id": "globalDatabase0", - "client": "globalClient", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "globalCollection0", - "database": "globalDatabase0", - "collectionName": "collection0" - } - } - ], - "tests": [ - { - "description": "change stream resumes after HostUnreachable", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 6, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after HostNotFound", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 7, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after NetworkTimeout", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 89, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 91, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 189, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after ExceededTimeLimit", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 262, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after SocketException", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 9001, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after NotWritablePrimary", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 10107, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after InterruptedAtShutdown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 11600, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after InterruptedDueToReplStateChange", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 11602, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after NotPrimaryNoSecondaryOk", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 13435, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after NotPrimaryOrSecondary", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 13436, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after StaleShardVersion", - "runOnRequirements": [ - { - "maxServerVersion": "6.0.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 63, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after StaleEpoch", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 150, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after RetryChangeStream", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 234, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes after FailedToSatisfyReadPreference", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failGetMoreAfterCursorCheckout", - "mode": { - "times": 1 - }, - "data": { - "errorCode": 133, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream resumes if error contains ResumableChangeStreamError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 50, - "closeConnection": false, - "errorLabels": [ - "ResumableChangeStreamError" - ] - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$exists": true - }, - "collection": "collection0" - }, - "commandName": "getMore", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "resumeAfter": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "change stream does not resume if error does not contain ResumableChangeStreamError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 6, - "closeConnection": false - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectError": { - "errorCode": 6 - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-showExpandedEvents.json b/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-showExpandedEvents.json deleted file mode 100644 index b9594e0c1e1..00000000000 --- a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams-showExpandedEvents.json +++ /dev/null @@ -1,516 +0,0 @@ -{ - "description": "change-streams-showExpandedEvents", - "schemaVersion": "1.7", - "runOnRequirements": [ - { - "minServerVersion": "6.0.0", - "topologies": [ - "replicaset", - "sharded" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ], - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - }, - { - "database": { - "id": "database1", - "client": "client0", - "databaseName": "database1" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "collection1" - } - }, - { - "database": { - "id": "shardedDb", - "client": "client0", - "databaseName": "shardedDb" - } - }, - { - "database": { - "id": "adminDb", - "client": "client0", - "databaseName": "admin" - } - }, - { - "collection": { - "id": "shardedCollection", - "database": "shardedDb", - "collectionName": "shardedCollection" - } - } - ], - "initialData": [ - { - "collectionName": "collection0", - "databaseName": "database0", - "documents": [] - } - ], - "tests": [ - { - "description": "when provided, showExpandedEvents is sent as a part of the aggregate command", - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "showExpandedEvents": true - }, - "saveResultAsEntity": "changeStream0" - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "showExpandedEvents": true - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "when omitted, showExpandedEvents is not sent as a part of the aggregate command", - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "showExpandedEvents": { - "$$exists": false - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "when showExpandedEvents is true, new fields on change stream events are handled appropriately", - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "foo" - } - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "collection": "foo" - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "showExpandedEvents": true - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "a": 1 - } - } - }, - { - "name": "createIndex", - "object": "collection0", - "arguments": { - "keys": { - "x": 1 - }, - "name": "x_1" - } - }, - { - "name": "rename", - "object": "collection0", - "arguments": { - "to": "foo", - "dropTarget": true - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "collectionUUID": { - "$$exists": true - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "createIndexes", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "operationDescription": { - "$$exists": true - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "rename", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "to": { - "db": "database0", - "coll": "foo" - }, - "operationDescription": { - "dropTarget": { - "$$exists": true - }, - "to": { - "db": "database0", - "coll": "foo" - } - } - } - } - ] - }, - { - "description": "when showExpandedEvents is true, createIndex events are reported", - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "operationType": { - "$ne": "create" - } - } - } - ], - "showExpandedEvents": true - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "createIndex", - "object": "collection0", - "arguments": { - "keys": { - "x": 1 - }, - "name": "x_1" - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "createIndexes" - } - } - ] - }, - { - "description": "when showExpandedEvents is true, dropIndexes events are reported", - "operations": [ - { - "name": "createIndex", - "object": "collection0", - "arguments": { - "keys": { - "x": 1 - }, - "name": "x_1" - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "showExpandedEvents": true - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "dropIndex", - "object": "collection0", - "arguments": { - "name": "x_1" - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "dropIndexes" - } - } - ] - }, - { - "description": "when showExpandedEvents is true, create events are reported", - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "foo" - } - }, - { - "name": "createChangeStream", - "object": "database0", - "arguments": { - "pipeline": [], - "showExpandedEvents": true - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "collection": "foo" - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "create" - } - } - ] - }, - { - "description": "when showExpandedEvents is true, create events on views are reported", - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "foo" - } - }, - { - "name": "createChangeStream", - "object": "database0", - "arguments": { - "pipeline": [], - "showExpandedEvents": true - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "collection": "foo", - "viewOn": "testName" - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "create" - } - } - ] - }, - { - "description": "when showExpandedEvents is true, modify events are reported", - "operations": [ - { - "name": "createIndex", - "object": "collection0", - "arguments": { - "keys": { - "x": 1 - }, - "name": "x_2" - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "showExpandedEvents": true - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "runCommand", - "object": "database0", - "arguments": { - "command": { - "collMod": "collection0" - }, - "commandName": "collMod" - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "modify" - } - } - ] - }, - { - "description": "when showExpandedEvents is true, shardCollection events are reported", - "runOnRequirements": [ - { - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "dropCollection", - "object": "shardedDb", - "arguments": { - "collection": "shardedCollection" - } - }, - { - "name": "createCollection", - "object": "shardedDb", - "arguments": { - "collection": "shardedCollection" - } - }, - { - "name": "createChangeStream", - "object": "shardedCollection", - "arguments": { - "pipeline": [], - "showExpandedEvents": true - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "runCommand", - "object": "adminDb", - "arguments": { - "command": { - "shardCollection": "shardedDb.shardedCollection", - "key": { - "_id": 1 - } - }, - "commandName": "shardCollection" - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "shardCollection" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams.json b/driver-core/src/test/resources/unified-test-format/change-streams/change-streams.json deleted file mode 100644 index c8b60ed4e25..00000000000 --- a/driver-core/src/test/resources/unified-test-format/change-streams/change-streams.json +++ /dev/null @@ -1,1795 +0,0 @@ -{ - "description": "change-streams", - "schemaVersion": "1.7", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ], - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "globalClient", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - }, - { - "database": { - "id": "database1", - "client": "client0", - "databaseName": "database1" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "collection1" - } - }, - { - "database": { - "id": "globalDatabase0", - "client": "globalClient", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "globalCollection0", - "database": "globalDatabase0", - "collectionName": "collection0" - } - }, - { - "database": { - "id": "globalDatabase1", - "client": "globalClient", - "databaseName": "database1" - } - }, - { - "collection": { - "id": "globalCollection1", - "database": "globalDatabase1", - "collectionName": "collection1" - } - }, - { - "collection": { - "id": "globalDb1Collection0", - "database": "globalDatabase1", - "collectionName": "collection0" - } - }, - { - "collection": { - "id": "globalDb0Collection1", - "database": "globalDatabase0", - "collectionName": "collection1" - } - } - ], - "initialData": [ - { - "collectionName": "collection0", - "databaseName": "database0", - "documents": [] - } - ], - "tests": [ - { - "description": "Test array truncation", - "runOnRequirements": [ - { - "minServerVersion": "4.7" - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": 1, - "array": [ - "foo", - { - "a": "bar" - }, - 1, - 2, - 3 - ] - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "array": [ - "foo", - { - "a": "bar" - } - ] - } - } - ] - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "updateDescription": { - "updatedFields": {}, - "removedFields": [], - "truncatedArrays": [ - { - "field": "array", - "newSize": 2 - } - ] - } - } - } - ] - }, - { - "description": "Test with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "comment": { - "name": "test1" - } - }, - "saveResultAsEntity": "changeStream0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "pipeline": [ - { - "$changeStream": {} - } - ], - "comment": { - "name": "test1" - } - } - } - } - ] - } - ] - }, - { - "description": "Test with document comment - pre 4.4", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "comment": { - "name": "test1" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "pipeline": [ - { - "$changeStream": {} - } - ], - "comment": { - "name": "test1" - } - } - } - } - ] - } - ] - }, - { - "description": "Test with string comment", - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "comment": "comment" - }, - "saveResultAsEntity": "changeStream0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "pipeline": [ - { - "$changeStream": {} - } - ], - "comment": "comment" - } - } - } - ] - } - ] - }, - { - "description": "Test that comment is set on getMore", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "comment": { - "key": "value" - } - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "pipeline": [ - { - "$changeStream": {} - } - ], - "comment": { - "key": "value" - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "collection0", - "documents": [ - { - "_id": 1, - "a": 1 - } - ] - } - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "collection0", - "comment": { - "key": "value" - } - }, - "commandName": "getMore", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Test that comment is not set on getMore - pre 4.4", - "runOnRequirements": [ - { - "maxServerVersion": "4.3.99" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "comment": "comment" - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "pipeline": [ - { - "$changeStream": {} - } - ], - "comment": "comment" - } - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "collection0", - "documents": [ - { - "_id": 1, - "a": 1 - } - ] - } - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "collection0", - "comment": { - "$$exists": false - } - }, - "commandName": "getMore", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "to field is set in a rename change event", - "runOnRequirements": [ - { - "minServerVersion": "4.0.1" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "collection1" - } - }, - { - "name": "rename", - "object": "collection0", - "arguments": { - "to": "collection1" - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "rename", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "to": { - "db": "database0", - "coll": "collection1" - } - } - } - ] - }, - { - "description": "Test unknown operationType MUST NOT err", - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$project": { - "operationType": "addedInFutureMongoDBVersion", - "ns": 1 - } - } - ] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "addedInFutureMongoDBVersion", - "ns": { - "db": "database0", - "coll": "collection0" - } - } - } - ] - }, - { - "description": "Test newField added in response MUST NOT err", - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$project": { - "operationType": 1, - "ns": 1, - "newField": "newFieldValue" - } - } - ] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "newField": "newFieldValue" - } - } - ] - }, - { - "description": "Test new structure in ns document MUST NOT err", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "maxServerVersion": "5.2.99" - }, - { - "minServerVersion": "6.0" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$project": { - "operationType": "insert", - "ns.viewOn": "db.coll" - } - } - ] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "viewOn": "db.coll" - } - } - } - ] - }, - { - "description": "Test modified structure in ns document MUST NOT err", - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$project": { - "operationType": "insert", - "ns": { - "db": "$ns.db", - "coll": "$ns.coll", - "viewOn": "db.coll" - } - } - } - ] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0", - "viewOn": "db.coll" - } - } - } - ] - }, - { - "description": "Test server error on projecting out _id", - "runOnRequirements": [ - { - "minServerVersion": "4.2" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 0 - } - } - ] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectError": { - "errorCode": 280, - "errorCodeName": "ChangeStreamFatalError", - "errorLabelsContain": [ - "NonResumableChangeStreamError" - ] - } - } - ] - }, - { - "description": "Test projection in change stream returns expected fields", - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$project": { - "optype": "$operationType", - "ns": 1, - "newField": "value" - } - } - ] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "optype": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "newField": "value" - } - } - ] - }, - { - "description": "$changeStream must be the first stage in a change stream pipeline sent to the server", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "The server returns change stream responses in the specified server response format", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "_id": { - "$$exists": true - }, - "documentKey": { - "$$exists": true - }, - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - } - ] - }, - { - "description": "Executing a watch helper on a Collection results in notifications for changes to the specified collection", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalDb0Collection1", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "insertOne", - "object": "globalDb1Collection0", - "arguments": { - "document": { - "y": 2 - } - } - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "z": 3 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "z": 3, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Change Stream should allow valid aggregate pipeline stages", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "fullDocument.z": 3 - } - } - ] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "y": 2 - } - } - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "z": 3 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "z": 3, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - }, - { - "$match": { - "fullDocument.z": 3 - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Executing a watch helper on a Database results in notifications for changes to all collections in the specified database.", - "runOnRequirements": [ - { - "minServerVersion": "3.8.0" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "database0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalDb0Collection1", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "insertOne", - "object": "globalDb1Collection0", - "arguments": { - "document": { - "y": 2 - } - } - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "z": 3 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection1" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "z": 3, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Executing a watch helper on a MongoClient results in notifications for changes to all collections in all databases in the cluster.", - "runOnRequirements": [ - { - "minServerVersion": "3.8.0" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "client0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalDb0Collection1", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "insertOne", - "object": "globalDb1Collection0", - "arguments": { - "document": { - "y": 2 - } - } - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "z": 3 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection1" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database1", - "coll": "collection0" - }, - "fullDocument": { - "y": 2, - "_id": { - "$$exists": true - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "z": 3, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "Test insert, update, replace, and delete event types", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "updateOne", - "object": "globalCollection0", - "arguments": { - "filter": { - "x": 1 - }, - "update": { - "$set": { - "x": 2 - } - } - } - }, - { - "name": "replaceOne", - "object": "globalCollection0", - "arguments": { - "filter": { - "x": 2 - }, - "replacement": { - "x": 3 - } - } - }, - { - "name": "deleteOne", - "object": "globalCollection0", - "arguments": { - "filter": { - "x": 3 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "update", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "updateDescription": { - "updatedFields": { - "x": 2 - }, - "removedFields": [], - "truncatedArrays": { - "$$unsetOrMatches": { - "$$exists": true - } - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "replace", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 3, - "_id": { - "$$exists": true - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "delete", - "ns": { - "db": "database0", - "coll": "collection0" - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Test rename and invalidate event types", - "runOnRequirements": [ - { - "minServerVersion": "4.0.1" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "collection1" - } - }, - { - "name": "rename", - "object": "globalCollection0", - "arguments": { - "to": "collection1" - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "rename", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "to": { - "db": "database0", - "coll": "collection1" - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "invalidate" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Test drop and invalidate event types", - "runOnRequirements": [ - { - "minServerVersion": "4.0.1" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "collection0" - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "drop", - "ns": { - "db": "database0", - "coll": "collection0" - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "invalidate" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Test consecutive resume", - "runOnRequirements": [ - { - "minServerVersion": "4.1.7" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "globalClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "getMore" - ], - "closeConnection": true - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [], - "batchSize": 1 - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 2 - } - } - }, - { - "name": "insertOne", - "object": "globalCollection0", - "arguments": { - "document": { - "x": 3 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 1, - "_id": { - "$$exists": true - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 2, - "_id": { - "$$exists": true - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "fullDocument": { - "x": 3, - "_id": { - "$$exists": true - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": { - "batchSize": 1 - }, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "commandName": "aggregate", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "Test wallTime field is set in a change event", - "runOnRequirements": [ - { - "minServerVersion": "6.0.0" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "database0", - "coll": "collection0" - }, - "wallTime": { - "$$exists": true - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/addKeyAltName.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/addKeyAltName.json deleted file mode 100644 index f70bc572a84..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/addKeyAltName.json +++ /dev/null @@ -1,609 +0,0 @@ -{ - "description": "addKeyAltName", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "local": { - "key": { - "$$placeholder": 1 - } - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [ - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - ] - } - ], - "tests": [ - { - "description": "add keyAltName to non-existent data key", - "operations": [ - { - "name": "addKeyAltName", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "AAAjYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltName": "new_key_alt_name" - }, - "expectResult": { - "$$unsetOrMatches": null - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "findAndModify": "datakeys", - "query": { - "_id": { - "$binary": { - "base64": "AAAjYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "update": { - "$addToSet": { - "keyAltNames": "new_key_alt_name" - } - }, - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "datakeys", - "databaseName": "keyvault", - "documents": [ - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - ] - } - ] - }, - { - "description": "add new keyAltName to data key with no keyAltNames", - "operations": [ - { - "name": "addKeyAltName", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltName": "local_key" - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {}, - "projection": { - "_id": 0, - "keyAltNames": 1 - } - }, - "expectResult": [ - { - "keyAltNames": [ - "local_key" - ] - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "findAndModify": "datakeys", - "query": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "update": { - "$addToSet": { - "keyAltNames": "local_key" - } - }, - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - } - ] - } - ] - }, - { - "description": "add existing keyAltName to existing data key", - "operations": [ - { - "name": "addKeyAltName", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltName": "local_key" - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - }, - { - "name": "addKeyAltName", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltName": "local_key" - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {}, - "projection": { - "_id": 0, - "keyAltNames": 1 - } - }, - "expectResult": [ - { - "keyAltNames": [ - "local_key" - ] - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "findAndModify": "datakeys", - "query": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "update": { - "$addToSet": { - "keyAltNames": "local_key" - } - }, - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "findAndModify": "datakeys", - "query": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "update": { - "$addToSet": { - "keyAltNames": "local_key" - } - }, - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - } - ] - } - ] - }, - { - "description": "add new keyAltName to data key with keyAltNames", - "operations": [ - { - "name": "addKeyAltName", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltName": "local_key" - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - }, - { - "name": "addKeyAltName", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltName": "another_name" - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 0, - "keyAltNames": "$keyAltNames" - } - }, - { - "$unwind": "$keyAltNames" - }, - { - "$sort": { - "keyAltNames": 1 - } - } - ] - }, - "expectResult": [ - { - "keyAltNames": "another_name" - }, - { - "keyAltNames": "local_key" - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "findAndModify": "datakeys", - "query": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "update": { - "$addToSet": { - "keyAltNames": "local_key" - } - }, - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "findAndModify": "datakeys", - "query": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "update": { - "$addToSet": { - "keyAltNames": "another_name" - } - }, - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/createDataKey-kms_providers-invalid.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/createDataKey-kms_providers-invalid.json deleted file mode 100644 index 2344a61a95b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/createDataKey-kms_providers-invalid.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "description": "createDataKey-kms_providers-invalid", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws": { - "accessKeyId": { - "$$placeholder": 1 - }, - "secretAccessKey": { - "$$placeholder": 1 - } - } - } - } - } - } - ], - "tests": [ - { - "description": "create data key without required master key fields", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "aws", - "opts": { - "masterKey": {} - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "create data key with invalid master key field", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "local", - "opts": { - "masterKey": { - "invalid": 1 - } - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "create data key with invalid master key", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "aws", - "opts": { - "masterKey": { - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "invalid" - } - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/createDataKey.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/createDataKey.json deleted file mode 100644 index f99fa3dbcf3..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/createDataKey.json +++ /dev/null @@ -1,775 +0,0 @@ -{ - "description": "createDataKey", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws": { - "accessKeyId": { - "$$placeholder": 1 - }, - "secretAccessKey": { - "$$placeholder": 1 - } - }, - "azure": { - "tenantId": { - "$$placeholder": 1 - }, - "clientId": { - "$$placeholder": 1 - }, - "clientSecret": { - "$$placeholder": 1 - } - }, - "gcp": { - "email": { - "$$placeholder": 1 - }, - "privateKey": { - "$$placeholder": 1 - } - }, - "kmip": { - "endpoint": { - "$$placeholder": 1 - } - }, - "local": { - "key": { - "$$placeholder": 1 - } - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [] - } - ], - "tests": [ - { - "description": "create data key with AWS KMS provider", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "aws", - "opts": { - "masterKey": { - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - } - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$exists": true - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with Azure KMS provider", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "azure", - "opts": { - "masterKey": { - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - } - } - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$exists": true - }, - "masterKey": { - "provider": "azure", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with GCP KMS provider", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "gcp", - "opts": { - "masterKey": { - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - } - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$exists": true - }, - "masterKey": { - "provider": "gcp", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with KMIP KMS provider", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "kmip" - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$exists": true - }, - "masterKey": { - "provider": "kmip", - "keyId": { - "$$type": "string" - } - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with KMIP delegated KMS provider", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "kmip", - "opts": { - "masterKey": { - "delegated": true - } - } - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$exists": true - }, - "masterKey": { - "provider": "kmip", - "keyId": { - "$$type": "string" - }, - "delegated": true - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with local KMS provider", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "local" - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$exists": true - }, - "masterKey": { - "provider": "local" - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with no keyAltName", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "local", - "opts": { - "keyAltNames": [] - } - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyAltNames": { - "$$exists": false - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$type": "int" - }, - "masterKey": { - "$$type": "object" - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with single keyAltName", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "local", - "opts": { - "keyAltNames": [ - "local_key" - ] - } - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$type": "int" - }, - "masterKey": { - "$$type": "object" - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with multiple keyAltNames", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "local", - "opts": { - "keyAltNames": [ - "abc", - "def" - ] - } - }, - "expectResult": { - "$$type": "binData" - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 0, - "keyAltNames": 1 - } - }, - { - "$unwind": "$keyAltNames" - }, - { - "$sort": { - "keyAltNames": 1 - } - } - ] - }, - "expectResult": [ - { - "keyAltNames": "abc" - }, - { - "keyAltNames": "def" - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyAltNames": { - "$$type": "array" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$type": "int" - }, - "masterKey": { - "$$type": "object" - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "create datakey with custom key material", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "local", - "opts": { - "keyMaterial": { - "$binary": { - "base64": "a2V5X21hdGVyaWFsa2V5X21hdGVyaWFsa2V5X21hdGVyaWFsa2V5X21hdGVyaWFsa2V5X21hdGVyaWFsa2V5X21hdGVyaWFsa2V5X21hdGVyaWFsa2V5X21hdGVyaWFs", - "subType": "00" - } - } - } - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$type": "int" - }, - "masterKey": { - "$$type": "object" - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with invalid custom key material (too short)", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "local", - "opts": { - "keyMaterial": { - "$binary": { - "base64": "a2V5X21hdGVyaWFsa2V5X21hdGVyaWFsa2V5X21hdGVyaWFsa2V5X21hdGVyaWFsa2V5X21hdGVyaWFsa2V5X21hdGVyaWFsa2V5X21hdGVyaWFs", - "subType": "00" - } - } - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/deleteKey.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/deleteKey.json deleted file mode 100644 index 3a10fb082f3..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/deleteKey.json +++ /dev/null @@ -1,557 +0,0 @@ -{ - "description": "deleteKey", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "local": { - "key": { - "$$placeholder": 1 - } - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [ - { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "aws_key" - ], - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gFXJqbF0Fy872MD7xl56D/2AAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDO7HPisPUlGzaio9vgIBEIB7/Qow46PMh/8JbEUbdXgTGhLfXPE+KIVW7T8s6YEMlGiRvMu7TV0QCIUJlSHPKZxzlJ2iwuz5yXeOag+EdY+eIQ0RKrsJ3b8UTisZYzGjfzZnxUKLzLoeXremtRCm3x47wCuHKd1dhh6FBbYt5TL2tDaj+vL2GBrKat2L", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - }, - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - ] - } - ], - "tests": [ - { - "description": "delete non-existent data key", - "operations": [ - { - "name": "deleteKey", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "AAAzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - } - }, - "expectResult": { - "deletedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "delete": "datakeys", - "deletes": [ - { - "q": { - "_id": { - "$binary": { - "base64": "AAAzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - } - }, - "limit": 1 - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "datakeys", - "databaseName": "keyvault", - "documents": [ - { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "aws_key" - ], - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gFXJqbF0Fy872MD7xl56D/2AAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDO7HPisPUlGzaio9vgIBEIB7/Qow46PMh/8JbEUbdXgTGhLfXPE+KIVW7T8s6YEMlGiRvMu7TV0QCIUJlSHPKZxzlJ2iwuz5yXeOag+EdY+eIQ0RKrsJ3b8UTisZYzGjfzZnxUKLzLoeXremtRCm3x47wCuHKd1dhh6FBbYt5TL2tDaj+vL2GBrKat2L", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - }, - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - ] - } - ] - }, - { - "description": "delete existing AWS data key", - "operations": [ - { - "name": "deleteKey", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "delete": "datakeys", - "deletes": [ - { - "q": { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - } - }, - "limit": 1 - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "datakeys", - "databaseName": "keyvault", - "documents": [ - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - ] - } - ] - }, - { - "description": "delete existing local data key", - "operations": [ - { - "name": "deleteKey", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "delete": "datakeys", - "deletes": [ - { - "q": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "limit": 1 - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "datakeys", - "databaseName": "keyvault", - "documents": [ - { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "aws_key" - ], - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gFXJqbF0Fy872MD7xl56D/2AAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDO7HPisPUlGzaio9vgIBEIB7/Qow46PMh/8JbEUbdXgTGhLfXPE+KIVW7T8s6YEMlGiRvMu7TV0QCIUJlSHPKZxzlJ2iwuz5yXeOag+EdY+eIQ0RKrsJ3b8UTisZYzGjfzZnxUKLzLoeXremtRCm3x47wCuHKd1dhh6FBbYt5TL2tDaj+vL2GBrKat2L", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - } - ] - } - ] - }, - { - "description": "delete existing data key twice", - "operations": [ - { - "name": "deleteKey", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - } - }, - "expectResult": { - "deletedCount": 1 - } - }, - { - "name": "deleteKey", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - } - }, - "expectResult": { - "deletedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "delete": "datakeys", - "deletes": [ - { - "q": { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - } - }, - "limit": 1 - } - ], - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "delete": "datakeys", - "deletes": [ - { - "q": { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - } - }, - "limit": 1 - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "datakeys", - "databaseName": "keyvault", - "documents": [ - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/getKey.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/getKey.json deleted file mode 100644 index 2ea3fe73581..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/getKey.json +++ /dev/null @@ -1,319 +0,0 @@ -{ - "description": "getKey", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "local": { - "key": { - "$$placeholder": 1 - } - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [ - { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "aws_key" - ], - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gFXJqbF0Fy872MD7xl56D/2AAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDO7HPisPUlGzaio9vgIBEIB7/Qow46PMh/8JbEUbdXgTGhLfXPE+KIVW7T8s6YEMlGiRvMu7TV0QCIUJlSHPKZxzlJ2iwuz5yXeOag+EdY+eIQ0RKrsJ3b8UTisZYzGjfzZnxUKLzLoeXremtRCm3x47wCuHKd1dhh6FBbYt5TL2tDaj+vL2GBrKat2L", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - }, - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - ] - } - ], - "tests": [ - { - "description": "get non-existent data key", - "operations": [ - { - "name": "getKey", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "AAAzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - } - }, - "expectResult": { - "$$unsetOrMatches": null - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "_id": { - "$binary": { - "base64": "AAAzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - } - }, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "get existing AWS data key", - "operations": [ - { - "name": "getKey", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - } - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "aws_key" - ], - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gFXJqbF0Fy872MD7xl56D/2AAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDO7HPisPUlGzaio9vgIBEIB7/Qow46PMh/8JbEUbdXgTGhLfXPE+KIVW7T8s6YEMlGiRvMu7TV0QCIUJlSHPKZxzlJ2iwuz5yXeOag+EdY+eIQ0RKrsJ3b8UTisZYzGjfzZnxUKLzLoeXremtRCm3x47wCuHKd1dhh6FBbYt5TL2tDaj+vL2GBrKat2L", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - } - }, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "get existing local data key", - "operations": [ - { - "name": "getKey", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/getKeyByAltName.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/getKeyByAltName.json deleted file mode 100644 index 2505abc16e7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/getKeyByAltName.json +++ /dev/null @@ -1,289 +0,0 @@ -{ - "description": "getKeyByAltName", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "local": { - "key": { - "$$placeholder": 1 - } - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [ - { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "aws_key" - ], - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gFXJqbF0Fy872MD7xl56D/2AAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDO7HPisPUlGzaio9vgIBEIB7/Qow46PMh/8JbEUbdXgTGhLfXPE+KIVW7T8s6YEMlGiRvMu7TV0QCIUJlSHPKZxzlJ2iwuz5yXeOag+EdY+eIQ0RKrsJ3b8UTisZYzGjfzZnxUKLzLoeXremtRCm3x47wCuHKd1dhh6FBbYt5TL2tDaj+vL2GBrKat2L", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - }, - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - ] - } - ], - "tests": [ - { - "description": "get non-existent data key", - "operations": [ - { - "name": "getKeyByAltName", - "object": "clientEncryption0", - "arguments": { - "keyAltName": "does_not_exist" - }, - "expectResult": { - "$$unsetOrMatches": null - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": "does_not_exist" - }, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "get existing AWS data key", - "operations": [ - { - "name": "getKeyByAltName", - "object": "clientEncryption0", - "arguments": { - "keyAltName": "aws_key" - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "aws_key" - ], - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gFXJqbF0Fy872MD7xl56D/2AAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDO7HPisPUlGzaio9vgIBEIB7/Qow46PMh/8JbEUbdXgTGhLfXPE+KIVW7T8s6YEMlGiRvMu7TV0QCIUJlSHPKZxzlJ2iwuz5yXeOag+EdY+eIQ0RKrsJ3b8UTisZYzGjfzZnxUKLzLoeXremtRCm3x47wCuHKd1dhh6FBbYt5TL2tDaj+vL2GBrKat2L", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": "aws_key" - }, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "get existing local data key", - "operations": [ - { - "name": "getKeyByAltName", - "object": "clientEncryption0", - "arguments": { - "keyAltName": "local_key" - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": "local_key" - }, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/getKeys.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/getKeys.json deleted file mode 100644 index d9447123572..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/getKeys.json +++ /dev/null @@ -1,260 +0,0 @@ -{ - "description": "getKeys", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "local": { - "key": { - "$$placeholder": 1 - } - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [] - } - ], - "tests": [ - { - "description": "getKeys with zero key documents", - "operations": [ - { - "name": "getKeys", - "object": "clientEncryption0", - "expectResult": [] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": {}, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "getKeys with single key documents", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "local", - "opts": { - "keyAltNames": [ - "abc" - ] - } - }, - "expectResult": { - "$$type": "binData" - } - }, - { - "name": "getKeys", - "object": "clientEncryption0", - "expectResult": [ - { - "_id": { - "$$type": "binData" - }, - "keyAltNames": [ - "abc" - ], - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$type": "int" - }, - "masterKey": { - "$$type": "object" - } - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": {}, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "getKeys with many key documents", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "local" - }, - "expectResult": { - "$$type": "binData" - } - }, - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "local" - }, - "expectResult": { - "$$type": "binData" - } - }, - { - "name": "getKeys", - "object": "clientEncryption0", - "expectResult": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$type": "int" - }, - "masterKey": { - "$$type": "object" - } - }, - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$type": "int" - }, - "masterKey": { - "$$type": "object" - } - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": {}, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/namedKMS-createDataKey.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/namedKMS-createDataKey.json deleted file mode 100644 index 4d75e4cf51e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/namedKMS-createDataKey.json +++ /dev/null @@ -1,396 +0,0 @@ -{ - "description": "namedKMS-createDataKey", - "schemaVersion": "1.18", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws:name1": { - "accessKeyId": { - "$$placeholder": 1 - }, - "secretAccessKey": { - "$$placeholder": 1 - } - }, - "azure:name1": { - "tenantId": { - "$$placeholder": 1 - }, - "clientId": { - "$$placeholder": 1 - }, - "clientSecret": { - "$$placeholder": 1 - } - }, - "gcp:name1": { - "email": { - "$$placeholder": 1 - }, - "privateKey": { - "$$placeholder": 1 - } - }, - "kmip:name1": { - "endpoint": { - "$$placeholder": 1 - } - }, - "local:name1": { - "key": { - "$$placeholder": 1 - } - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [] - } - ], - "tests": [ - { - "description": "create data key with named AWS KMS provider", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "aws:name1", - "opts": { - "masterKey": { - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - } - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$exists": true - }, - "masterKey": { - "provider": "aws:name1", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with named Azure KMS provider", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "azure:name1", - "opts": { - "masterKey": { - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - } - } - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$exists": true - }, - "masterKey": { - "provider": "azure:name1", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with named GCP KMS provider", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "gcp:name1", - "opts": { - "masterKey": { - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - } - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$exists": true - }, - "masterKey": { - "provider": "gcp:name1", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with named KMIP KMS provider", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "kmip:name1" - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$exists": true - }, - "masterKey": { - "provider": "kmip:name1", - "keyId": { - "$$type": "string" - } - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "create datakey with named local KMS provider", - "operations": [ - { - "name": "createDataKey", - "object": "clientEncryption0", - "arguments": { - "kmsProvider": "local:name1" - }, - "expectResult": { - "$$type": "binData" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "insert": "datakeys", - "documents": [ - { - "_id": { - "$$type": "binData" - }, - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": { - "$$exists": true - }, - "masterKey": { - "provider": "local:name1" - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/namedKMS-explicit.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/namedKMS-explicit.json deleted file mode 100644 index e28d7e8b303..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/namedKMS-explicit.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "description": "namedKMS-explicit", - "schemaVersion": "1.18", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "local:name2": { - "key": "local+name2+YUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk" - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [ - { - "_id": { - "$binary": { - "base64": "local+name2+AAAAAAAAAA==", - "subType": "04" - } - }, - "keyAltNames": [ - "local:name2" - ], - "keyMaterial": { - "$binary": { - "base64": "DX3iUuOlBsx6wBX9UZ3v/qXk1HNeBace2J+h/JwsDdF/vmSXLZ1l1VmZYIcpVFy6ODhdbzLjd4pNgg9wcm4etYig62KNkmtZ0/s1tAL5VsuW/s7/3PYnYGznZTFhLjIVcOH/RNoRj2eQb/sRTyivL85wePEpAU/JzuBj6qO9Y5txQgs1k0J3aNy10R9aQ8kC1NuSSpLAIXwE6DlNDDJXhw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1552949630483" - } - }, - "status": { - "$numberInt": "0" - }, - "masterKey": { - "provider": "local:name2" - } - } - ] - } - ], - "tests": [ - { - "description": "can explicitly encrypt with a named KMS provider", - "operations": [ - { - "name": "encrypt", - "object": "clientEncryption0", - "arguments": { - "value": "foobar", - "opts": { - "keyAltName": "local:name2", - "algorithm": "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" - } - }, - "expectResult": { - "$binary": { - "base64": "AZaHGpfp2pntvgAAAAAAAAAC4yX2LTAuN253GAkEO2ZXp4GpCyM7yoVNJMQQl+6uzxMs03IprLC7DL2vr18x9LwOimjTS9YbMJhrnFkEPuNhbg==", - "subType": "06" - } - } - } - ] - }, - { - "description": "can explicitly decrypt with a named KMS provider", - "operations": [ - { - "name": "decrypt", - "object": "clientEncryption0", - "arguments": { - "value": { - "$binary": { - "base64": "AZaHGpfp2pntvgAAAAAAAAAC4yX2LTAuN253GAkEO2ZXp4GpCyM7yoVNJMQQl+6uzxMs03IprLC7DL2vr18x9LwOimjTS9YbMJhrnFkEPuNhbg==", - "subType": "06" - } - } - }, - "expectResult": "foobar" - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/namedKMS-rewrapManyDataKey.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/namedKMS-rewrapManyDataKey.json deleted file mode 100644 index b3b9bd24777..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/namedKMS-rewrapManyDataKey.json +++ /dev/null @@ -1,1385 +0,0 @@ -{ - "description": "namedKMS-rewrapManyDataKey", - "schemaVersion": "1.18", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws:name1": { - "accessKeyId": { - "$$placeholder": 1 - }, - "secretAccessKey": { - "$$placeholder": 1 - } - }, - "azure:name1": { - "tenantId": { - "$$placeholder": 1 - }, - "clientId": { - "$$placeholder": 1 - }, - "clientSecret": { - "$$placeholder": 1 - } - }, - "gcp:name1": { - "email": { - "$$placeholder": 1 - }, - "privateKey": { - "$$placeholder": 1 - } - }, - "kmip:name1": { - "endpoint": { - "$$placeholder": 1 - } - }, - "local:name1": { - "key": { - "$$placeholder": 1 - } - }, - "local:name2": { - "key": "local+name2+YUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk" - }, - "aws:name2": { - "accessKeyId": { - "$$placeholder": 1 - }, - "secretAccessKey": { - "$$placeholder": 1 - } - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [ - { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "aws:name1_key" - ], - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gFXJqbF0Fy872MD7xl56D/2AAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDO7HPisPUlGzaio9vgIBEIB7/Qow46PMh/8JbEUbdXgTGhLfXPE+KIVW7T8s6YEMlGiRvMu7TV0QCIUJlSHPKZxzlJ2iwuz5yXeOag+EdY+eIQ0RKrsJ3b8UTisZYzGjfzZnxUKLzLoeXremtRCm3x47wCuHKd1dhh6FBbYt5TL2tDaj+vL2GBrKat2L", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "aws:name1", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - }, - { - "_id": { - "$binary": { - "base64": "YXp1cmVhenVyZWF6dXJlYQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "azure:name1_key" - ], - "keyMaterial": { - "$binary": { - "base64": "pr01l7qDygUkFE/0peFwpnNlv3iIy8zrQK38Q9i12UCN2jwZHDmfyx8wokiIKMb9kAleeY+vnt3Cf1MKu9kcDmI+KxbNDd+V3ytAAGzOVLDJr77CiWjF9f8ntkXRHrAY9WwnVDANYkDwXlyU0Y2GQFTiW65jiQhUtYLYH63Tk48SsJuQvnWw1Q+PzY8ga+QeVec8wbcThwtm+r2IHsCFnc72Gv73qq7weISw+O4mN08z3wOp5FOS2ZM3MK7tBGmPdBcktW7F8ODGsOQ1FU53OrWUnyX2aTi2ftFFFMWVHqQo7EYuBZHru8RRODNKMyQk0BFfKovAeTAVRv9WH9QU7g==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "azure:name1", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - } - }, - { - "_id": { - "$binary": { - "base64": "Z2NwZ2NwZ2NwZ2NwZ2NwZw==", - "subType": "04" - } - }, - "keyAltNames": [ - "gcp:name1_key" - ], - "keyMaterial": { - "$binary": { - "base64": "CiQAIgLj0USbQtof/pYRLQO96yg/JEtZbD1UxKueaC37yzT5tTkSiQEAhClWB5ZCSgzHgxv8raWjNB4r7e8ePGdsmSuYTYmLC5oHHS/BdQisConzNKFaobEQZHamTCjyhy5NotKF8MWoo+dyfQApwI29+vAGyrUIQCXzKwRnNdNQ+lb3vJtS5bqvLTvSxKHpVca2kqyC9nhonV+u4qru5Q2bAqUgVFc8fL4pBuvlowZFTQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "gcp:name1", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - }, - { - "_id": { - "$binary": { - "base64": "a21pcGttaXBrbWlwa21pcA==", - "subType": "04" - } - }, - "keyAltNames": [ - "kmip:name1_key" - ], - "keyMaterial": { - "$binary": { - "base64": "CklVctHzke4mcytd0TxGqvepkdkQN8NUF4+jV7aZQITAKdz6WjdDpq3lMt9nSzWGG2vAEfvRb3mFEVjV57qqGqxjq2751gmiMRHXz0btStbIK3mQ5xbY9kdye4tsixlCryEwQONr96gwlwKKI9Nubl9/8+uRF6tgYjje7Q7OjauEf1SrJwKcoQ3WwnjZmEqAug0kImCpJ/irhdqPzivRiA==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "kmip:name1", - "keyId": "1" - } - }, - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local:name1_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local:name1" - } - } - ] - } - ], - "tests": [ - { - "description": "rewrap to aws:name1", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$ne": "aws:name1_key" - } - }, - "opts": { - "provider": "aws:name1", - "masterKey": { - "key": "arn:aws:kms:us-east-1:579766882180:key/061334ae-07a8-4ceb-a813-8135540e837d", - "region": "us-east-1" - } - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 4, - "modifiedCount": 4, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$ne": "aws:name1_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "aws:name1", - "key": "arn:aws:kms:us-east-1:579766882180:key/061334ae-07a8-4ceb-a813-8135540e837d", - "region": "us-east-1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "aws:name1", - "key": "arn:aws:kms:us-east-1:579766882180:key/061334ae-07a8-4ceb-a813-8135540e837d", - "region": "us-east-1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "aws:name1", - "key": "arn:aws:kms:us-east-1:579766882180:key/061334ae-07a8-4ceb-a813-8135540e837d", - "region": "us-east-1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "aws:name1", - "key": "arn:aws:kms:us-east-1:579766882180:key/061334ae-07a8-4ceb-a813-8135540e837d", - "region": "us-east-1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap to azure:name1", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$ne": "azure:name1_key" - } - }, - "opts": { - "provider": "azure:name1", - "masterKey": { - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - } - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 4, - "modifiedCount": 4, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$ne": "azure:name1_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "azure:name1", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "azure:name1", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "azure:name1", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "azure:name1", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap to gcp:name1", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$ne": "gcp:name1_key" - } - }, - "opts": { - "provider": "gcp:name1", - "masterKey": { - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 4, - "modifiedCount": 4, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$ne": "gcp:name1_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "gcp:name1", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "gcp:name1", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "gcp:name1", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "gcp:name1", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap to kmip:name1", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$ne": "kmip:name1_key" - } - }, - "opts": { - "provider": "kmip:name1" - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 4, - "modifiedCount": 4, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$ne": "kmip:name1_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip:name1", - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip:name1", - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip:name1", - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip:name1", - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap to local:name1", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$ne": "local:name1_key" - } - }, - "opts": { - "provider": "local:name1" - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 4, - "modifiedCount": 4, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$ne": "local:name1_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "local:name1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "local:name1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "local:name1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "local:name1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap from local:name1 to local:name2", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$eq": "local:name1_key" - } - }, - "opts": { - "provider": "local:name2" - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 1, - "modifiedCount": 1, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$eq": "local:name1_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "local:name2" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap from aws:name1 to aws:name2", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$eq": "aws:name1_key" - } - }, - "opts": { - "provider": "aws:name2", - "masterKey": { - "key": "arn:aws:kms:us-east-1:857654397073:key/0f8468f0-f135-4226-aa0b-bd05c4c30df5", - "region": "us-east-1" - } - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 1, - "modifiedCount": 1, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$eq": "aws:name1_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "aws:name2", - "key": "arn:aws:kms:us-east-1:857654397073:key/0f8468f0-f135-4226-aa0b-bd05c4c30df5", - "region": "us-east-1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/removeKeyAltName.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/removeKeyAltName.json deleted file mode 100644 index 1b7077077a1..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/removeKeyAltName.json +++ /dev/null @@ -1,672 +0,0 @@ -{ - "description": "removeKeyAltName", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "local": { - "key": { - "$$placeholder": 1 - } - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [ - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "alternate_name", - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - ] - } - ], - "tests": [ - { - "description": "remove keyAltName from non-existent data key", - "operations": [ - { - "name": "removeKeyAltName", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "AAAjYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltName": "does_not_exist" - }, - "expectResult": { - "$$unsetOrMatches": null - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "findAndModify": "datakeys", - "query": { - "_id": { - "$binary": { - "base64": "AAAjYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "update": [ - { - "$set": { - "keyAltNames": { - "$cond": [ - { - "$eq": [ - "$keyAltNames", - [ - "does_not_exist" - ] - ] - }, - "$$REMOVE", - { - "$filter": { - "input": "$keyAltNames", - "cond": { - "$ne": [ - "$$this", - "does_not_exist" - ] - } - } - } - ] - } - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "datakeys", - "databaseName": "keyvault", - "documents": [ - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "alternate_name", - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - ] - } - ] - }, - { - "description": "remove non-existent keyAltName from existing data key", - "operations": [ - { - "name": "removeKeyAltName", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltName": "does_not_exist" - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "alternate_name", - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "findAndModify": "datakeys", - "query": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "update": [ - { - "$set": { - "keyAltNames": { - "$cond": [ - { - "$eq": [ - "$keyAltNames", - [ - "does_not_exist" - ] - ] - }, - "$$REMOVE", - { - "$filter": { - "input": "$keyAltNames", - "cond": { - "$ne": [ - "$$this", - "does_not_exist" - ] - } - } - } - ] - } - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "datakeys", - "databaseName": "keyvault", - "documents": [ - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "alternate_name", - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - ] - } - ] - }, - { - "description": "remove an existing keyAltName from an existing data key", - "operations": [ - { - "name": "removeKeyAltName", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltName": "alternate_name" - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "alternate_name", - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {}, - "projection": { - "_id": 0, - "keyAltNames": 1 - } - }, - "expectResult": [ - { - "keyAltNames": [ - "local_key" - ] - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "findAndModify": "datakeys", - "query": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "update": [ - { - "$set": { - "keyAltNames": { - "$cond": [ - { - "$eq": [ - "$keyAltNames", - [ - "alternate_name" - ] - ] - }, - "$$REMOVE", - { - "$filter": { - "input": "$keyAltNames", - "cond": { - "$ne": [ - "$$this", - "alternate_name" - ] - } - } - } - ] - } - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - } - ] - } - ] - }, - { - "description": "remove the last keyAltName from an existing data key", - "operations": [ - { - "name": "removeKeyAltName", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltName": "alternate_name" - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "alternate_name", - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - }, - { - "name": "removeKeyAltName", - "object": "clientEncryption0", - "arguments": { - "id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltName": "local_key" - }, - "expectResult": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$$type": "binData" - }, - "creationDate": { - "$$type": "date" - }, - "updateDate": { - "$$type": "date" - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "findAndModify": "datakeys", - "query": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "update": [ - { - "$set": { - "keyAltNames": { - "$cond": [ - { - "$eq": [ - "$keyAltNames", - [ - "alternate_name" - ] - ] - }, - "$$REMOVE", - { - "$filter": { - "input": "$keyAltNames", - "cond": { - "$ne": [ - "$$this", - "alternate_name" - ] - } - } - } - ] - } - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "findAndModify": "datakeys", - "query": { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - } - }, - "update": [ - { - "$set": { - "keyAltNames": { - "$cond": [ - { - "$eq": [ - "$keyAltNames", - [ - "local_key" - ] - ] - }, - "$$REMOVE", - { - "$filter": { - "input": "$keyAltNames", - "cond": { - "$ne": [ - "$$this", - "local_key" - ] - } - } - } - ] - } - } - } - ] - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/rewrapManyDataKey-decrypt_failure.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/rewrapManyDataKey-decrypt_failure.json deleted file mode 100644 index 4c7d4e80486..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/rewrapManyDataKey-decrypt_failure.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "description": "rewrapManyDataKey-decrypt_failure", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws": { - "accessKeyId": { - "$$placeholder": 1 - }, - "secretAccessKey": { - "$$placeholder": 1 - } - }, - "azure": { - "tenantId": { - "$$placeholder": 1 - }, - "clientId": { - "$$placeholder": 1 - }, - "clientSecret": { - "$$placeholder": 1 - } - }, - "gcp": { - "email": { - "$$placeholder": 1 - }, - "privateKey": { - "$$placeholder": 1 - } - }, - "kmip": { - "endpoint": { - "$$placeholder": 1 - } - }, - "local": { - "key": { - "$$placeholder": 1 - } - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [ - { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "aws_key" - ], - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gFXJqbF0Fy872MD7xl56D/2AAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDO7HPisPUlGzaio9vgIBEIB7/Qow46PMh/8JbEUbdXgTGhLfXPE+KIVW7T8s6YEMlGiRvMu7TV0QCIUJlSHPKZxzlJ2iwuz5yXeOag+EdY+eIQ0RKrsJ3b8UTisZYzGjfzZnxUKLzLoeXremtRCm3x47wCuHKd1dhh6FBbYt5TL2tDaj+vL2GBrKat2L", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-2:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-2" - } - } - ] - } - ], - "tests": [ - { - "description": "rewrap data key that fails during decryption due to invalid masterKey", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": {}, - "opts": { - "provider": "local" - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": {}, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/rewrapManyDataKey-encrypt_failure.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/rewrapManyDataKey-encrypt_failure.json deleted file mode 100644 index cd2d20c255a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/rewrapManyDataKey-encrypt_failure.json +++ /dev/null @@ -1,250 +0,0 @@ -{ - "description": "rewrapManyDataKey-encrypt_failure", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws": { - "accessKeyId": { - "$$placeholder": 1 - }, - "secretAccessKey": { - "$$placeholder": 1 - } - }, - "azure": { - "tenantId": { - "$$placeholder": 1 - }, - "clientId": { - "$$placeholder": 1 - }, - "clientSecret": { - "$$placeholder": 1 - } - }, - "gcp": { - "email": { - "$$placeholder": 1 - }, - "privateKey": { - "$$placeholder": 1 - } - }, - "kmip": { - "endpoint": { - "$$placeholder": 1 - } - }, - "local": { - "key": { - "$$placeholder": 1 - } - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [ - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - } - ] - } - ], - "tests": [ - { - "description": "rewrap with invalid masterKey for AWS KMS provider", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": {}, - "opts": { - "provider": "aws", - "masterKey": { - "key": "arn:aws:kms:us-east-2:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-2" - } - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": {}, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap with invalid masterKey for Azure KMS provider", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": {}, - "opts": { - "provider": "azure", - "masterKey": { - "keyVaultEndpoint": "invalid-vault-csfle.vault.azure.net", - "keyName": "invalid-name-csfle" - } - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": {}, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap with invalid masterKey for GCP KMS provider", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": {}, - "opts": { - "provider": "gcp", - "masterKey": { - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "invalid-ring-csfle", - "keyName": "invalid-name-csfle" - } - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": {}, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-encryption/rewrapManyDataKey.json b/driver-core/src/test/resources/unified-test-format/client-side-encryption/rewrapManyDataKey.json deleted file mode 100644 index 8803491dbe9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-encryption/rewrapManyDataKey.json +++ /dev/null @@ -1,1922 +0,0 @@ -{ - "description": "rewrapManyDataKey", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws": { - "accessKeyId": { - "$$placeholder": 1 - }, - "secretAccessKey": { - "$$placeholder": 1 - } - }, - "azure": { - "tenantId": { - "$$placeholder": 1 - }, - "clientId": { - "$$placeholder": 1 - }, - "clientSecret": { - "$$placeholder": 1 - } - }, - "gcp": { - "email": { - "$$placeholder": 1 - }, - "privateKey": { - "$$placeholder": 1 - } - }, - "kmip": { - "endpoint": { - "$$placeholder": 1 - } - }, - "local": { - "key": { - "$$placeholder": 1 - } - } - } - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "keyvault" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "datakeys" - } - } - ], - "initialData": [ - { - "databaseName": "keyvault", - "collectionName": "datakeys", - "documents": [ - { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "aws_key" - ], - "keyMaterial": { - "$binary": { - "base64": "AQICAHhQNmWG2CzOm1dq3kWLM+iDUZhEqnhJwH9wZVpuZ94A8gFXJqbF0Fy872MD7xl56D/2AAAAwjCBvwYJKoZIhvcNAQcGoIGxMIGuAgEAMIGoBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDO7HPisPUlGzaio9vgIBEIB7/Qow46PMh/8JbEUbdXgTGhLfXPE+KIVW7T8s6YEMlGiRvMu7TV0QCIUJlSHPKZxzlJ2iwuz5yXeOag+EdY+eIQ0RKrsJ3b8UTisZYzGjfzZnxUKLzLoeXremtRCm3x47wCuHKd1dhh6FBbYt5TL2tDaj+vL2GBrKat2L", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - }, - { - "_id": { - "$binary": { - "base64": "YXp1cmVhenVyZWF6dXJlYQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "azure_key" - ], - "keyMaterial": { - "$binary": { - "base64": "pr01l7qDygUkFE/0peFwpnNlv3iIy8zrQK38Q9i12UCN2jwZHDmfyx8wokiIKMb9kAleeY+vnt3Cf1MKu9kcDmI+KxbNDd+V3ytAAGzOVLDJr77CiWjF9f8ntkXRHrAY9WwnVDANYkDwXlyU0Y2GQFTiW65jiQhUtYLYH63Tk48SsJuQvnWw1Q+PzY8ga+QeVec8wbcThwtm+r2IHsCFnc72Gv73qq7weISw+O4mN08z3wOp5FOS2ZM3MK7tBGmPdBcktW7F8ODGsOQ1FU53OrWUnyX2aTi2ftFFFMWVHqQo7EYuBZHru8RRODNKMyQk0BFfKovAeTAVRv9WH9QU7g==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "azure", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - } - }, - { - "_id": { - "$binary": { - "base64": "Z2NwZ2NwZ2NwZ2NwZ2NwZw==", - "subType": "04" - } - }, - "keyAltNames": [ - "gcp_key" - ], - "keyMaterial": { - "$binary": { - "base64": "CiQAIgLj0USbQtof/pYRLQO96yg/JEtZbD1UxKueaC37yzT5tTkSiQEAhClWB5ZCSgzHgxv8raWjNB4r7e8ePGdsmSuYTYmLC5oHHS/BdQisConzNKFaobEQZHamTCjyhy5NotKF8MWoo+dyfQApwI29+vAGyrUIQCXzKwRnNdNQ+lb3vJtS5bqvLTvSxKHpVca2kqyC9nhonV+u4qru5Q2bAqUgVFc8fL4pBuvlowZFTQ==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "gcp", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - }, - { - "_id": { - "$binary": { - "base64": "a21pcGttaXBrbWlwa21pcA==", - "subType": "04" - } - }, - "keyAltNames": [ - "kmip_key" - ], - "keyMaterial": { - "$binary": { - "base64": "CklVctHzke4mcytd0TxGqvepkdkQN8NUF4+jV7aZQITAKdz6WjdDpq3lMt9nSzWGG2vAEfvRb3mFEVjV57qqGqxjq2751gmiMRHXz0btStbIK3mQ5xbY9kdye4tsixlCryEwQONr96gwlwKKI9Nubl9/8+uRF6tgYjje7Q7OjauEf1SrJwKcoQ3WwnjZmEqAug0kImCpJ/irhdqPzivRiA==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "kmip", - "keyId": "1" - } - }, - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "keyAltNames": [ - "local_key" - ], - "keyMaterial": { - "$binary": { - "base64": "ABKBldDEoDW323yejOnIRk6YQmlD9d3eQthd16scKL75nz2LjNL9fgPDZWrFFOlqlhMCFaSrNJfGrFUjYk5JFDO7soG5Syb50k1niJoKg4ilsj0L4mpimFUtTpOr2nzZOeQtvAksEXc7gsFgq8gV7t/U3lsaXPY7I0t42DfSE8EGlPdxRjFdHnxh+OR8h7U9b8Qs5K5UuhgyeyxaBZ1Hgw==", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "local" - } - }, - { - "_id": { - "$uuid": "7411e9af-c688-4df7-8143-5e60ae96cba5" - }, - "keyAltNames": [ - "kmip_delegated_key" - ], - "keyMaterial": { - "$binary": { - "base64": "5TLMFWlguBWe5GUESTvOVtkdBsCrynhnV72XRyZ66/nk+EP9/1oEp1t1sg0+vwCTqULHjBiUE6DRx2mYD/Eup1+u2Jgz9/+1sV1drXeOPALNPkSgiZiDbIb67zRi+wTABEcKcegJH+FhmSGxwUoQAiHCsCbcvia5P8tN1lt98YQ=", - "subType": "00" - } - }, - "creationDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "updateDate": { - "$date": { - "$numberLong": "1641024000000" - } - }, - "status": 1, - "masterKey": { - "provider": "kmip", - "keyId": "11", - "delegated": true - } - } - ] - } - ], - "tests": [ - { - "description": "no keys to rewrap due to no filter matches", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": "no_matching_keys" - }, - "opts": { - "provider": "local" - } - }, - "expectResult": { - "bulkWriteResult": { - "$$exists": false - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": "no_matching_keys" - }, - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap with new AWS KMS provider", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$ne": "aws_key" - } - }, - "opts": { - "provider": "aws", - "masterKey": { - "key": "arn:aws:kms:us-east-1:579766882180:key/061334ae-07a8-4ceb-a813-8135540e837d", - "region": "us-east-1" - } - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 5, - "modifiedCount": 5, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$ne": "aws_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/061334ae-07a8-4ceb-a813-8135540e837d", - "region": "us-east-1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/061334ae-07a8-4ceb-a813-8135540e837d", - "region": "us-east-1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/061334ae-07a8-4ceb-a813-8135540e837d", - "region": "us-east-1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/061334ae-07a8-4ceb-a813-8135540e837d", - "region": "us-east-1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/061334ae-07a8-4ceb-a813-8135540e837d", - "region": "us-east-1" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap with new Azure KMS provider", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$ne": "azure_key" - } - }, - "opts": { - "provider": "azure", - "masterKey": { - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - } - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 5, - "modifiedCount": 5, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$ne": "azure_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "azure", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "azure", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "azure", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "azure", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "azure", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap with new GCP KMS provider", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$ne": "gcp_key" - } - }, - "opts": { - "provider": "gcp", - "masterKey": { - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 5, - "modifiedCount": 5, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$ne": "gcp_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "gcp", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "gcp", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "gcp", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "gcp", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "gcp", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap with new KMIP KMS provider", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$ne": "kmip_key" - } - }, - "opts": { - "provider": "kmip" - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 5, - "modifiedCount": 5, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$ne": "kmip_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip", - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip", - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip", - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip", - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip", - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap with new KMIP delegated KMS provider", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$ne": "kmip_delegated_key" - } - }, - "opts": { - "provider": "kmip", - "masterKey": { - "delegated": true - } - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 5, - "modifiedCount": 5, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$ne": "kmip_delegated_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip", - "delegated": true, - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip", - "delegated": true, - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip", - "delegated": true, - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip", - "delegated": true, - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "kmip", - "delegated": true, - "keyId": { - "$$type": "string" - } - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap with new local KMS provider", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": { - "keyAltNames": { - "$ne": "local_key" - } - }, - "opts": { - "provider": "local" - } - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 5, - "modifiedCount": 5, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": { - "keyAltNames": { - "$ne": "local_key" - } - }, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "local" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "local" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "local" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "local" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "provider": "local" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - ] - }, - { - "description": "rewrap with current KMS provider", - "operations": [ - { - "name": "rewrapManyDataKey", - "object": "clientEncryption0", - "arguments": { - "filter": {} - }, - "expectResult": { - "bulkWriteResult": { - "insertedCount": 0, - "matchedCount": 6, - "modifiedCount": 6, - "deletedCount": 0, - "upsertedCount": 0, - "upsertedIds": {}, - "insertedIds": { - "$$unsetOrMatches": {} - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {}, - "projection": { - "masterKey": 1 - }, - "sort": { - "keyAltNames": 1 - } - }, - "expectResult": [ - { - "_id": { - "$binary": { - "base64": "YXdzYXdzYXdzYXdzYXdzYQ==", - "subType": "04" - } - }, - "masterKey": { - "provider": "aws", - "key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0", - "region": "us-east-1" - } - }, - { - "_id": { - "$binary": { - "base64": "YXp1cmVhenVyZWF6dXJlYQ==", - "subType": "04" - } - }, - "masterKey": { - "provider": "azure", - "keyVaultEndpoint": "key-vault-csfle.vault.azure.net", - "keyName": "key-name-csfle" - } - }, - { - "_id": { - "$binary": { - "base64": "Z2NwZ2NwZ2NwZ2NwZ2NwZw==", - "subType": "04" - } - }, - "masterKey": { - "provider": "gcp", - "projectId": "devprod-drivers", - "location": "global", - "keyRing": "key-ring-csfle", - "keyName": "key-name-csfle" - } - }, - { - "_id": { - "$uuid": "7411e9af-c688-4df7-8143-5e60ae96cba5" - }, - "masterKey": { - "provider": "kmip", - "keyId": "11", - "delegated": true - } - }, - { - "_id": { - "$binary": { - "base64": "a21pcGttaXBrbWlwa21pcA==", - "subType": "04" - } - }, - "masterKey": { - "provider": "kmip", - "keyId": "1" - } - }, - { - "_id": { - "$binary": { - "base64": "bG9jYWxrZXlsb2NhbGtleQ==", - "subType": "04" - } - }, - "masterKey": { - "provider": "local" - } - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "find": "datakeys", - "filter": {}, - "readConcern": { - "level": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "databaseName": "keyvault", - "command": { - "update": "datakeys", - "ordered": true, - "updates": [ - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "$$type": "object" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "$$type": "object" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "$$type": "object" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "$$type": "object" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "$$type": "object" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$$type": "binData" - } - }, - "u": { - "$set": { - "masterKey": { - "$$type": "object" - }, - "keyMaterial": { - "$$type": "binData" - } - }, - "$currentDate": { - "updateDate": true - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/README.md b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/README.md deleted file mode 100644 index b4160500f54..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/README.md +++ /dev/null @@ -1,618 +0,0 @@ -# Client Side Operations Timeouts Tests - -______________________________________________________________________ - -## Introduction - -This document describes the tests that drivers MUST run to validate the behavior of the timeoutMS option. These tests -are broken up into automated YAML/JSON tests and additional prose tests. - -## Spec Tests - -This directory contains a set of YAML and JSON spec tests. Drivers MUST run these as described in the "Unified Test -Runner" specification. Because the tests introduced in this specification are timing-based, there is a risk that some of -them may intermittently fail without any bugs being present in the driver. As a mitigation, drivers MAY execute these -tests in two new Evergreen tasks that use single-node replica sets: one with only authentication enabled and another -with both authentication and TLS enabled. Drivers that choose to do so SHOULD use the `single-node-auth.json` and -`single-node-auth-ssl.json` files in the `drivers-evergreen-tools` repository to create these clusters. - -## Prose Tests - -There are some tests that cannot be expressed in the unified YAML/JSON format. For each of these tests, drivers MUST -create a MongoClient without the `timeoutMS` option set (referred to as `internalClient`). Any fail points set during a -test MUST be unset using `internalClient` after the test has been executed. All MongoClient instances created for tests -MUST be configured with read/write concern `majority`, read preference `primary`, and command monitoring enabled to -listen for `command_started` events. - -### 1. Multi-batch writes - -This test MUST only run against standalones on server versions 4.4 and higher. The `insertMany` call takes an -exceedingly long time on replicasets and sharded clusters. Drivers MAY adjust the timeouts used in this test to allow -for differing bulk encoding performance. - -1. Using `internalClient`, drop the `db.coll` collection. - -2. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: "failCommand", - mode: { - times: 2 - }, - data: { - failCommands: ["insert"], - blockConnection: true, - blockTimeMS: 1010 - } - } - ``` - -3. Create a new MongoClient (referred to as `client`) with `timeoutMS=2000`. - -4. Using `client`, insert 50 1-megabyte documents in a single `insertMany` call. - - - Expect this to fail with a timeout error. - -5. Verify that two `insert` commands were executed against `db.coll` as part of the `insertMany` call. - -### 2. maxTimeMS is not set for commands sent to mongocryptd - -This test MUST only be run against enterprise server versions 4.2 and higher. - -1. Launch a mongocryptd process on 23000. -2. Create a MongoClient (referred to as `client`) using the URI `mongodb://localhost:23000/?timeoutMS=1000`. -3. Using `client`, execute the `{ ping: 1 }` command against the `admin` database. -4. Verify via command monitoring that the `ping` command sent did not contain a `maxTimeMS` field. - -### 3. ClientEncryption - -Each test under this category MUST only be run against server versions 4.4 and higher. In these tests, `LOCAL_MASTERKEY` -refers to the following base64: - -```javascript -Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk -``` - -For each test, perform the following setup: - -1. Using `internalClient`, drop and create the `keyvault.datakeys` collection. - -2. Create a MongoClient (referred to as `keyVaultClient`) with `timeoutMS=10`. - -3. Create a `ClientEncryption` object that wraps `keyVaultClient` (referred to as `clientEncryption`). Configure this - object with `keyVaultNamespace` set to `keyvault.datakeys` and the following KMS providers map: - - ```javascript - { - "local": { "key": } - } - ``` - -#### createDataKey - -1. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: "failCommand", - mode: { - times: 1 - }, - data: { - failCommands: ["insert"], - blockConnection: true, - blockTimeMS: 15 - } - } - ``` - -2. Call `clientEncryption.createDataKey()` with the `local` KMS provider. - - - Expect this to fail with a timeout error. - -3. Verify that an `insert` command was executed against to `keyvault.datakeys` as part of the `createDataKey` call. - -#### encrypt - -1. Call `client_encryption.createDataKey()` with the `local` KMS provider. - - - Expect a BSON binary with subtype 4 to be returned, referred to as `datakeyId`. - -2. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: "failCommand", - mode: { - times: 1 - }, - data: { - failCommands: ["find"], - blockConnection: true, - blockTimeMS: 15 - } - } - ``` - -3. Call `clientEncryption.encrypt()` with the value `hello`, the algorithm - `AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic`, and the keyId `datakeyId`. - - - Expect this to fail with a timeout error. - -4. Verify that a `find` command was executed against the `keyvault.datakeys` collection as part of the `encrypt` call. - -#### decrypt - -1. Call `clientEncryption.createDataKey()` with the `local` KMS provider. - - - Expect this to return a BSON binary with subtype 4, referred to as `dataKeyId`. - -2. Call `clientEncryption.encrypt()` with the value `hello`, the algorithm - `AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic`, and the keyId `dataKeyId`. - - - Expect this to return a BSON binary with subtype 6, referred to as `encrypted`. - -3. Close and re-create the `keyVaultClient` and `clientEncryption` objects. - -4. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: "failCommand", - mode: { - times: 1 - }, - data: { - failCommands: ["find"], - blockConnection: true, - blockTimeMS: 15 - } - } - ``` - -5. Call `clientEncryption.decrypt()` with the value `encrypted`. - - - Expect this to fail with a timeout error. - -6. Verify that a `find` command was executed against the `keyvault.datakeys` collection as part of the `decrypt` call. - -### 4. Background Connection Pooling - -The tests in this section MUST only be run if the server version is 4.4 or higher and the URI has authentication fields -(i.e. a username and password). Each test in this section requires drivers to create a MongoClient and then wait for -some CMAP events to be published. Drivers MUST wait for up to 10 seconds and fail the test if the specified events are -not published within that time. - -#### timeoutMS used for handshake commands - -1. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: "failCommand", - mode: { - times: 1 - }, - data: { - failCommands: ["saslContinue"], - blockConnection: true, - blockTimeMS: 15, - appName: "timeoutBackgroundPoolTest" - } - } - ``` - -2. Create a MongoClient (referred to as `client`) configured with the following: - - - `minPoolSize` of 1 - - `timeoutMS` of 10 - - `appName` of `timeoutBackgroundPoolTest` - - CMAP monitor configured to listen for `ConnectionCreatedEvent` and `ConnectionClosedEvent` events. - -3. Wait for a `ConnectionCreatedEvent` and a `ConnectionClosedEvent` to be published. - -#### timeoutMS is refreshed for each handshake command - -1. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: "failCommand", - mode: "alwaysOn", - data: { - failCommands: ["hello", "isMaster", "saslContinue"], - blockConnection: true, - blockTimeMS: 15, - appName: "refreshTimeoutBackgroundPoolTest" - } - } - ``` - -2. Create a MongoClient (referred to as `client`) configured with the following: - - - `minPoolSize` of 1 - - `timeoutMS` of 20 - - `appName` of `refreshTimeoutBackgroundPoolTest` - - CMAP monitor configured to listen for `ConnectionCreatedEvent` and `ConnectionReady` events. - -3. Wait for a `ConnectionCreatedEvent` and a `ConnectionReady` to be published. - -### 5. Blocking Iteration Methods - -Tests in this section MUST only be run against server versions 4.4 and higher and only apply to drivers that have a -blocking method for cursor iteration that executes `getMore` commands in a loop until a document is available or an -error occurs. - -#### Tailable cursors - -1. Using `internalClient`, drop the `db.coll` collection. - -2. Using `internalClient`, insert the document `{ x: 1 }` into `db.coll`. - -3. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: "failCommand", - mode: "alwaysOn", - data: { - failCommands: ["getMore"], - blockConnection: true, - blockTimeMS: 15 - } - } - ``` - -4. Create a new MongoClient (referred to as `client`) with `timeoutMS=20`. - -5. Using `client`, create a tailable cursor on `db.coll` with `cursorType=tailable`. - - - Expect this to succeed and return a cursor with a non-zero ID. - -6. Call either a blocking or non-blocking iteration method on the cursor. - - - Expect this to succeed and return the document `{ x: 1 }` without sending a `getMore` command. - -7. Call the blocking iteration method on the resulting cursor. - - - Expect this to fail with a timeout error. - -8. Verify that a `find` command and two `getMore` commands were executed against the `db.coll` collection during the - test. - -#### Change Streams - -1. Using `internalClient`, drop the `db.coll` collection. - -2. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: "failCommand", - mode: "alwaysOn", - data: { - failCommands: ["getMore"], - blockConnection: true, - blockTimeMS: 15 - } - } - ``` - -3. Create a new MongoClient (referred to as `client`) with `timeoutMS=20`. - -4. Using `client`, use the `watch` helper to create a change stream against `db.coll`. - - - Expect this to succeed and return a change stream with a non-zero ID. - -5. Call the blocking iteration method on the resulting change stream. - - - Expect this to fail with a timeout error. - -6. Verify that an `aggregate` command and two `getMore` commands were executed against the `db.coll` collection during - the test. - -### 6. GridFS - Upload - -Tests in this section MUST only be run against server versions 4.4 and higher. - -#### uploads via openUploadStream can be timed out - -1. Using `internalClient`, drop and re-create the `db.fs.files` and `db.fs.chunks` collections. - -2. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: "failCommand", - mode: { times: 1 }, - data: { - failCommands: ["insert"], - blockConnection: true, - blockTimeMS: 15 - } - } - ``` - -3. Create a new MongoClient (referred to as `client`) with `timeoutMS=10`. - -4. Using `client`, create a GridFS bucket (referred to as `bucket`) that wraps the `db` database. - -5. Call `bucket.open_upload_stream()` with the filename `filename` to create an upload stream (referred to as - `uploadStream`). - - - Expect this to succeed and return a non-null stream. - -6. Using `uploadStream`, upload a single `0x12` byte. - -7. Call `uploadStream.close()` to flush the stream and insert chunks. - - - Expect this to fail with a timeout error. - -#### Aborting an upload stream can be timed out - -This test only applies to drivers that provide an API to abort a GridFS upload stream. - -1. Using `internalClient`, drop and re-create the `db.fs.files` and `db.fs.chunks` collections. - -2. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: "failCommand", - mode: { times: 1 }, - data: { - failCommands: ["delete"], - blockConnection: true, - blockTimeMS: 15 - } - } - ``` - -3. Create a new MongoClient (referred to as `client`) with `timeoutMS=10`. - -4. Using `client`, create a GridFS bucket (referred to as `bucket`) that wraps the `db` database with - `chunkSizeBytes=2`. - -5. Call `bucket.open_upload_stream()` with the filename `filename` to create an upload stream (referred to as - `uploadStream`). - - - Expect this to succeed and return a non-null stream. - -6. Using `uploadStream`, upload the bytes `[0x01, 0x02, 0x03, 0x04]`. - -7. Call `uploadStream.abort()`. - - - Expect this to fail with a timeout error. - -### 7. GridFS - Download - -This test MUST only be run against server versions 4.4 and higher. - -1. Using `internalClient`, drop and re-create the `db.fs.files` and `db.fs.chunks` collections. - -2. Using `internalClient`, insert the following document into the `db.fs.files` collection: - - ```javascript - { - "_id": { - "$oid": "000000000000000000000005" - }, - "length": 10, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "57d83cd477bfb1ccd975ab33d827a92b", - "filename": "length-10", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} - } - ``` - -3. Create a new MongoClient (referred to as `client`) with `timeoutMS=10`. - -4. Using `client`, create a GridFS bucket (referred to as `bucket`) that wraps the `db` database. - -5. Call `bucket.open_download_stream` with the id `{ "$oid": "000000000000000000000005" }` to create a download stream - (referred to as `downloadStream`). - - - Expect this to succeed and return a non-null stream. - -6. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: "failCommand", - mode: { times: 1 }, - data: { - failCommands: ["find"], - blockConnection: true, - blockTimeMS: 15 - } - } - ``` - -7. Read from the `downloadStream`. - - - Expect this to fail with a timeout error. - -8. Verify that two `find` commands were executed during the read: one against `db.fs.files` and another against - `db.fs.chunks`. - -### 8. Server Selection - -#### serverSelectionTimeoutMS honored if timeoutMS is not set - -1. Create a MongoClient (referred to as `client`) with URI `mongodb://invalid/?serverSelectionTimeoutMS=10`. -2. Using `client`, execute the command `{ ping: 1 }` against the `admin` database. - - Expect this to fail with a server selection timeout error after no more than 15ms. - -#### timeoutMS honored for server selection if it's lower than serverSelectionTimeoutMS - -1. Create a MongoClient (referred to as `client`) with URI - `mongodb://invalid/?timeoutMS=10&serverSelectionTimeoutMS=20`. -2. Using `client`, run the command `{ ping: 1 }` against the `admin` database. - - Expect this to fail with a server selection timeout error after no more than 15ms. - -#### serverSelectionTimeoutMS honored for server selection if it's lower than timeoutMS - -1. Create a MongoClient (referred to as `client`) with URI - `mongodb://invalid/?timeoutMS=20&serverSelectionTimeoutMS=10`. -2. Using `client`, run the command `{ ping: 1 }` against the `admin` database. - - Expect this to fail with a server selection timeout error after no more than 15ms. - -#### serverSelectionTimeoutMS honored for server selection if timeoutMS=0 - -1. Create a MongoClient (referred to as `client`) with URI `mongodb://invalid/?timeoutMS=0&serverSelectionTimeoutMS=10`. -2. Using `client`, run the command `{ ping: 1 }` against the `admin` database. - - Expect this to fail with a server selection timeout error after no more than 15ms. - -#### timeoutMS honored for connection handshake commands if it's lower than serverSelectionTimeoutMS - -This test MUST only be run if the server version is 4.4 or higher and the URI has authentication fields (i.e. a username -and password). - -1. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: failCommand, - mode: { times: 1 }, - data: { - failCommands: ["saslContinue"], - blockConnection: true, - blockTimeMS: 15 - } - } - ``` - -2. Create a new MongoClient (referred to as `client`) with `timeoutMS=10` and `serverSelectionTimeoutMS=20`. - -3. Using `client`, insert the document `{ x: 1 }` into collection `db.coll`. - - - Expect this to fail with a timeout error after no more than 15ms. - -#### serverSelectionTimeoutMS honored for connection handshake commands if it's lower than timeoutMS - -This test MUST only be run if the server version is 4.4 or higher and the URI has authentication fields (i.e. a username -and password). - -1. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: failCommand, - mode: { times: 1 }, - data: { - failCommands: ["saslContinue"], - blockConnection: true, - blockTimeMS: 15 - } - } - ``` - -2. Create a new MongoClient (referred to as `client`) with `timeoutMS=20` and `serverSelectionTimeoutMS=10`. - -3. Using `client`, insert the document `{ x: 1 }` into collection `db.coll`. - - - Expect this to fail with a timeout error after no more than 15ms. - -### 9. endSession - -This test MUST only be run against replica sets and sharded clusters with server version 4.4 or higher. It MUST be run -three times: once with the timeout specified via the MongoClient `timeoutMS` option, once with the timeout specified via -the ClientSession `defaultTimeoutMS` option, and once more with the timeout specified via the `timeoutMS` option for the -`endSession` operation. In all cases, the timeout MUST be set to 10 milliseconds. - -1. Using `internalClient`, drop the `db.coll` collection. - -2. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: failCommand, - mode: { times: 1 }, - data: { - failCommands: ["abortTransaction"], - blockConnection: true, - blockTimeMS: 15 - } - } - ``` - -3. Create a new MongoClient (referred to as `client`) and an explicit ClientSession derived from that MongoClient - (referred to as `session`). - -4. Execute the following code: - - ```typescript - coll = client.database("db").collection("coll") - session.start_transaction() - coll.insert_one({x: 1}, session=session) - ``` - -5. Using `session`, execute `session.end_session` - - - Expect this to fail with a timeout error after no more than 15ms. - -### 10. Convenient Transactions - -Tests in this section MUST only run against replica sets and sharded clusters with server versions 4.4 or higher. - -#### timeoutMS is refreshed for abortTransaction if the callback fails - -1. Using `internalClient`, drop the `db.coll` collection. - -2. Using `internalClient`, set the following fail point: - - ```javascript - { - configureFailPoint: failCommand, - mode: { times: 2 }, - data: { - failCommands: ["insert", "abortTransaction"], - blockConnection: true, - blockTimeMS: 15 - } - } - ``` - -3. Create a new MongoClient (referred to as `client`) configured with `timeoutMS=10` and an explicit ClientSession - derived from that MongoClient (referred to as `session`). - -4. Using `session`, execute a `withTransaction` operation with the following callback: - - ```typescript - def callback() { - coll = client.database("db").collection("coll") - coll.insert_one({ _id: 1 }, session=session) - } - ``` - -5. Expect the previous `withTransaction` call to fail with a timeout error. - -6. Verify that the following events were published during the `withTransaction` call: - - 1. `command_started` and `command_failed` events for an `insert` command. - 2. `command_started` and `command_failed` events for an `abortTransaction` command. - -## Unit Tests - -The tests enumerated in this section could not be expressed in either spec or prose format. Drivers SHOULD implement -these if it is possible to do so using the driver's existing test infrastructure. - -- Operations should ignore `waitQueueTimeoutMS` if `timeoutMS` is also set. -- If `timeoutMS` is set for an operation, the remaining `timeoutMS` value should apply to connection checkout after a - server has been selected. -- If `timeoutMS` is not set for an operation, `waitQueueTimeoutMS` should apply to connection checkout after a server - has been selected. -- If a new connection is required to execute an operation, - `min(remaining computedServerSelectionTimeout, connectTimeoutMS)` should apply to socket establishment. -- For drivers that have control over OCSP behavior, `min(remaining computedServerSelectionTimeout, 5 seconds)` should - apply to HTTP requests against OCSP responders. -- If `timeoutMS` is unset, operations fail after two non-consecutive socket timeouts. -- The remaining `timeoutMS` value should apply to HTTP requests against KMS servers for CSFLE. -- The remaining `timeoutMS` value should apply to commands sent to mongocryptd as part of automatic encryption. -- When doing `minPoolSize` maintenance, `connectTimeoutMS` is used as the timeout for socket establishment. diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/README.rst b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/README.rst deleted file mode 100644 index 8a6bba61dac..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/README.rst +++ /dev/null @@ -1,616 +0,0 @@ -====================================== -Client Side Operations Timeouts Tests -====================================== - -.. contents:: - ----- - -Introduction -============ - -This document describes the tests that drivers MUST run to validate the behavior of the timeoutMS option. These tests -are broken up into automated YAML/JSON tests and additional prose tests. - -Spec Tests -========== - -This directory contains a set of YAML and JSON spec tests. Drivers MUST run these as described in the "Unified Test -Runner" specification. Because the tests introduced in this specification are timing-based, there is a risk that some -of them may intermittently fail without any bugs being present in the driver. As a mitigation, drivers MAY execute -these tests in two new Evergreen tasks that use single-node replica sets: one with only authentication enabled and -another with both authentication and TLS enabled. Drivers that choose to do so SHOULD use the ``single-node-auth.json`` -and ``single-node-auth-ssl.json`` files in the ``drivers-evergreen-tools`` repository to create these clusters. - -Prose Tests -=========== - -There are some tests that cannot be expressed in the unified YAML/JSON format. For each of these tests, drivers MUST -create a MongoClient without the ``timeoutMS`` option set (referred to as ``internalClient``). Any fail points set -during a test MUST be unset using ``internalClient`` after the test has been executed. All MongoClient instances -created for tests MUST be configured with read/write concern ``majority``, read preference ``primary``, and command -monitoring enabled to listen for ``command_started`` events. - -1. Multi-batch writes -~~~~~~~~~~~~~~~~~~~~~ - -This test MUST only run against standalones on server versions 4.4 and higher. -The ``insertMany`` call takes an exceedingly long time on replicasets and sharded -clusters. Drivers MAY adjust the timeouts used in this test to allow for differing -bulk encoding performance. - -#. Using ``internalClient``, drop the ``db.coll`` collection. -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: "failCommand", - mode: { - times: 2 - }, - data: { - failCommands: ["insert"], - blockConnection: true, - blockTimeMS: 1010 - } - } - -#. Create a new MongoClient (referred to as ``client``) with ``timeoutMS=2000``. -#. Using ``client``, insert 50 1-megabyte documents in a single ``insertMany`` call. - - - Expect this to fail with a timeout error. - -#. Verify that two ``insert`` commands were executed against ``db.coll`` as part of the ``insertMany`` call. - -2. maxTimeMS is not set for commands sent to mongocryptd -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This test MUST only be run against enterprise server versions 4.2 and higher. - -#. Launch a mongocryptd process on 23000. -#. Create a MongoClient (referred to as ``client``) using the URI ``mongodb://localhost:23000/?timeoutMS=1000``. -#. Using ``client``, execute the ``{ ping: 1 }`` command against the ``admin`` database. -#. Verify via command monitoring that the ``ping`` command sent did not contain a ``maxTimeMS`` field. - -3. ClientEncryption -~~~~~~~~~~~~~~~~~~~ - -Each test under this category MUST only be run against server versions 4.4 and higher. In these tests, -``LOCAL_MASTERKEY`` refers to the following base64: - -.. code:: javascript - - Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk - -For each test, perform the following setup: - -#. Using ``internalClient``, drop and create the ``keyvault.datakeys`` collection. -#. Create a MongoClient (referred to as ``keyVaultClient``) with ``timeoutMS=10``. -#. Create a ``ClientEncryption`` object that wraps ``keyVaultClient`` (referred to as ``clientEncryption``). Configure this object with ``keyVaultNamespace`` set to ``keyvault.datakeys`` and the following KMS providers map: - - .. code:: javascript - - { - "local": { "key": } - } - -createDataKey -````````````` - -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: "failCommand", - mode: { - times: 1 - }, - data: { - failCommands: ["insert"], - blockConnection: true, - blockTimeMS: 15 - } - } - -#. Call ``clientEncryption.createDataKey()`` with the ``local`` KMS provider. - - - Expect this to fail with a timeout error. - -#. Verify that an ``insert`` command was executed against to ``keyvault.datakeys`` as part of the ``createDataKey`` call. - -encrypt -``````` - -#. Call ``client_encryption.createDataKey()`` with the ``local`` KMS provider. - - - Expect a BSON binary with subtype 4 to be returned, referred to as ``datakeyId``. - -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: "failCommand", - mode: { - times: 1 - }, - data: { - failCommands: ["find"], - blockConnection: true, - blockTimeMS: 15 - } - } - -#. Call ``clientEncryption.encrypt()`` with the value ``hello``, the algorithm ``AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic``, and the keyId ``datakeyId``. - - - Expect this to fail with a timeout error. - -#. Verify that a ``find`` command was executed against the ``keyvault.datakeys`` collection as part of the ``encrypt`` call. - -decrypt -``````` - -#. Call ``clientEncryption.createDataKey()`` with the ``local`` KMS provider. - - - Expect this to return a BSON binary with subtype 4, referred to as ``dataKeyId``. - -#. Call ``clientEncryption.encrypt()`` with the value ``hello``, the algorithm ``AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic``, and the keyId ``dataKeyId``. - - - Expect this to return a BSON binary with subtype 6, referred to as ``encrypted``. - -#. Close and re-create the ``keyVaultClient`` and ``clientEncryption`` objects. - -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: "failCommand", - mode: { - times: 1 - }, - data: { - failCommands: ["find"], - blockConnection: true, - blockTimeMS: 15 - } - } - -#. Call ``clientEncryption.decrypt()`` with the value ``encrypted``. - - - Expect this to fail with a timeout error. - -#. Verify that a ``find`` command was executed against the ``keyvault.datakeys`` collection as part of the ``decrypt`` call. - -4. Background Connection Pooling -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The tests in this section MUST only be run if the server version is 4.4 or higher and the URI has authentication -fields (i.e. a username and password). Each test in this section requires drivers to create a MongoClient and then wait -for some CMAP events to be published. Drivers MUST wait for up to 10 seconds and fail the test if the specified events -are not published within that time. - -timeoutMS used for handshake commands -````````````````````````````````````` - -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: "failCommand", - mode: { - times: 1 - }, - data: { - failCommands: ["saslContinue"], - blockConnection: true, - blockTimeMS: 15, - appName: "timeoutBackgroundPoolTest" - } - } - -#. Create a MongoClient (referred to as ``client``) configured with the following: - - - ``minPoolSize`` of 1 - - ``timeoutMS`` of 10 - - ``appName`` of ``timeoutBackgroundPoolTest`` - - CMAP monitor configured to listen for ``ConnectionCreatedEvent`` and ``ConnectionClosedEvent`` events. - -#. Wait for a ``ConnectionCreatedEvent`` and a ``ConnectionClosedEvent`` to be published. - -timeoutMS is refreshed for each handshake command -````````````````````````````````````````````````` - -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: "failCommand", - mode: "alwaysOn", - data: { - failCommands: ["hello", "isMaster", "saslContinue"], - blockConnection: true, - blockTimeMS: 15, - appName: "refreshTimeoutBackgroundPoolTest" - } - } - -#. Create a MongoClient (referred to as ``client``) configured with the following: - - - ``minPoolSize`` of 1 - - ``timeoutMS`` of 20 - - ``appName`` of ``refreshTimeoutBackgroundPoolTest`` - - CMAP monitor configured to listen for ``ConnectionCreatedEvent`` and ``ConnectionReady`` events. - -#. Wait for a ``ConnectionCreatedEvent`` and a ``ConnectionReady`` to be published. - -5. Blocking Iteration Methods -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Tests in this section MUST only be run against server versions 4.4 and higher and only apply to drivers that have a -blocking method for cursor iteration that executes ``getMore`` commands in a loop until a document is available or an -error occurs. - -Tailable cursors -```````````````` - -#. Using ``internalClient``, drop the ``db.coll`` collection. -#. Using ``internalClient``, insert the document ``{ x: 1 }`` into ``db.coll``. -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: "failCommand", - mode: "alwaysOn", - data: { - failCommands: ["getMore"], - blockConnection: true, - blockTimeMS: 15 - } - } - -#. Create a new MongoClient (referred to as ``client``) with ``timeoutMS=20``. -#. Using ``client``, create a tailable cursor on ``db.coll`` with ``cursorType=tailable``. - - - Expect this to succeed and return a cursor with a non-zero ID. - -#. Call either a blocking or non-blocking iteration method on the cursor. - - - Expect this to succeed and return the document ``{ x: 1 }`` without sending a ``getMore`` command. - -#. Call the blocking iteration method on the resulting cursor. - - - Expect this to fail with a timeout error. - -#. Verify that a ``find`` command and two ``getMore`` commands were executed against the ``db.coll`` collection during the test. - -Change Streams -`````````````` - -#. Using ``internalClient``, drop the ``db.coll`` collection. -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: "failCommand", - mode: "alwaysOn", - data: { - failCommands: ["getMore"], - blockConnection: true, - blockTimeMS: 15 - } - } - -#. Create a new MongoClient (referred to as ``client``) with ``timeoutMS=20``. -#. Using ``client``, use the ``watch`` helper to create a change stream against ``db.coll``. - - - Expect this to succeed and return a change stream with a non-zero ID. - -#. Call the blocking iteration method on the resulting change stream. - - - Expect this to fail with a timeout error. - -#. Verify that an ``aggregate`` command and two ``getMore`` commands were executed against the ``db.coll`` collection during the test. - -6. GridFS - Upload -~~~~~~~~~~~~~~~~~~ - -Tests in this section MUST only be run against server versions 4.4 and higher. - -uploads via openUploadStream can be timed out -````````````````````````````````````````````` - -#. Using ``internalClient``, drop and re-create the ``db.fs.files`` and ``db.fs.chunks`` collections. -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: "failCommand", - mode: { times: 1 }, - data: { - failCommands: ["insert"], - blockConnection: true, - blockTimeMS: 15 - } - } - -#. Create a new MongoClient (referred to as ``client``) with ``timeoutMS=10``. -#. Using ``client``, create a GridFS bucket (referred to as ``bucket``) that wraps the ``db`` database. -#. Call ``bucket.open_upload_stream()`` with the filename ``filename`` to create an upload stream (referred to as ``uploadStream``). - - - Expect this to succeed and return a non-null stream. - -#. Using ``uploadStream``, upload a single ``0x12`` byte. -#. Call ``uploadStream.close()`` to flush the stream and insert chunks. - - - Expect this to fail with a timeout error. - -Aborting an upload stream can be timed out -`````````````````````````````````````````` - -This test only applies to drivers that provide an API to abort a GridFS upload stream. - -#. Using ``internalClient``, drop and re-create the ``db.fs.files`` and ``db.fs.chunks`` collections. -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: "failCommand", - mode: { times: 1 }, - data: { - failCommands: ["delete"], - blockConnection: true, - blockTimeMS: 15 - } - } - -#. Create a new MongoClient (referred to as ``client``) with ``timeoutMS=10``. -#. Using ``client``, create a GridFS bucket (referred to as ``bucket``) that wraps the ``db`` database with ``chunkSizeBytes=2``. -#. Call ``bucket.open_upload_stream()`` with the filename ``filename`` to create an upload stream (referred to as ``uploadStream``). - - - Expect this to succeed and return a non-null stream. - -#. Using ``uploadStream``, upload the bytes ``[0x01, 0x02, 0x03, 0x04]``. -#. Call ``uploadStream.abort()``. - - - Expect this to fail with a timeout error. - -7. GridFS - Download -~~~~~~~~~~~~~~~~~~~~ - -This test MUST only be run against server versions 4.4 and higher. - -#. Using ``internalClient``, drop and re-create the ``db.fs.files`` and ``db.fs.chunks`` collections. -#. Using ``internalClient``, insert the following document into the ``db.fs.files`` collection: - - .. code:: javascript - - { - "_id": { - "$oid": "000000000000000000000005" - }, - "length": 10, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "57d83cd477bfb1ccd975ab33d827a92b", - "filename": "length-10", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} - } - -#. Create a new MongoClient (referred to as ``client``) with ``timeoutMS=10``. -#. Using ``client``, create a GridFS bucket (referred to as ``bucket``) that wraps the ``db`` database. -#. Call ``bucket.open_download_stream`` with the id ``{ "$oid": "000000000000000000000005" }`` to create a download stream (referred to as ``downloadStream``). - - - Expect this to succeed and return a non-null stream. - -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: "failCommand", - mode: { times: 1 }, - data: { - failCommands: ["find"], - blockConnection: true, - blockTimeMS: 15 - } - } - -#. Read from the ``downloadStream``. - - - Expect this to fail with a timeout error. - -#. Verify that two ``find`` commands were executed during the read: one against ``db.fs.files`` and another against ``db.fs.chunks``. - -8. Server Selection -~~~~~~~~~~~~~~~~~~~ - -serverSelectionTimeoutMS honored if timeoutMS is not set -```````````````````````````````````````````````````````` - -#. Create a MongoClient (referred to as ``client``) with URI ``mongodb://invalid/?serverSelectionTimeoutMS=10``. - -#. Using ``client``, execute the command ``{ ping: 1 }`` against the ``admin`` database. - - - Expect this to fail with a server selection timeout error after no more than 15ms. - -timeoutMS honored for server selection if it's lower than serverSelectionTimeoutMS -`````````````````````````````````````````````````````````````````````````````````` - -#. Create a MongoClient (referred to as ``client``) with URI ``mongodb://invalid/?timeoutMS=10&serverSelectionTimeoutMS=20``. - -#. Using ``client``, run the command ``{ ping: 1 }`` against the ``admin`` database. - - - Expect this to fail with a server selection timeout error after no more than 15ms. - -serverSelectionTimeoutMS honored for server selection if it's lower than timeoutMS -`````````````````````````````````````````````````````````````````````````````````` - -#. Create a MongoClient (referred to as ``client``) with URI ``mongodb://invalid/?timeoutMS=20&serverSelectionTimeoutMS=10``. - -#. Using ``client``, run the command ``{ ping: 1 }`` against the ``admin`` database. - - - Expect this to fail with a server selection timeout error after no more than 15ms. - -serverSelectionTimeoutMS honored for server selection if timeoutMS=0 -```````````````````````````````````````````````````````````````````` - -#. Create a MongoClient (referred to as ``client``) with URI ``mongodb://invalid/?timeoutMS=0&serverSelectionTimeoutMS=10``. - -#. Using ``client``, run the command ``{ ping: 1 }`` against the ``admin`` database. - - - Expect this to fail with a server selection timeout error after no more than 15ms. - -timeoutMS honored for connection handshake commands if it's lower than serverSelectionTimeoutMS -``````````````````````````````````````````````````````````````````````````````````````````````` - -This test MUST only be run if the server version is 4.4 or higher and the URI has authentication fields (i.e. a -username and password). - -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: failCommand, - mode: { times: 1 }, - data: { - failCommands: ["saslContinue"], - blockConnection: true, - blockTimeMS: 15 - } - } - -#. Create a new MongoClient (referred to as ``client``) with ``timeoutMS=10`` and ``serverSelectionTimeoutMS=20``. -#. Using ``client``, insert the document ``{ x: 1 }`` into collection ``db.coll``. - - - Expect this to fail with a timeout error after no more than 15ms. - -serverSelectionTimeoutMS honored for connection handshake commands if it's lower than timeoutMS -``````````````````````````````````````````````````````````````````````````````````````````````` - -This test MUST only be run if the server version is 4.4 or higher and the URI has authentication fields (i.e. a -username and password). - -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: failCommand, - mode: { times: 1 }, - data: { - failCommands: ["saslContinue"], - blockConnection: true, - blockTimeMS: 15 - } - } - -#. Create a new MongoClient (referred to as ``client``) with ``timeoutMS=20`` and ``serverSelectionTimeoutMS=10``. -#. Using ``client``, insert the document ``{ x: 1 }`` into collection ``db.coll``. - - - Expect this to fail with a timeout error after no more than 15ms. - -9. endSession -~~~~~~~~~~~~~ - -This test MUST only be run against replica sets and sharded clusters with server version 4.4 or higher. It MUST be -run three times: once with the timeout specified via the MongoClient ``timeoutMS`` option, once with the timeout -specified via the ClientSession ``defaultTimeoutMS`` option, and once more with the timeout specified via the -``timeoutMS`` option for the ``endSession`` operation. In all cases, the timeout MUST be set to 10 milliseconds. - -#. Using ``internalClient``, drop the ``db.coll`` collection. -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: failCommand, - mode: { times: 1 }, - data: { - failCommands: ["abortTransaction"], - blockConnection: true, - blockTimeMS: 15 - } - } - -#. Create a new MongoClient (referred to as ``client``) and an explicit ClientSession derived from that MongoClient (referred to as ``session``). -#. Execute the following code: - - .. code:: typescript - - coll = client.database("db").collection("coll") - session.start_transaction() - coll.insert_one({x: 1}, session=session) - -#. Using ``session``, execute ``session.end_session`` - - - Expect this to fail with a timeout error after no more than 15ms. - -10. Convenient Transactions -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Tests in this section MUST only run against replica sets and sharded clusters with server versions 4.4 or higher. - -timeoutMS is refreshed for abortTransaction if the callback fails -````````````````````````````````````````````````````````````````` - -#. Using ``internalClient``, drop the ``db.coll`` collection. -#. Using ``internalClient``, set the following fail point: - - .. code:: javascript - - { - configureFailPoint: failCommand, - mode: { times: 2 }, - data: { - failCommands: ["insert", "abortTransaction"], - blockConnection: true, - blockTimeMS: 15 - } - } - -#. Create a new MongoClient (referred to as ``client``) configured with ``timeoutMS=10`` and an explicit ClientSession derived from that MongoClient (referred to as ``session``). -#. Using ``session``, execute a ``withTransaction`` operation with the following callback: - - .. code:: typescript - - def callback() { - coll = client.database("db").collection("coll") - coll.insert_one({ _id: 1 }, session=session) - } - -#. Expect the previous ``withTransaction`` call to fail with a timeout error. -#. Verify that the following events were published during the ``withTransaction`` call: - - #. ``command_started`` and ``command_failed`` events for an ``insert`` command. - #. ``command_started`` and ``command_failed`` events for an ``abortTransaction`` command. - -Unit Tests -========== - -The tests enumerated in this section could not be expressed in either spec or prose format. Drivers SHOULD implement -these if it is possible to do so using the driver's existing test infrastructure. - -- Operations should ignore ``waitQueueTimeoutMS`` if ``timeoutMS`` is also set. -- If ``timeoutMS`` is set for an operation, the remaining ``timeoutMS`` value should apply to connection checkout after a server has been selected. -- If ``timeoutMS`` is not set for an operation, ``waitQueueTimeoutMS`` should apply to connection checkout after a server has been selected. -- If a new connection is required to execute an operation, ``min(remaining computedServerSelectionTimeout, connectTimeoutMS)`` should apply to socket establishment. -- For drivers that have control over OCSP behavior, ``min(remaining computedServerSelectionTimeout, 5 seconds)`` should apply to HTTP requests against OCSP responders. -- If ``timeoutMS`` is unset, operations fail after two non-consecutive socket timeouts. -- The remaining ``timeoutMS`` value should apply to HTTP requests against KMS servers for CSFLE. -- The remaining ``timeoutMS`` value should apply to commands sent to mongocryptd as part of automatic encryption. -- When doing ``minPoolSize`` maintenance, ``connectTimeoutMS`` is used as the timeout for socket establishment. diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/bulkWrite.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/bulkWrite.json deleted file mode 100644 index 9a05809f77c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/bulkWrite.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "description": "timeoutMS behaves correctly for bulkWrite operations", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "uriOptions": { - "w": 1 - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "timeoutMS applied to entire bulkWrite, not individual commands", - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": {} - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert", - "update" - ], - "blockConnection": true, - "blockTimeMS": 120 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 1 - } - } - } - ], - "timeoutMS": 200 - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/change-streams.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/change-streams.json deleted file mode 100644 index 8cffb08e267..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/change-streams.json +++ /dev/null @@ -1,598 +0,0 @@ -{ - "description": "timeoutMS behaves correctly for change streams", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "error if maxAwaitTimeMS is greater than timeoutMS", - "operations": [ - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [], - "timeoutMS": 5, - "maxAwaitTimeMS": 10 - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "error if maxAwaitTimeMS is equal to timeoutMS", - "operations": [ - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [], - "timeoutMS": 5, - "maxAwaitTimeMS": 5 - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "timeoutMS applied to initial aggregate", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [], - "timeoutMS": 200 - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS is refreshed for getMore if maxAwaitTimeMS is not set", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate", - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 30 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [], - "timeoutMS": 1050 - }, - "saveResultAsEntity": "changeStream" - }, - { - "name": "iterateOnce", - "object": "changeStream" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS is refreshed for getMore if maxAwaitTimeMS is set", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate", - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 150 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [], - "timeoutMS": 200, - "batchSize": 2, - "maxAwaitTimeMS": 1 - }, - "saveResultAsEntity": "changeStream" - }, - { - "name": "iterateOnce", - "object": "changeStream" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll", - "maxTimeMS": 1 - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to full resume attempt in a next call", - "operations": [ - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [], - "timeoutMS": 200 - }, - "saveResultAsEntity": "changeStream" - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "getMore", - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 120, - "errorCode": 7, - "errorLabels": [ - "ResumableChangeStreamError" - ] - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "change stream can be iterated again if previous iteration times out", - "operations": [ - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [], - "maxAwaitTimeMS": 1, - "timeoutMS": 200 - }, - "saveResultAsEntity": "changeStream" - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream", - "expectError": { - "isTimeoutError": true - } - }, - { - "name": "iterateOnce", - "object": "changeStream" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll" - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS is refreshed for getMore - failure", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [], - "timeoutMS": 200 - }, - "saveResultAsEntity": "changeStream" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/close-cursors.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/close-cursors.json deleted file mode 100644 index 79b0de7b6aa..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/close-cursors.json +++ /dev/null @@ -1,239 +0,0 @@ -{ - "description": "timeoutMS behaves correctly when closing cursors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [ - { - "_id": 0 - }, - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "timeoutMS is refreshed for close", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "createFindCursor", - "object": "collection", - "arguments": { - "filter": {}, - "batchSize": 2, - "timeoutMS": 200 - }, - "saveResultAsEntity": "cursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor", - "expectError": { - "isTimeoutError": true - } - }, - { - "name": "close", - "object": "cursor" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "getMore" - } - }, - { - "commandFailedEvent": { - "commandName": "getMore" - } - }, - { - "commandStartedEvent": { - "command": { - "killCursors": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - }, - "commandName": "killCursors" - } - }, - { - "commandSucceededEvent": { - "commandName": "killCursors" - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be overridden for close", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "killCursors" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "createFindCursor", - "object": "collection", - "arguments": { - "filter": {}, - "batchSize": 2, - "timeoutMS": 200 - }, - "saveResultAsEntity": "cursor" - }, - { - "name": "close", - "object": "cursor", - "arguments": { - "timeoutMS": 400 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "command": { - "killCursors": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - }, - "commandName": "killCursors" - } - }, - { - "commandSucceededEvent": { - "commandName": "killCursors" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/command-execution.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/command-execution.json deleted file mode 100644 index aa9c3eb23f3..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/command-execution.json +++ /dev/null @@ -1,393 +0,0 @@ -{ - "description": "timeoutMS behaves correctly during command execution", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4.7", - "topologies": [ - "single", - "replicaset", - "sharded" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - }, - { - "collectionName": "timeoutColl", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "maxTimeMS value in the command is less than timeoutMS", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "reduceMaxTimeMSTest", - "blockConnection": true, - "blockTimeMS": 50 - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "uriOptions": { - "appName": "reduceMaxTimeMSTest", - "w": 1, - "timeoutMS": 500, - "heartbeatFrequencyMS": 500 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "timeoutCollection", - "database": "database", - "collectionName": "timeoutColl" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "timeoutCollection", - "arguments": { - "document": { - "_id": 1 - }, - "timeoutMS": 100000 - } - }, - { - "name": "wait", - "object": "testRunner", - "arguments": { - "ms": 1000 - } - }, - { - "name": "insertOne", - "object": "timeoutCollection", - "arguments": { - "document": { - "_id": 2 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "timeoutColl" - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "timeoutColl", - "maxTimeMS": { - "$$lte": 450 - } - } - } - } - ] - } - ] - }, - { - "description": "command is not sent if RTT is greater than timeoutMS", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "rttTooHighTest", - "blockConnection": true, - "blockTimeMS": 50 - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "uriOptions": { - "appName": "rttTooHighTest", - "w": 1, - "timeoutMS": 10, - "heartbeatFrequencyMS": 500 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "timeoutCollection", - "database": "database", - "collectionName": "timeoutColl" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "timeoutCollection", - "arguments": { - "document": { - "_id": 1 - }, - "timeoutMS": 100000 - } - }, - { - "name": "wait", - "object": "testRunner", - "arguments": { - "ms": 1000 - } - }, - { - "name": "insertOne", - "object": "timeoutCollection", - "arguments": { - "document": { - "_id": 2 - } - }, - "expectError": { - "isTimeoutError": true - } - }, - { - "name": "insertOne", - "object": "timeoutCollection", - "arguments": { - "document": { - "_id": 3 - } - }, - "expectError": { - "isTimeoutError": true - } - }, - { - "name": "insertOne", - "object": "timeoutCollection", - "arguments": { - "document": { - "_id": 4 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "timeoutColl" - } - } - } - ] - } - ] - }, - { - "description": "short-circuit is not enabled with only 1 RTT measurement", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "reduceMaxTimeMSTest", - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "uriOptions": { - "appName": "reduceMaxTimeMSTest", - "w": 1, - "timeoutMS": 90, - "heartbeatFrequencyMS": 100000 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "timeoutCollection", - "database": "database", - "collectionName": "timeoutColl" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "timeoutCollection", - "arguments": { - "document": { - "_id": 1 - }, - "timeoutMS": 100000 - } - }, - { - "name": "insertOne", - "object": "timeoutCollection", - "arguments": { - "document": { - "_id": 2 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "timeoutColl" - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "timeoutColl", - "maxTimeMS": { - "$$lte": 450 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/convenient-transactions.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/convenient-transactions.json deleted file mode 100644 index 3868b3026c2..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/convenient-transactions.json +++ /dev/null @@ -1,209 +0,0 @@ -{ - "description": "timeoutMS behaves correctly for the withTransaction API", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 500 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "withTransaction raises a client-side error if timeoutMS is overridden inside the callback", - "operations": [ - { - "name": "withTransaction", - "object": "session", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1 - }, - "session": "session", - "timeoutMS": 100 - }, - "expectError": { - "isClientError": true - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [] - } - ] - }, - { - "description": "timeoutMS is not refreshed for each operation in the callback", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 300 - } - } - } - }, - { - "name": "withTransaction", - "object": "session", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1 - }, - "session": "session" - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 2 - }, - "session": "session" - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction", - "databaseName": "admin", - "command": { - "abortTransaction": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/cursors.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/cursors.json deleted file mode 100644 index 36949d75091..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/cursors.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "description": "tests for timeoutMS behavior that applies to all cursor types", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client" - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "find errors if timeoutMode is set and timeoutMS is not", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "timeoutMode": "cursorLifetime" - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "collection aggregate errors if timeoutMode is set and timeoutMS is not", - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [], - "timeoutMode": "cursorLifetime" - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "database aggregate errors if timeoutMode is set and timeoutMS is not", - "operations": [ - { - "name": "aggregate", - "object": "database", - "arguments": { - "pipeline": [], - "timeoutMode": "cursorLifetime" - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "listCollections errors if timeoutMode is set and timeoutMS is not", - "operations": [ - { - "name": "listCollections", - "object": "database", - "arguments": { - "filter": {}, - "timeoutMode": "cursorLifetime" - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "listIndexes errors if timeoutMode is set and timeoutMS is not", - "operations": [ - { - "name": "listIndexes", - "object": "collection", - "arguments": { - "timeoutMode": "cursorLifetime" - }, - "expectError": { - "isClientError": true - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/deprecated-options.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/deprecated-options.json deleted file mode 100644 index 2ecba25f0d3..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/deprecated-options.json +++ /dev/null @@ -1,7180 +0,0 @@ -{ - "description": "operations ignore deprecated timeout options if timeoutMS is set", - "comment": "Manually changed session to use defaultTimeoutMS when testing socket / maxCommit overrides", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "commitTransaction ignores socketTimeoutMS if timeoutMS is set", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 20 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "aggregate" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client", - "sessionOptions": { - "defaultTimeoutMS": 10000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "startTransaction", - "object": "session" - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {}, - "session": "session" - } - }, - { - "name": "commitTransaction", - "object": "session" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "commitTransaction", - "databaseName": "admin", - "command": { - "commitTransaction": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "commitTransaction ignores wTimeoutMS if timeoutMS is set", - "comment": "Moved timeoutMS from commitTransaction to startTransaction manually, as commitTransaction does not support a timeoutMS option.", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "aggregate" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "startTransaction", - "object": "session", - "arguments": { - "timeoutMS": 10000 - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {}, - "session": "session" - } - }, - { - "name": "commitTransaction", - "object": "session" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "commitTransaction", - "databaseName": "admin", - "command": { - "commitTransaction": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "commitTransaction ignores maxCommitTimeMS if timeoutMS is set", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "aggregate" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client", - "sessionOptions": { - "defaultTimeoutMS": 1000, - "defaultTransactionOptions": { - "maxCommitTimeMS": 5000 - } - } - } - } - ] - } - }, - { - "name": "startTransaction", - "object": "session" - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {}, - "session": "session" - } - }, - { - "name": "commitTransaction", - "object": "session" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "commitTransaction", - "databaseName": "admin", - "command": { - "commitTransaction": 1, - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "abortTransaction ignores socketTimeoutMS if timeoutMS is set", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 20 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "aggregate" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client", - "sessionOptions": { - "defaultTimeoutMS": 10000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "startTransaction", - "object": "session" - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {}, - "session": "session" - } - }, - { - "name": "abortTransaction", - "object": "session" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "abortTransaction", - "databaseName": "admin", - "command": { - "abortTransaction": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "abortTransaction ignores wTimeoutMS if timeoutMS is set", - "comment": "Moved timeoutMS from abortTransaction to startTransaction manually, as abortTransaction does not support a timeoutMS option.", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "aggregate" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "startTransaction", - "object": "session", - "arguments": { - "timeoutMS": 10000 - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {}, - "session": "session" - } - }, - { - "name": "abortTransaction", - "object": "session" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "abortTransaction", - "databaseName": "admin", - "command": { - "abortTransaction": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "withTransaction ignores socketTimeoutMS if timeoutMS is set", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 20 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "withTransaction", - "object": "session", - "arguments": { - "timeoutMS": 10000, - "callback": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {}, - "session": "session" - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction", - "databaseName": "admin", - "command": { - "commitTransaction": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "withTransaction ignores wTimeoutMS if timeoutMS is set", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "withTransaction", - "object": "session", - "arguments": { - "timeoutMS": 10000, - "callback": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {}, - "session": "session" - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction", - "databaseName": "admin", - "command": { - "commitTransaction": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "withTransaction ignores maxCommitTimeMS if timeoutMS is set", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client", - "sessionOptions": { - "defaultTransactionOptions": { - "maxCommitTimeMS": 5000 - } - } - } - } - ] - } - }, - { - "name": "withTransaction", - "object": "session", - "arguments": { - "timeoutMS": 1000, - "callback": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {}, - "session": "session" - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction", - "databaseName": "admin", - "command": { - "commitTransaction": 1, - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - listDatabases on client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - listDatabases on client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - listDatabaseNames on client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "listDatabaseNames", - "object": "client", - "arguments": { - "timeoutMS": 100000 - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - listDatabaseNames on client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "listDatabaseNames", - "object": "client", - "arguments": { - "timeoutMS": 100000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - createChangeStream on client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "timeoutMS": 100000, - "pipeline": [] - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - createChangeStream on client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "timeoutMS": 100000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - aggregate on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "timeoutMS": 100000, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - aggregate on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "timeoutMS": 100000, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - aggregate on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - listCollections on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - listCollections on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - listCollectionNames on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - listCollectionNames on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - runCommand on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "ping" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "timeoutMS": 100000, - "command": { - "ping": 1 - }, - "commandName": "ping" - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - runCommand on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "timeoutMS": 100000, - "command": { - "ping": 1 - }, - "commandName": "ping" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "ping", - "databaseName": "test", - "command": { - "ping": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - createChangeStream on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "timeoutMS": 100000, - "pipeline": [] - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - createChangeStream on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "timeoutMS": 100000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - aggregate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "pipeline": [] - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - aggregate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - aggregate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - count on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - count on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - count on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - countDocuments on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - countDocuments on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - estimatedDocumentCount on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection", - "arguments": { - "timeoutMS": 100000 - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - estimatedDocumentCount on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection", - "arguments": { - "timeoutMS": 100000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - estimatedDocumentCount on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - distinct on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "fieldName": "x", - "filter": {} - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - distinct on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - distinct on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000, - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - find on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - find on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - find on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - findOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - findOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - findOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - listIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "listIndexes", - "object": "collection", - "arguments": { - "timeoutMS": 100000 - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - listIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "listIndexes", - "object": "collection", - "arguments": { - "timeoutMS": 100000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - listIndexNames on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "listIndexNames", - "object": "collection", - "arguments": { - "timeoutMS": 100000 - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - listIndexNames on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "listIndexNames", - "object": "collection", - "arguments": { - "timeoutMS": 100000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - createChangeStream on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "pipeline": [] - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - createChangeStream on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - insertOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "document": { - "x": 1 - } - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - insertOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - insertMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "documents": [ - { - "x": 1 - } - ] - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - insertMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "documents": [ - { - "x": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - deleteOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - deleteOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - deleteMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - deleteMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - replaceOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - replaceOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - updateOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - updateOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - updateMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "updateMany", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - updateMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "updateMany", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - findOneAndDelete on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - findOneAndDelete on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - findOneAndDelete on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - findOneAndReplace on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - findOneAndReplace on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - findOneAndReplace on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - findOneAndUpdate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - findOneAndUpdate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - findOneAndUpdate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - bulkWrite on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - bulkWrite on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - createIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "createIndexes" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "createIndex", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "keys": { - "x": 1 - }, - "name": "x_1" - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - createIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "createIndex", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "keys": { - "x": 1 - }, - "name": "x_1" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "createIndexes", - "databaseName": "test", - "command": { - "createIndexes": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - createIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "createIndex", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000, - "keys": { - "x": 1 - }, - "name": "x_1" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "createIndexes", - "databaseName": "test", - "command": { - "createIndexes": "coll", - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - dropIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "dropIndex", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - dropIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "dropIndex", - "object": "collection", - "arguments": { - "timeoutMS": 100000, - "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - dropIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "dropIndex", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000, - "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - }, - { - "description": "socketTimeoutMS is ignored if timeoutMS is set - dropIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 1 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 5 - } - } - } - }, - { - "name": "dropIndexes", - "object": "collection", - "arguments": { - "timeoutMS": 100000 - } - } - ] - }, - { - "description": "wTimeoutMS is ignored if timeoutMS is set - dropIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "wTimeoutMS": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "dropIndexes", - "object": "collection", - "arguments": { - "timeoutMS": 100000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS is ignored if timeoutMS is set - dropIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ] - } - }, - { - "name": "dropIndexes", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "maxTimeMS": 5000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$lte": 1000 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/error-transformations.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/error-transformations.json deleted file mode 100644 index 4889e39583a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/error-transformations.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "description": "MaxTimeMSExpired server errors are transformed into a custom timeout error", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.2", - "topologies": [ - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "basic MaxTimeMSExpired error is transformed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 50 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "write concern error MaxTimeMSExpired is transformed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "writeConcernError": { - "code": 50, - "errmsg": "maxTimeMS expired" - } - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/global-timeoutMS.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/global-timeoutMS.json deleted file mode 100644 index 740bbad2e2c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/global-timeoutMS.json +++ /dev/null @@ -1,5830 +0,0 @@ -{ - "description": "timeoutMS can be configured on a MongoClient", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "timeoutMS can be configured on a MongoClient - listDatabases on client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - listDatabases on client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - listDatabaseNames on client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "listDatabaseNames", - "object": "client", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - listDatabaseNames on client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - createChangeStream on client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - createChangeStream on client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - aggregate on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - aggregate on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - listCollections on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - listCollections on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - listCollectionNames on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - listCollectionNames on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - runCommand on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "ping": 1 - }, - "commandName": "ping" - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "ping", - "databaseName": "test", - "command": { - "ping": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - runCommand on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "ping" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "ping": 1 - }, - "commandName": "ping" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "ping", - "databaseName": "test", - "command": { - "ping": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - createChangeStream on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - createChangeStream on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - aggregate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - aggregate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - count on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - count on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - countDocuments on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - countDocuments on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - estimatedDocumentCount on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - estimatedDocumentCount on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - distinct on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "distinct" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - distinct on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - find on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - find on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - findOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - findOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - listIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "listIndexes", - "object": "collection", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - listIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - listIndexNames on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "listIndexNames", - "object": "collection", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - listIndexNames on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - createChangeStream on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - createChangeStream on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - insertOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - insertOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - insertMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "x": 1 - } - ] - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - insertMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "x": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - deleteOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - deleteOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - deleteMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - deleteMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - replaceOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - replaceOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - updateOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - updateOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - updateMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "updateMany", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - updateMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateMany", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - findOneAndDelete on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - findOneAndDelete on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - findOneAndReplace on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - findOneAndReplace on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - findOneAndUpdate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - findOneAndUpdate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - bulkWrite on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - bulkWrite on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - createIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "createIndexes" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "createIndex", - "object": "collection", - "arguments": { - "keys": { - "x": 1 - }, - "name": "x_1" - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "createIndexes", - "databaseName": "test", - "command": { - "createIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - createIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "createIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createIndex", - "object": "collection", - "arguments": { - "keys": { - "x": 1 - }, - "name": "x_1" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "createIndexes", - "databaseName": "test", - "command": { - "createIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - dropIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "dropIndex", - "object": "collection", - "arguments": { - "name": "x_1" - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - dropIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndex", - "object": "collection", - "arguments": { - "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoClient - dropIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 250 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 350 - } - } - } - }, - { - "name": "dropIndexes", - "object": "collection", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoClient - dropIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 0 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-advanced.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-advanced.json deleted file mode 100644 index c6c0944d2f4..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-advanced.json +++ /dev/null @@ -1,385 +0,0 @@ -{ - "description": "timeoutMS behaves correctly for advanced GridFS API operations", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 75 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "collection": { - "id": "filesCollection", - "database": "database", - "collectionName": "fs.files" - } - }, - { - "collection": { - "id": "chunksCollection", - "database": "database", - "collectionName": "fs.chunks" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "test", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000005" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "test", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000005" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000006" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 1, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - } - ] - } - ], - "tests": [ - { - "description": "timeoutMS can be overridden for a rename", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "rename", - "object": "bucket", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - }, - "newFilename": "foo", - "timeoutMS": 2000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "fs.files", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to update during a rename", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "rename", - "object": "bucket", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - }, - "newFilename": "foo" - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "fs.files", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be overridden for drop", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "drop" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "drop", - "object": "bucket", - "arguments": { - "timeoutMS": 2000 - } - } - ] - }, - { - "description": "timeoutMS applied to files collection drop", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "drop" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "drop", - "object": "bucket", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "drop", - "databaseName": "test", - "command": { - "drop": "fs.files", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to chunks collection drop", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "skip": 1 - }, - "data": { - "failCommands": [ - "drop" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "drop", - "object": "bucket", - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "timeoutMS applied to drop as a whole, not individual parts", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "drop" - ], - "blockConnection": true, - "blockTimeMS": 50 - } - } - } - }, - { - "name": "drop", - "object": "bucket", - "expectError": { - "isTimeoutError": true - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-delete.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-delete.json deleted file mode 100644 index 9f4980114be..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-delete.json +++ /dev/null @@ -1,285 +0,0 @@ -{ - "description": "timeoutMS behaves correctly for GridFS delete operations", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 75 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "collection": { - "id": "filesCollection", - "database": "database", - "collectionName": "fs.files" - } - }, - { - "collection": { - "id": "chunksCollection", - "database": "database", - "collectionName": "fs.chunks" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "test", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000005" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "test", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000005" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000006" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 1, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - } - ] - } - ], - "tests": [ - { - "description": "timeoutMS can be overridden for delete", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "delete", - "object": "bucket", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - }, - "timeoutMS": 1000 - } - } - ] - }, - { - "description": "timeoutMS applied to delete against the files collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "delete", - "object": "bucket", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "fs.files", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to delete against the chunks collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "skip": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "delete", - "object": "bucket", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "timeoutMS applied to entire delete, not individual parts", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 50 - } - } - } - }, - { - "name": "delete", - "object": "bucket", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-download.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-download.json deleted file mode 100644 index fb0b582706c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-download.json +++ /dev/null @@ -1,360 +0,0 @@ -{ - "description": "timeoutMS behaves correctly for GridFS download operations", - "comment": "Manually increased timeouts to reduce races", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 200 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "collection": { - "id": "filesCollection", - "database": "database", - "collectionName": "fs.files" - } - }, - { - "collection": { - "id": "chunksCollection", - "database": "database", - "collectionName": "fs.chunks" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "test", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000005" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-8", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "test", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000005" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000006" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 1, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - } - ] - } - ], - "tests": [ - { - "description": "timeoutMS can be overridden for download", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "download", - "object": "bucket", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - }, - "timeoutMS": 1000 - } - } - ] - }, - { - "description": "timeoutMS applied to find to get files document", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "download", - "object": "bucket", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "fs.files", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to find to get chunks", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "skip": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "download", - "object": "bucket", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "fs.files", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "fs.chunks", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to entire download, not individual parts", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "download", - "object": "bucket", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "fs.files", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "fs.chunks", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-find.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-find.json deleted file mode 100644 index 74090362844..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-find.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "description": "timeoutMS behaves correctly for GridFS find operations", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 75 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "collection": { - "id": "filesCollection", - "database": "database", - "collectionName": "fs.files" - } - }, - { - "collection": { - "id": "chunksCollection", - "database": "database", - "collectionName": "fs.chunks" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "test", - "documents": [] - }, - { - "collectionName": "fs.chunks", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "timeoutMS can be overridden for a find", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "find", - "object": "bucket", - "arguments": { - "filter": {}, - "timeoutMS": 1000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "fs.files", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to find command", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "find", - "object": "bucket", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "fs.files", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-upload.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-upload.json deleted file mode 100644 index b3f174973de..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/gridfs-upload.json +++ /dev/null @@ -1,409 +0,0 @@ -{ - "description": "timeoutMS behaves correctly for GridFS upload operations", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 75 - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "bucket": { - "id": "bucket", - "database": "database" - } - }, - { - "collection": { - "id": "filesCollection", - "database": "database", - "collectionName": "fs.files" - } - }, - { - "collection": { - "id": "chunksCollection", - "database": "database", - "collectionName": "fs.chunks" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "test", - "documents": [] - }, - { - "collectionName": "fs.chunks", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "timeoutMS can be overridden for upload", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "upload", - "object": "bucket", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455" - }, - "timeoutMS": 1000 - } - } - ] - }, - { - "description": "timeoutMS applied to initial find on files collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "upload", - "object": "bucket", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "timeoutMS applied to listIndexes on files collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "upload", - "object": "bucket", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "timeoutMS applied to index creation for files collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "createIndexes" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "upload", - "object": "bucket", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "timeoutMS applied to listIndexes on chunks collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "skip": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "upload", - "object": "bucket", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "timeoutMS applied to index creation for chunks collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "skip": 1 - }, - "data": { - "failCommands": [ - "createIndexes" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "upload", - "object": "bucket", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "timeoutMS applied to chunk insertion", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "upload", - "object": "bucket", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "timeoutMS applied to creation of files document", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "skip": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 100 - } - } - } - }, - { - "name": "upload", - "object": "bucket", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "timeoutMS applied to upload as a whole, not individual parts", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find", - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 50 - } - } - } - }, - { - "name": "upload", - "object": "bucket", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455" - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/legacy-timeouts.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/legacy-timeouts.json deleted file mode 100644 index 535425c934a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/legacy-timeouts.json +++ /dev/null @@ -1,379 +0,0 @@ -{ - "description": "legacy timeouts continue to work if timeoutMS is not set", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "socketTimeoutMS is not used to derive a maxTimeMS command field", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent" - ], - "uriOptions": { - "socketTimeoutMS": 50000 - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "waitQueueTimeoutMS is not used to derive a maxTimeMS command field", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent" - ], - "uriOptions": { - "waitQueueTimeoutMS": 50000 - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "wTimeoutMS is not used to derive a maxTimeMS command field", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent" - ], - "uriOptions": { - "wTimeoutMS": 50000 - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - }, - "writeConcern": { - "wtimeout": 50000 - } - } - } - } - ] - } - ] - }, - { - "description": "maxTimeMS option is used directly as the maxTimeMS field on a command", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection", - "arguments": { - "maxTimeMS": 50000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": 50000 - } - } - } - ] - } - ] - }, - { - "description": "maxCommitTimeMS option is used directly as the maxTimeMS field on a commitTransaction command", - "runOnRequirements": [ - { - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client", - "sessionOptions": { - "defaultTransactionOptions": { - "maxCommitTimeMS": 1000 - } - } - } - } - ] - } - }, - { - "name": "startTransaction", - "object": "session" - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1 - }, - "session": "session" - } - }, - { - "name": "commitTransaction", - "object": "session" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction", - "databaseName": "admin", - "command": { - "commitTransaction": 1, - "maxTimeMS": 1000 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/non-tailable-cursors.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/non-tailable-cursors.json deleted file mode 100644 index dd22ac3996f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/non-tailable-cursors.json +++ /dev/null @@ -1,542 +0,0 @@ -{ - "description": "timeoutMS behaves correctly for non-tailable cursors", - "comment": "Manually reduced blockTimeMS for tests to pass in serverless", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 200 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [ - { - "_id": 0 - }, - { - "_id": 1 - }, - { - "_id": 2 - } - ] - }, - { - "collectionName": "aggregateOutputColl", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "timeoutMS applied to find if timeoutMode is cursor_lifetime", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "timeoutMode": "cursorLifetime" - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "remaining timeoutMS applied to getMore if timeoutMode is unset", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find", - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 101 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "timeoutMS": 200, - "batchSize": 2 - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "remaining timeoutMS applied to getMore if timeoutMode is cursor_lifetime", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find", - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 101 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "timeoutMode": "cursorLifetime", - "timeoutMS": 200, - "batchSize": 2 - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to find if timeoutMode is iteration", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "timeoutMode": "iteration" - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS is refreshed for getMore if timeoutMode is iteration - success", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find", - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 101 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "timeoutMode": "iteration", - "timeoutMS": 200, - "batchSize": 2 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS is refreshed for getMore if timeoutMode is iteration - failure", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "timeoutMode": "iteration", - "batchSize": 2 - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "aggregate with $out errors if timeoutMode is iteration", - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$out": "aggregateOutputColl" - } - ], - "timeoutMS": 100, - "timeoutMode": "iteration" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [] - } - ] - }, - { - "description": "aggregate with $merge errors if timeoutMode is iteration", - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$merge": "aggregateOutputColl" - } - ], - "timeoutMS": 100, - "timeoutMode": "iteration" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/override-collection-timeoutMS.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/override-collection-timeoutMS.json deleted file mode 100644 index d17e22fc2f4..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/override-collection-timeoutMS.json +++ /dev/null @@ -1,3498 +0,0 @@ -{ - "description": "timeoutMS can be overridden for a MongoCollection", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 10 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "timeoutMS can be configured on a MongoCollection - aggregate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - aggregate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - count on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - count on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - countDocuments on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - countDocuments on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - estimatedDocumentCount on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - estimatedDocumentCount on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - distinct on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - distinct on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - find on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - find on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - findOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - findOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - listIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - listIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - listIndexNames on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - listIndexNames on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - createChangeStream on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - createChangeStream on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - insertOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - insertOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - insertMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "x": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - insertMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "x": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - deleteOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - deleteOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - deleteMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - deleteMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - replaceOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - replaceOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - updateOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - updateOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - updateMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateMany", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - updateMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateMany", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - findOneAndDelete on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - findOneAndDelete on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - findOneAndReplace on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - findOneAndReplace on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - findOneAndUpdate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - findOneAndUpdate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - bulkWrite on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - bulkWrite on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - createIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "createIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createIndex", - "object": "collection", - "arguments": { - "keys": { - "x": 1 - }, - "name": "x_1" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "createIndexes", - "databaseName": "test", - "command": { - "createIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - createIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "createIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createIndex", - "object": "collection", - "arguments": { - "keys": { - "x": 1 - }, - "name": "x_1" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "createIndexes", - "databaseName": "test", - "command": { - "createIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - dropIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndex", - "object": "collection", - "arguments": { - "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - dropIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndex", - "object": "collection", - "arguments": { - "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoCollection - dropIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 1000 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoCollection - dropIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll", - "collectionOptions": { - "timeoutMS": 0 - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/override-database-timeoutMS.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/override-database-timeoutMS.json deleted file mode 100644 index f7fa642c582..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/override-database-timeoutMS.json +++ /dev/null @@ -1,4622 +0,0 @@ -{ - "description": "timeoutMS can be overridden for a MongoDatabase", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 10 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "timeoutMS can be configured on a MongoDatabase - aggregate on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - aggregate on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - listCollections on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - listCollections on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - listCollectionNames on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - listCollectionNames on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - runCommand on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "ping" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "ping": 1 - }, - "commandName": "ping" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "ping", - "databaseName": "test", - "command": { - "ping": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - runCommand on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "ping" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "ping": 1 - }, - "commandName": "ping" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "ping", - "databaseName": "test", - "command": { - "ping": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - createChangeStream on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - createChangeStream on database", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - aggregate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - aggregate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - count on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - count on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - countDocuments on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - countDocuments on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - estimatedDocumentCount on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - estimatedDocumentCount on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - distinct on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - distinct on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - find on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - find on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - findOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - findOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - listIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - listIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - listIndexNames on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - listIndexNames on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - createChangeStream on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - createChangeStream on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - insertOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - insertOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - insertMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "x": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - insertMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "x": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - deleteOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - deleteOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - deleteMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - deleteMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - replaceOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - replaceOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - updateOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - updateOne on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - updateMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateMany", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - updateMany on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateMany", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - findOneAndDelete on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - findOneAndDelete on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - findOneAndReplace on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - findOneAndReplace on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - findOneAndUpdate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - findOneAndUpdate on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - bulkWrite on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - bulkWrite on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - createIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "createIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createIndex", - "object": "collection", - "arguments": { - "keys": { - "x": 1 - }, - "name": "x_1" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "createIndexes", - "databaseName": "test", - "command": { - "createIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - createIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "createIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createIndex", - "object": "collection", - "arguments": { - "keys": { - "x": 1 - }, - "name": "x_1" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "createIndexes", - "databaseName": "test", - "command": { - "createIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - dropIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndex", - "object": "collection", - "arguments": { - "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - dropIndex on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndex", - "object": "collection", - "arguments": { - "name": "x_1" - }, - "expectError": { - "isClientError": false, - "isTimeoutError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured on a MongoDatabase - dropIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 1000 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 on a MongoDatabase - dropIndexes on collection", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test", - "databaseOptions": { - "timeoutMS": 0 - } - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/override-operation-timeoutMS.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/override-operation-timeoutMS.json deleted file mode 100644 index 6fa0bd802a6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/override-operation-timeoutMS.json +++ /dev/null @@ -1,3577 +0,0 @@ -{ - "description": "timeoutMS can be overridden for an operation", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 10 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "timeoutMS can be configured for an operation - listDatabases on client", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - listDatabases on client", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - listDatabaseNames on client", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listDatabaseNames", - "object": "client", - "arguments": { - "timeoutMS": 1000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - listDatabaseNames on client", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listDatabaseNames", - "object": "client", - "arguments": { - "timeoutMS": 0 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - createChangeStream on client", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "timeoutMS": 1000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - createChangeStream on client", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "timeoutMS": 0, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - aggregate on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "timeoutMS": 1000, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - aggregate on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "timeoutMS": 0, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - listCollections on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - listCollections on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - listCollectionNames on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - listCollectionNames on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - runCommand on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "ping" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "timeoutMS": 1000, - "command": { - "ping": 1 - }, - "commandName": "ping" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "ping", - "databaseName": "test", - "command": { - "ping": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - runCommand on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "ping" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "timeoutMS": 0, - "command": { - "ping": 1 - }, - "commandName": "ping" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "ping", - "databaseName": "test", - "command": { - "ping": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - createChangeStream on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "timeoutMS": 1000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - createChangeStream on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "timeoutMS": 0, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - aggregate on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - aggregate on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - count on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - count on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - countDocuments on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - countDocuments on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - estimatedDocumentCount on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection", - "arguments": { - "timeoutMS": 1000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - estimatedDocumentCount on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection", - "arguments": { - "timeoutMS": 0 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - distinct on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - distinct on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - find on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - find on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - findOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - findOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - listIndexes on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexes", - "object": "collection", - "arguments": { - "timeoutMS": 1000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - listIndexes on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexes", - "object": "collection", - "arguments": { - "timeoutMS": 0 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - listIndexNames on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexNames", - "object": "collection", - "arguments": { - "timeoutMS": 1000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - listIndexNames on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "listIndexNames", - "object": "collection", - "arguments": { - "timeoutMS": 0 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - createChangeStream on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - createChangeStream on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - insertOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - insertOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - insertMany on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "documents": [ - { - "x": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - insertMany on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "documents": [ - { - "x": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - deleteOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - deleteOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - deleteMany on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - deleteMany on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - replaceOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - replaceOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - updateOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - updateOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - updateMany on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateMany", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - updateMany on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "updateMany", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - findOneAndDelete on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - findOneAndDelete on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - findOneAndReplace on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - findOneAndReplace on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - findOneAndUpdate on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - findOneAndUpdate on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - bulkWrite on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - bulkWrite on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - createIndex on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "createIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createIndex", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "keys": { - "x": 1 - }, - "name": "x_1" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "createIndexes", - "databaseName": "test", - "command": { - "createIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - createIndex on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "createIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "createIndex", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "keys": { - "x": 1 - }, - "name": "x_1" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "createIndexes", - "databaseName": "test", - "command": { - "createIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - dropIndex on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndex", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "name": "x_1" - }, - "expectError": { - "isTimeoutError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - dropIndex on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndex", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "name": "x_1" - }, - "expectError": { - "isTimeoutError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be configured for an operation - dropIndexes on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndexes", - "object": "collection", - "arguments": { - "timeoutMS": 1000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS can be set to 0 for an operation - dropIndexes on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "dropIndexes" - ], - "blockConnection": true, - "blockTimeMS": 15 - } - } - } - }, - { - "name": "dropIndexes", - "object": "collection", - "arguments": { - "timeoutMS": 0 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "dropIndexes", - "databaseName": "test", - "command": { - "dropIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/retryability-legacy-timeouts.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/retryability-legacy-timeouts.json deleted file mode 100644 index aded781aeed..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/retryability-legacy-timeouts.json +++ /dev/null @@ -1,3042 +0,0 @@ -{ - "description": "legacy timeouts behave correctly for retryable operations", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "socketTimeoutMS": 100 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "operation succeeds after one socket timeout - insertOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - insertOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - insertMany on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "x": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - insertMany on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "x": 1 - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - deleteOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - deleteOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - replaceOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - replaceOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - updateOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - updateOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - findOneAndDelete on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - findOneAndDelete on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - findOneAndReplace on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - findOneAndReplace on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - findOneAndUpdate on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - findOneAndUpdate on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - bulkWrite on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - bulkWrite on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - listDatabases on client", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - listDatabases on client", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "filter": {} - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - listDatabaseNames on client", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - listDatabaseNames on client", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "listDatabaseNames", - "object": "client", - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - createChangeStream on client", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - createChangeStream on client", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - aggregate on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - aggregate on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - listCollections on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - listCollections on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "filter": {} - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - listCollectionNames on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - listCollectionNames on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "filter": {} - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - createChangeStream on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - createChangeStream on database", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1 - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1 - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - aggregate on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - aggregate on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - count on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - count on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - countDocuments on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - countDocuments on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - estimatedDocumentCount on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - estimatedDocumentCount on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection", - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - distinct on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - distinct on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "distinct" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - find on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - find on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - findOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - findOne on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - listIndexes on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - listIndexes on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "listIndexes", - "object": "collection", - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation succeeds after one socket timeout - createChangeStream on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll" - } - } - } - ] - } - ] - }, - { - "description": "operation fails after two consecutive socket timeouts - createChangeStream on collection", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 125 - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll" - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/retryability-timeoutMS.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/retryability-timeoutMS.json deleted file mode 100644 index 9daad260ef3..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/retryability-timeoutMS.json +++ /dev/null @@ -1,5688 +0,0 @@ -{ - "description": "timeoutMS behaves correctly for retryable operations", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.2", - "topologies": [ - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 100 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "timeoutMS applies to whole operation, not individual attempts - insertOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - insertOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - insertOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - insertMany on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "x": 1 - } - ] - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - insertMany on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "documents": [ - { - "x": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - insertMany on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "documents": [ - { - "x": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - deleteOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "delete" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - deleteOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - deleteOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "delete", - "databaseName": "test", - "command": { - "delete": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - replaceOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - replaceOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - replaceOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - updateOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "update" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - updateOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - updateOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "update", - "databaseName": "test", - "command": { - "update": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - findOneAndDelete on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - findOneAndDelete on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - findOneAndDelete on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - findOneAndReplace on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 1 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - findOneAndReplace on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - findOneAndReplace on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {}, - "replacement": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - findOneAndUpdate on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - findOneAndUpdate on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - findOneAndUpdate on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {}, - "update": { - "$set": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify", - "databaseName": "test", - "command": { - "findAndModify": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - bulkWrite on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - bulkWrite on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - bulkWrite on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - listDatabases on client", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - listDatabases on client", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - listDatabases on client", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - listDatabaseNames on client", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listDatabaseNames", - "object": "client", - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - listDatabaseNames on client", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listDatabaseNames", - "object": "client", - "arguments": { - "timeoutMS": 1000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - listDatabaseNames on client", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listDatabaseNames", - "object": "client", - "arguments": { - "timeoutMS": 0 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases", - "databaseName": "admin", - "command": { - "listDatabases": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - createChangeStream on client", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - createChangeStream on client", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "timeoutMS": 1000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - createChangeStream on client", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "timeoutMS": 0, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "admin", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - aggregate on database", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - aggregate on database", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "timeoutMS": 1000, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - aggregate on database", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "timeoutMS": 0, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - listCollections on database", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - listCollections on database", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - listCollections on database", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - listCollectionNames on database", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - listCollectionNames on database", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - listCollectionNames on database", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections", - "databaseName": "test", - "command": { - "listCollections": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - createChangeStream on database", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - createChangeStream on database", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "timeoutMS": 1000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - createChangeStream on database", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "timeoutMS": 0, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": 1, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - aggregate on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - aggregate on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - aggregate on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - count on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - count on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - count on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "count", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - countDocuments on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - countDocuments on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - countDocuments on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - estimatedDocumentCount on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "count" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection", - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - estimatedDocumentCount on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection", - "arguments": { - "timeoutMS": 1000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - estimatedDocumentCount on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection", - "arguments": { - "timeoutMS": 0 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "count", - "databaseName": "test", - "command": { - "count": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - distinct on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "distinct" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - distinct on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - distinct on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "distinct", - "databaseName": "test", - "command": { - "distinct": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - find on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - find on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - find on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - findOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - findOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - findOne on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - listIndexes on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listIndexes", - "object": "collection", - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - listIndexes on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listIndexes", - "object": "collection", - "arguments": { - "timeoutMS": 1000 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - listIndexes on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "listIndexes", - "object": "collection", - "arguments": { - "timeoutMS": 0 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes", - "databaseName": "test", - "command": { - "listIndexes": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS applies to whole operation, not individual attempts - createChangeStream on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "blockConnection": true, - "blockTimeMS": 60, - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - { - "description": "operation is retried multiple times for non-zero timeoutMS - createChangeStream on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "timeoutMS": 1000, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ] - }, - { - "description": "operation is retried multiple times if timeoutMS is zero - createChangeStream on collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7, - "closeConnection": false, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "timeoutMS": 0, - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate", - "databaseName": "test", - "command": { - "aggregate": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/runCursorCommand.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/runCursorCommand.json deleted file mode 100644 index 5fc0be33997..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/runCursorCommand.json +++ /dev/null @@ -1,583 +0,0 @@ -{ - "description": "runCursorCommand", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "commandClient", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent" - ] - } - }, - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "commandDb", - "client": "commandClient", - "databaseName": "commandDb" - } - }, - { - "database": { - "id": "db", - "client": "client", - "databaseName": "db" - } - }, - { - "collection": { - "id": "collection", - "database": "db", - "collectionName": "collection" - } - } - ], - "initialData": [ - { - "collectionName": "collection", - "databaseName": "db", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "tests": [ - { - "description": "errors if timeoutMode is set without timeoutMS", - "operations": [ - { - "name": "runCursorCommand", - "object": "db", - "arguments": { - "commandName": "find", - "command": { - "find": "collection" - }, - "timeoutMode": "cursorLifetime" - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "error if timeoutMode is cursorLifetime and cursorType is tailableAwait", - "operations": [ - { - "name": "runCursorCommand", - "object": "db", - "arguments": { - "commandName": "find", - "command": { - "find": "collection" - }, - "timeoutMode": "cursorLifetime", - "cursorType": "tailableAwait" - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "Non-tailable cursor lifetime remaining timeoutMS applied to getMore if timeoutMode is unset", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find", - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 60 - } - } - } - }, - { - "name": "runCursorCommand", - "object": "db", - "arguments": { - "commandName": "find", - "timeoutMS": 100, - "command": { - "find": "collection", - "batchSize": 2 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "command": { - "find": "collection", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "collection", - "maxTimeMS": { - "$$exists": true - } - } - } - } - ] - } - ] - }, - { - "description": "Non=tailable cursor iteration timeoutMS is refreshed for getMore if timeoutMode is iteration - failure", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 60 - } - } - } - }, - { - "name": "runCursorCommand", - "object": "db", - "arguments": { - "commandName": "find", - "command": { - "find": "collection", - "batchSize": 2 - }, - "timeoutMode": "iteration", - "timeoutMS": 100, - "batchSize": 2 - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "db", - "command": { - "find": "collection", - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "db", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "collection", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "Tailable cursor iteration timeoutMS is refreshed for getMore - failure", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 60 - } - } - } - }, - { - "name": "dropCollection", - "object": "db", - "arguments": { - "collection": "cappedCollection" - } - }, - { - "name": "createCollection", - "object": "db", - "arguments": { - "collection": "cappedCollection", - "capped": true, - "size": 4096, - "max": 3 - }, - "saveResultAsEntity": "cappedCollection" - }, - { - "name": "insertMany", - "object": "cappedCollection", - "arguments": { - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - }, - { - "name": "createCommandCursor", - "object": "db", - "arguments": { - "commandName": "find", - "command": { - "find": "cappedCollection", - "batchSize": 1, - "tailable": true - }, - "timeoutMode": "iteration", - "timeoutMS": 100, - "batchSize": 1, - "cursorType": "tailable" - }, - "saveResultAsEntity": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "drop" - } - }, - { - "commandStartedEvent": { - "commandName": "create" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "db", - "command": { - "find": "cappedCollection", - "tailable": true, - "awaitData": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "db", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "cappedCollection", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "Tailable cursor awaitData iteration timeoutMS is refreshed for getMore - failure", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 60 - } - } - } - }, - { - "name": "dropCollection", - "object": "db", - "arguments": { - "collection": "cappedCollection" - } - }, - { - "name": "createCollection", - "object": "db", - "arguments": { - "collection": "cappedCollection", - "capped": true, - "size": 4096, - "max": 3 - }, - "saveResultAsEntity": "cappedCollection" - }, - { - "name": "insertMany", - "object": "cappedCollection", - "arguments": { - "documents": [ - { - "foo": "bar" - }, - { - "fizz": "buzz" - } - ] - } - }, - { - "name": "createCommandCursor", - "object": "db", - "arguments": { - "command": { - "find": "cappedCollection", - "tailable": true, - "awaitData": true - }, - "cursorType": "tailableAwait", - "batchSize": 1 - }, - "saveResultAsEntity": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "drop" - } - }, - { - "commandStartedEvent": { - "commandName": "create" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "db", - "command": { - "find": "cappedCollection", - "tailable": true, - "awaitData": true, - "maxTimeMS": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "db", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "cappedCollection" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/sessions-inherit-timeoutMS.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/sessions-inherit-timeoutMS.json deleted file mode 100644 index 13ea91c7948..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/sessions-inherit-timeoutMS.json +++ /dev/null @@ -1,331 +0,0 @@ -{ - "description": "sessions inherit timeoutMS from their parent MongoClient", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 500 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "timeoutMS applied to commitTransaction", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "blockConnection": true, - "blockTimeMS": 600 - } - } - } - }, - { - "name": "startTransaction", - "object": "session" - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 1 - } - } - }, - { - "name": "commitTransaction", - "object": "session", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction", - "databaseName": "admin", - "command": { - "commitTransaction": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "commitTransaction" - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to abortTransaction", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "blockConnection": true, - "blockTimeMS": 600 - } - } - } - }, - { - "name": "startTransaction", - "object": "session" - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 1 - } - } - }, - { - "name": "abortTransaction", - "object": "session" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction", - "databaseName": "admin", - "command": { - "abortTransaction": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "abortTransaction" - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to withTransaction", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 600 - } - } - } - }, - { - "name": "withTransaction", - "object": "session", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 1 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction", - "databaseName": "admin", - "command": { - "abortTransaction": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "abortTransaction" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/sessions-override-operation-timeoutMS.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/sessions-override-operation-timeoutMS.json deleted file mode 100644 index 441c698328c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/sessions-override-operation-timeoutMS.json +++ /dev/null @@ -1,335 +0,0 @@ -{ - "description": "timeoutMS can be overridden for individual session operations", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "timeoutMS can be overridden for commitTransaction", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "blockConnection": true, - "blockTimeMS": 600 - } - } - } - }, - { - "name": "startTransaction", - "object": "session" - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 1 - } - } - }, - { - "name": "commitTransaction", - "object": "session", - "arguments": { - "timeoutMS": 500 - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction", - "databaseName": "admin", - "command": { - "commitTransaction": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "commitTransaction" - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to abortTransaction", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "blockConnection": true, - "blockTimeMS": 600 - } - } - } - }, - { - "name": "startTransaction", - "object": "session" - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 1 - } - } - }, - { - "name": "abortTransaction", - "object": "session", - "arguments": { - "timeoutMS": 500 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction", - "databaseName": "admin", - "command": { - "abortTransaction": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "abortTransaction" - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to withTransaction", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 600 - } - } - } - }, - { - "name": "withTransaction", - "object": "session", - "arguments": { - "timeoutMS": 500, - "callback": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 1 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction", - "databaseName": "admin", - "command": { - "abortTransaction": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "abortTransaction" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/sessions-override-timeoutMS.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/sessions-override-timeoutMS.json deleted file mode 100644 index d90152e909c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/sessions-override-timeoutMS.json +++ /dev/null @@ -1,331 +0,0 @@ -{ - "description": "timeoutMS can be overridden at the level of a ClientSession", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session", - "client": "client", - "sessionOptions": { - "defaultTimeoutMS": 500 - } - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "documents": [] - } - ], - "tests": [ - { - "description": "timeoutMS applied to commitTransaction", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "blockConnection": true, - "blockTimeMS": 600 - } - } - } - }, - { - "name": "startTransaction", - "object": "session" - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 1 - } - } - }, - { - "name": "commitTransaction", - "object": "session", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction", - "databaseName": "admin", - "command": { - "commitTransaction": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "commitTransaction" - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to abortTransaction", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "blockConnection": true, - "blockTimeMS": 600 - } - } - } - }, - { - "name": "startTransaction", - "object": "session" - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 1 - } - } - }, - { - "name": "abortTransaction", - "object": "session" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll" - } - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction", - "databaseName": "admin", - "command": { - "abortTransaction": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "abortTransaction" - } - } - ] - } - ] - }, - { - "description": "timeoutMS applied to withTransaction", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 600 - } - } - } - }, - { - "name": "withTransaction", - "object": "session", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 1 - } - }, - "expectError": { - "isTimeoutError": true - } - } - ] - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "databaseName": "test", - "command": { - "insert": "coll", - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction", - "databaseName": "admin", - "command": { - "abortTransaction": 1, - "maxTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "abortTransaction" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/tailable-awaitData.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/tailable-awaitData.json deleted file mode 100644 index d0fe950dd8e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/tailable-awaitData.json +++ /dev/null @@ -1,424 +0,0 @@ -{ - "description": "timeoutMS behaves correctly for tailable awaitData cursors", - "comment": "Manually changed: timeoutMS is refreshed for getMore if maxAwaitTimeMS is not set. Added ignoreExtra events, sometimes an extra getMore is called.", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 200 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "createOptions": { - "capped": true, - "size": 500 - }, - "documents": [ - { - "_id": 0 - }, - { - "_id": 1 - } - ] - } - ], - "tests": [ - { - "description": "error if timeoutMode is cursor_lifetime", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "timeoutMode": "cursorLifetime", - "cursorType": "tailableAwait" - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "error if maxAwaitTimeMS is greater than timeoutMS", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "cursorType": "tailableAwait", - "timeoutMS": 5, - "maxAwaitTimeMS": 10 - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "error if maxAwaitTimeMS is equal to timeoutMS", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "cursorType": "tailableAwait", - "timeoutMS": 5, - "maxAwaitTimeMS": 5 - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "timeoutMS applied to find", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 300 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "cursorType": "tailableAwait" - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "tailable": true, - "awaitData": true, - "maxTimeMS": { - "$$exists": true - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS is refreshed for getMore if maxAwaitTimeMS is not set", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find", - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 150 - } - } - } - }, - { - "name": "createFindCursor", - "object": "collection", - "arguments": { - "filter": {}, - "cursorType": "tailableAwait", - "timeoutMS": 250, - "batchSize": 1 - }, - "saveResultAsEntity": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "tailable": true, - "awaitData": true, - "maxTimeMS": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS is refreshed for getMore if maxAwaitTimeMS is set", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find", - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 150 - } - } - } - }, - { - "name": "createFindCursor", - "object": "collection", - "arguments": { - "filter": {}, - "cursorType": "tailableAwait", - "timeoutMS": 250, - "batchSize": 1, - "maxAwaitTimeMS": 1 - }, - "saveResultAsEntity": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor" - } - ], - "expectEvents": [ - { - "client": "client", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "tailable": true, - "awaitData": true, - "maxTimeMS": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll", - "maxTimeMS": 1 - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS is refreshed for getMore - failure", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "createFindCursor", - "object": "collection", - "arguments": { - "filter": {}, - "cursorType": "tailableAwait", - "batchSize": 1 - }, - "saveResultAsEntity": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "tailable": true, - "awaitData": true, - "maxTimeMS": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/tailable-non-awaitData.json b/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/tailable-non-awaitData.json deleted file mode 100644 index e88230e4f7a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/client-side-operation-timeout/tailable-non-awaitData.json +++ /dev/null @@ -1,312 +0,0 @@ -{ - "description": "timeoutMS behaves correctly for tailable non-awaitData cursors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "client", - "uriOptions": { - "timeoutMS": 200 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "test", - "createOptions": { - "capped": true, - "size": 500 - }, - "documents": [ - { - "_id": 0 - }, - { - "_id": 1 - } - ] - } - ], - "tests": [ - { - "description": "error if timeoutMode is cursor_lifetime", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "timeoutMode": "cursorLifetime", - "cursorType": "tailable" - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "timeoutMS applied to find", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "cursorType": "tailable" - }, - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "tailable": true, - "awaitData": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS is refreshed for getMore - success", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find", - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 150 - } - } - } - }, - { - "name": "createFindCursor", - "object": "collection", - "arguments": { - "filter": {}, - "cursorType": "tailable", - "timeoutMS": 200, - "batchSize": 1 - }, - "saveResultAsEntity": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "tailable": true, - "awaitData": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "timeoutMS is refreshed for getMore - failure", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "blockConnection": true, - "blockTimeMS": 250 - } - } - } - }, - { - "name": "createFindCursor", - "object": "collection", - "arguments": { - "filter": {}, - "cursorType": "tailable", - "batchSize": 1 - }, - "saveResultAsEntity": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "tailableCursor", - "expectError": { - "isTimeoutError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "databaseName": "test", - "command": { - "find": "coll", - "tailable": true, - "awaitData": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "getMore", - "databaseName": "test", - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll", - "maxTimeMS": { - "$$exists": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/collection-management/clustered-indexes.json b/driver-core/src/test/resources/unified-test-format/collection-management/clustered-indexes.json deleted file mode 100644 index 9db5ff06d7e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/collection-management/clustered-indexes.json +++ /dev/null @@ -1,291 +0,0 @@ -{ - "description": "clustered-indexes", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "5.3", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "ci-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "ci-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "createCollection with clusteredIndex", - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "test" - } - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "collection": "test", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true, - "name": "test index" - } - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "databaseName": "ci-tests", - "collectionName": "test" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test" - }, - "databaseName": "ci-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "create": "test", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true, - "name": "test index" - } - }, - "databaseName": "ci-tests" - } - } - ] - } - ] - }, - { - "description": "listCollections includes clusteredIndex", - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "test" - } - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "collection": "test", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true, - "name": "test index" - } - } - }, - { - "name": "listCollections", - "object": "database0", - "arguments": { - "filter": { - "name": { - "$eq": "test" - } - } - }, - "expectResult": [ - { - "name": "test", - "options": { - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true, - "name": "test index", - "v": { - "$$type": [ - "int", - "long" - ] - } - } - } - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test" - }, - "databaseName": "ci-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "create": "test", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true, - "name": "test index" - } - }, - "databaseName": "ci-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1, - "filter": { - "name": { - "$eq": "test" - } - } - }, - "databaseName": "ci-tests" - } - } - ] - } - ] - }, - { - "description": "listIndexes returns the index", - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "test" - } - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "collection": "test", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true, - "name": "test index" - } - } - }, - { - "name": "listIndexes", - "object": "collection0", - "expectResult": [ - { - "key": { - "_id": 1 - }, - "name": "test index", - "clustered": true, - "unique": true, - "v": { - "$$type": [ - "int", - "long" - ] - } - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test" - }, - "databaseName": "ci-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "create": "test", - "clusteredIndex": { - "key": { - "_id": 1 - }, - "unique": true, - "name": "test index" - } - }, - "databaseName": "ci-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "test" - }, - "databaseName": "ci-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/collection-management/createCollection-pre_and_post_images.json b/driver-core/src/test/resources/unified-test-format/collection-management/createCollection-pre_and_post_images.json deleted file mode 100644 index f488deacd8e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/collection-management/createCollection-pre_and_post_images.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "description": "createCollection-pre_and_post_images", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "6.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "papi-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "tests": [ - { - "description": "createCollection with changeStreamPreAndPostImages enabled", - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "test" - } - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "collection": "test", - "changeStreamPreAndPostImages": { - "enabled": true - } - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "databaseName": "papi-tests", - "collectionName": "test" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test" - }, - "databaseName": "papi-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "create": "test", - "changeStreamPreAndPostImages": { - "enabled": true - } - }, - "databaseName": "papi-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/collection-management/modifyCollection-errorResponse.json b/driver-core/src/test/resources/unified-test-format/collection-management/modifyCollection-errorResponse.json deleted file mode 100644 index aea71eb08f0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/collection-management/modifyCollection-errorResponse.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "description": "modifyCollection-errorResponse", - "schemaVersion": "1.12", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "collMod-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "collMod-tests", - "documents": [ - { - "_id": 1, - "x": 1 - }, - { - "_id": 2, - "x": 1 - } - ] - } - ], - "tests": [ - { - "description": "modifyCollection prepareUnique violations are accessible", - "runOnRequirements": [ - { - "minServerVersion": "5.2" - } - ], - "operations": [ - { - "name": "createIndex", - "object": "collection0", - "arguments": { - "keys": { - "x": 1 - } - } - }, - { - "name": "modifyCollection", - "object": "database0", - "arguments": { - "collection": "test", - "index": { - "keyPattern": { - "x": 1 - }, - "prepareUnique": true - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 1 - } - }, - "expectError": { - "errorCode": 11000 - } - }, - { - "name": "modifyCollection", - "object": "database0", - "arguments": { - "collection": "test", - "index": { - "keyPattern": { - "x": 1 - }, - "unique": true - } - }, - "expectError": { - "isClientError": false, - "errorCode": 359, - "errorResponse": { - "violations": [ - { - "ids": [ - 1, - 2 - ] - } - ] - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/collection-management/modifyCollection-pre_and_post_images.json b/driver-core/src/test/resources/unified-test-format/collection-management/modifyCollection-pre_and_post_images.json deleted file mode 100644 index 8026faeb17a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/collection-management/modifyCollection-pre_and_post_images.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "description": "modifyCollection-pre_and_post_images", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "6.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "papi-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "tests": [ - { - "description": "modifyCollection to changeStreamPreAndPostImages enabled", - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "test" - } - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "collection": "test", - "changeStreamPreAndPostImages": { - "enabled": false - } - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "databaseName": "papi-tests", - "collectionName": "test" - } - }, - { - "name": "modifyCollection", - "object": "database0", - "arguments": { - "collection": "test", - "changeStreamPreAndPostImages": { - "enabled": true - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test" - }, - "databaseName": "papi-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "create": "test", - "changeStreamPreAndPostImages": { - "enabled": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "collMod": "test", - "changeStreamPreAndPostImages": { - "enabled": true - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/collection-management/timeseries-collection.json b/driver-core/src/test/resources/unified-test-format/collection-management/timeseries-collection.json deleted file mode 100644 index 2ee52eac411..00000000000 --- a/driver-core/src/test/resources/unified-test-format/collection-management/timeseries-collection.json +++ /dev/null @@ -1,320 +0,0 @@ -{ - "description": "timeseries-collection", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "ts-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "ts-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "createCollection with all options", - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "test" - } - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "collection": "test", - "expireAfterSeconds": 604800, - "timeseries": { - "timeField": "time", - "metaField": "meta", - "granularity": "minutes" - } - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "databaseName": "ts-tests", - "collectionName": "test" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test" - }, - "databaseName": "ts-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "create": "test", - "expireAfterSeconds": 604800, - "timeseries": { - "timeField": "time", - "metaField": "meta", - "granularity": "minutes" - } - }, - "databaseName": "ts-tests" - } - } - ] - } - ] - }, - { - "description": "insertMany with duplicate ids", - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "test" - } - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "collection": "test", - "expireAfterSeconds": 604800, - "timeseries": { - "timeField": "time", - "metaField": "meta", - "granularity": "minutes" - } - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "databaseName": "ts-tests", - "collectionName": "test" - } - }, - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "documents": [ - { - "_id": 1, - "time": { - "$date": { - "$numberLong": "1552949630482" - } - } - }, - { - "_id": 1, - "time": { - "$date": { - "$numberLong": "1552949630483" - } - } - } - ] - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {}, - "sort": { - "time": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "time": { - "$date": { - "$numberLong": "1552949630482" - } - } - }, - { - "_id": 1, - "time": { - "$date": { - "$numberLong": "1552949630483" - } - } - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test" - }, - "databaseName": "ts-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "create": "test", - "expireAfterSeconds": 604800, - "timeseries": { - "timeField": "time", - "metaField": "meta", - "granularity": "minutes" - } - }, - "databaseName": "ts-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1, - "time": { - "$date": { - "$numberLong": "1552949630482" - } - } - }, - { - "_id": 1, - "time": { - "$date": { - "$numberLong": "1552949630483" - } - } - } - ] - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": {}, - "sort": { - "time": 1 - } - }, - "databaseName": "ts-tests" - } - } - ] - } - ] - }, - { - "description": "createCollection with bucketing options", - "runOnRequirements": [ - { - "minServerVersion": "6.3" - } - ], - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "test" - } - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "collection": "test", - "timeseries": { - "timeField": "time", - "bucketMaxSpanSeconds": 3600, - "bucketRoundingSeconds": 3600 - } - } - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "databaseName": "ts-tests", - "collectionName": "test" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test" - }, - "databaseName": "ts-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "create": "test", - "timeseries": { - "timeField": "time", - "bucketMaxSpanSeconds": 3600, - "bucketRoundingSeconds": 3600 - } - }, - "databaseName": "ts-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-logging/command.json b/driver-core/src/test/resources/unified-test-format/command-logging/command.json deleted file mode 100644 index d2970df692f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-logging/command.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "description": "command-logging", - "schemaVersion": "1.13", - "createEntities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "command": "debug" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "logging-tests-collection" - } - } - ], - "initialData": [ - { - "collectionName": "logging-tests-collection", - "databaseName": "logging-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "A successful command", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "ping": 1 - }, - "commandName": "ping" - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-tests", - "commandName": "ping", - "command": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "ping": 1, - "$db": "logging-tests" - } - } - }, - "requestId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "databaseName": "logging-tests", - "commandName": "ping", - "reply": { - "$$type": "string" - }, - "requestId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "durationMS": { - "$$type": [ - "double", - "int", - "long" - ] - } - } - } - ] - } - ] - }, - { - "description": "A failed command", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-tests", - "commandName": "find", - "command": { - "$$type": "string" - }, - "requestId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command failed", - "databaseName": "logging-tests", - "commandName": "find", - "failure": { - "$$exists": true - }, - "requestId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "durationMS": { - "$$type": [ - "double", - "int", - "long" - ] - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-logging/driver-connection-id.json b/driver-core/src/test/resources/unified-test-format/command-logging/driver-connection-id.json deleted file mode 100644 index 40db98d6fae..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-logging/driver-connection-id.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "description": "driver-connection-id", - "schemaVersion": "1.13", - "createEntities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "command": "debug" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "logging-tests-collection" - } - } - ], - "initialData": [ - { - "collectionName": "logging-tests-collection", - "databaseName": "logging-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "A successful command", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "ping": 1 - }, - "commandName": "ping" - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-tests", - "commandName": "ping", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "ping", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - }, - { - "description": "A failed command", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-tests", - "commandName": "find", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command failed", - "commandName": "find", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-logging/no-handshake-messages.json b/driver-core/src/test/resources/unified-test-format/command-logging/no-handshake-messages.json deleted file mode 100644 index a61e208798c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-logging/no-handshake-messages.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "description": "no-handshake-command-logs", - "schemaVersion": "1.13", - "tests": [ - { - "description": "Handshake commands should not generate log messages", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "command": "debug" - }, - "observeEvents": [ - "connectionCreatedEvent", - "connectionReadyEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-tests" - } - } - ] - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "ping": 1 - }, - "commandName": "ping" - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "connectionCreatedEvent": {} - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "connectionReadyEvent": {} - }, - "count": 1 - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-tests", - "commandName": "ping" - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "ping" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-logging/no-heartbeat-messages.json b/driver-core/src/test/resources/unified-test-format/command-logging/no-heartbeat-messages.json deleted file mode 100644 index 525be9171df..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-logging/no-heartbeat-messages.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "description": "no-heartbeat-command-logs", - "schemaVersion": "1.13", - "runOnRequirements": [ - { - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "tests": [ - { - "description": "Heartbeat commands should not generate log messages", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "command": "debug" - }, - "observeEvents": [ - "serverDescriptionChangedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-tests" - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": {} - }, - "count": 1 - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "ping": 1 - }, - "commandName": "ping" - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-tests", - "commandName": "ping" - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "ping" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-logging/operation-id.json b/driver-core/src/test/resources/unified-test-format/command-logging/operation-id.json deleted file mode 100644 index b1a3cec3d91..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-logging/operation-id.json +++ /dev/null @@ -1,198 +0,0 @@ -{ - "description": "operation-id", - "schemaVersion": "1.13", - "createEntities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "command": "debug" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "logging-tests-collection" - } - } - ], - "initialData": [ - { - "collectionName": "logging-tests-collection", - "databaseName": "logging-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "Successful bulk write command log messages include operationIds", - "operations": [ - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "x": 1 - } - } - }, - { - "deleteOne": { - "filter": { - "x": 1 - } - } - } - ] - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-tests", - "commandName": "insert", - "operationId": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "insert", - "operationId": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-tests", - "commandName": "delete", - "operationId": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "delete", - "operationId": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - }, - { - "description": "Failed bulk write command log message includes operationId", - "operations": [ - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "x": 1 - }, - "update": [ - { - "$invalidOperator": true - } - ] - } - } - ] - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-tests", - "commandName": "update", - "operationId": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command failed", - "commandName": "update", - "operationId": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-logging/pre-42-server-connection-id.json b/driver-core/src/test/resources/unified-test-format/command-logging/pre-42-server-connection-id.json deleted file mode 100644 index d5ebd865906..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-logging/pre-42-server-connection-id.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "description": "pre-42-server-connection-id", - "schemaVersion": "1.13", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "command": "debug" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-server-connection-id-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "logging-tests-collection" - } - } - ], - "initialData": [ - { - "databaseName": "logging-server-connection-id-tests", - "collectionName": "logging-tests-collection", - "documents": [] - } - ], - "tests": [ - { - "description": "command log messages do not include server connection id", - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "commandName": "insert", - "serverConnectionId": { - "$$exists": false - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "insert", - "serverConnectionId": { - "$$exists": false - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "commandName": "find", - "serverConnectionId": { - "$$exists": false - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command failed", - "commandName": "find", - "serverConnectionId": { - "$$exists": false - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-logging/redacted-commands.json b/driver-core/src/test/resources/unified-test-format/command-logging/redacted-commands.json deleted file mode 100644 index 43b9ff74f29..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-logging/redacted-commands.json +++ /dev/null @@ -1,1438 +0,0 @@ -{ - "description": "redacted-commands", - "schemaVersion": "1.13", - "runOnRequirements": [ - { - "minServerVersion": "5.0", - "auth": false - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeLogMessages": { - "command": "debug" - } - } - }, - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-redaction-tests" - } - } - ], - "tests": [ - { - "description": "authenticate command and resulting server-generated error are redacted", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "authenticate", - "command": { - "authenticate": 1, - "mechanism": "MONGODB-X509", - "user": "CN=myName,OU=myOrgUnit,O=myOrg,L=myLocality,ST=myState,C=myCountry", - "db": "$external" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "authenticate", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": true, - "data": { - "message": "Command failed", - "commandName": "authenticate", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "network error in response to authenticate is not redacted", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "authenticate" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "authenticate", - "command": { - "authenticate": 1, - "mechanism": "MONGODB-X509", - "user": "CN=myName,OU=myOrgUnit,O=myOrg,L=myLocality,ST=myState,C=myCountry" - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "authenticate", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": false, - "data": { - "message": "Command failed", - "commandName": "authenticate", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "saslStart command and resulting server-generated error are redacted", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "saslStart", - "command": { - "saslStart": 1, - "payload": "definitely-invalid-payload", - "db": "admin" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "saslStart", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": true, - "data": { - "message": "Command failed", - "commandName": "saslStart", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "network error in response to saslStart is not redacted", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "saslStart" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "saslStart", - "command": { - "saslStart": 1, - "payload": "ZmFrZXNhc2xwYXlsb2Fk", - "mechanism": "MONGODB-X509" - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "saslStart", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": false, - "data": { - "message": "Command failed", - "commandName": "saslStart", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "saslContinue command and resulting server-generated error are redacted", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "saslContinue", - "command": { - "saslContinue": 1, - "conversationId": 0, - "payload": "definitely-invalid-payload" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "saslContinue", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": true, - "data": { - "message": "Command failed", - "commandName": "saslContinue", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "network error in response to saslContinue is not redacted", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "saslContinue", - "command": { - "saslContinue": 1, - "conversationId": 0, - "payload": "ZmFrZXNhc2xwYXlsb2Fk" - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "saslContinue", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": false, - "data": { - "message": "Command failed", - "commandName": "saslContinue", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "getnonce command and server reply are redacted", - "runOnRequirements": [ - { - "maxServerVersion": "6.1.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "getnonce", - "command": { - "getnonce": 1 - } - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "getnonce", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "getnonce", - "reply": { - "$$matchAsDocument": {} - } - } - } - ] - } - ] - }, - { - "description": "network error in response to getnonce is not redacted", - "runOnRequirements": [ - { - "maxServerVersion": "6.1.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getnonce" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "getnonce", - "command": { - "getnonce": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "getnonce", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": false, - "data": { - "message": "Command failed", - "commandName": "getnonce", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "createUser command and resulting server-generated error are redacted", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "createUser", - "command": { - "createUser": "private", - "pwd": {}, - "roles": [] - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "createUser", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": true, - "data": { - "message": "Command failed", - "commandName": "createUser", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "network error in response to createUser is not redacted", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "createUser" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "createUser", - "command": { - "createUser": "private", - "pwd": "pwd", - "roles": [] - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "createUser", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": false, - "data": { - "message": "Command failed", - "commandName": "createUser", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "updateUser command and resulting server-generated error are redacted", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "updateUser", - "command": { - "updateUser": "private", - "pwd": {}, - "roles": [] - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "updateUser", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": true, - "data": { - "message": "Command failed", - "commandName": "updateUser", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "network error in response to updateUser is not redacted", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "updateUser" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "updateUser", - "command": { - "updateUser": "private", - "pwd": "pwd", - "roles": [] - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "updateUser", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": false, - "data": { - "message": "Command failed", - "commandName": "updateUser", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "copydbgetnonce command and resulting server-generated error are redacted", - "runOnRequirements": [ - { - "maxServerVersion": "3.6.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydbgetnonce", - "command": { - "copydbgetnonce": "private" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "copydbgetnonce", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": true, - "data": { - "message": "Command failed", - "commandName": "copydbgetnonce", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "network error in response to copydbgetnonce is not redacted", - "runOnRequirements": [ - { - "maxServerVersion": "3.6.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "copydbgetnonce" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydbgetnonce", - "command": { - "copydbgetnonce": "private" - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "copydbgetnonce", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": false, - "data": { - "message": "Command failed", - "commandName": "copydbgetnonce", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "copydbsaslstart command and resulting server-generated error are redacted", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydbsaslstart", - "command": { - "copydbsaslstart": "private" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "copydbsaslstart", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": true, - "data": { - "message": "Command failed", - "commandName": "copydbsaslstart", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "network error in response to copydbsaslstart is not redacted", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "copydbsaslstart" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydbsaslstart", - "command": { - "copydbsaslstart": "private" - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "copydbgetnonce", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": false, - "data": { - "message": "Command failed", - "commandName": "copydbgetnonce", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "copydb command and resulting server-generated error are redacted", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydb", - "command": { - "copydb": "private" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "copydb", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": true, - "data": { - "message": "Command failed", - "commandName": "copydb", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "network error in response to copydb is not redacted", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "copydb" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydb", - "command": { - "copydb": "private" - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "copydb", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "failureIsRedacted": false, - "data": { - "message": "Command failed", - "commandName": "copydb", - "failure": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "hello with speculative authenticate command and server reply are redacted", - "runOnRequirements": [ - { - "minServerVersion": "4.9" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "hello", - "command": { - "hello": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "hello", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "hello", - "reply": { - "$$matchAsDocument": {} - } - } - } - ] - } - ] - }, - { - "description": "legacy hello with speculative authenticate command and server reply are redacted", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ismaster", - "command": { - "ismaster": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "isMaster", - "command": { - "isMaster": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "ismaster", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "ismaster", - "reply": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "isMaster", - "command": { - "$$matchAsDocument": {} - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "isMaster", - "reply": { - "$$matchAsDocument": {} - } - } - } - ] - } - ] - }, - { - "description": "hello without speculative authenticate command and server reply are not redacted", - "runOnRequirements": [ - { - "minServerVersion": "4.9" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "hello", - "command": { - "hello": 1 - } - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "hello", - "command": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "hello": 1 - } - } - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "hello", - "reply": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "ok": 1, - "isWritablePrimary": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "legacy hello without speculative authenticate command and server reply are not redacted", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ismaster", - "command": { - "ismaster": 1 - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "isMaster", - "command": { - "isMaster": 1 - } - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "ismaster", - "command": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "ismaster": 1 - } - } - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "ismaster", - "reply": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "ok": 1, - "ismaster": true - } - } - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-redaction-tests", - "commandName": "isMaster", - "command": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "isMaster": 1 - } - } - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "isMaster", - "reply": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "ok": 1, - "ismaster": true - } - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-logging/server-connection-id.json b/driver-core/src/test/resources/unified-test-format/command-logging/server-connection-id.json deleted file mode 100644 index abbbbc74421..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-logging/server-connection-id.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "description": "server-connection-id", - "schemaVersion": "1.13", - "runOnRequirements": [ - { - "minServerVersion": "4.2" - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "command": "debug" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-server-connection-id-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "logging-tests-collection" - } - } - ], - "initialData": [ - { - "databaseName": "logging-server-connection-id-tests", - "collectionName": "logging-tests-collection", - "documents": [] - } - ], - "tests": [ - { - "description": "command log messages include server connection id", - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "commandName": "insert", - "serverConnectionId": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "insert", - "serverConnectionId": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "commandName": "find", - "serverConnectionId": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command failed", - "commandName": "find", - "serverConnectionId": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-logging/service-id.json b/driver-core/src/test/resources/unified-test-format/command-logging/service-id.json deleted file mode 100644 index ea39d612315..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-logging/service-id.json +++ /dev/null @@ -1,207 +0,0 @@ -{ - "description": "service-id", - "schemaVersion": "1.13", - "createEntities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "command": "debug" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-server-connection-id-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "logging-tests-collection" - } - } - ], - "initialData": [ - { - "databaseName": "logging-server-connection-id-tests", - "collectionName": "logging-tests-collection", - "documents": [] - } - ], - "tests": [ - { - "description": "command log messages include serviceId when in LB mode", - "runOnRequirements": [ - { - "topologies": [ - "load-balanced" - ] - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "commandName": "insert", - "serviceId": { - "$$type": "string" - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "insert", - "serviceId": { - "$$type": "string" - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "commandName": "find", - "serviceId": { - "$$type": "string" - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command failed", - "commandName": "find", - "serviceId": { - "$$type": "string" - } - } - } - ] - } - ] - }, - { - "description": "command log messages omit serviceId when not in LB mode", - "runOnRequirements": [ - { - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "commandName": "insert", - "serviceId": { - "$$exists": false - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "insert", - "serviceId": { - "$$exists": false - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "commandName": "find", - "serviceId": { - "$$exists": false - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command failed", - "commandName": "find", - "serviceId": { - "$$exists": false - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-logging/unacknowledged-write.json b/driver-core/src/test/resources/unified-test-format/command-logging/unacknowledged-write.json deleted file mode 100644 index 0d33c020d54..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-logging/unacknowledged-write.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "description": "unacknowledged-write", - "schemaVersion": "1.16", - "createEntities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeLogMessages": { - "command": "debug" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "logging-tests-collection", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "logging-tests-collection", - "databaseName": "logging-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ], - "tests": [ - { - "description": "An unacknowledged write generates a succeeded log message with ok: 1 reply", - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 2 - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "expectLogMessages": [ - { - "client": "client", - "ignoreExtraMessages": true, - "messages": [ - { - "level": "debug", - "component": "command", - "data": { - "message": "Command started", - "databaseName": "logging-tests", - "commandName": "insert", - "command": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "insert": "logging-tests-collection", - "$db": "logging-tests" - } - } - }, - "requestId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "command", - "data": { - "message": "Command succeeded", - "commandName": "insert", - "reply": { - "$$matchAsDocument": { - "ok": 1 - } - }, - "requestId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "durationMS": { - "$$type": [ - "double", - "int", - "long" - ] - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/bulkWrite.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/bulkWrite.json deleted file mode 100644 index 49c728442e0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/bulkWrite.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "description": "bulkWrite", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "A successful mixed bulk write", - "operations": [ - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 4, - "x": 44 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 3 - }, - "update": { - "$set": { - "x": 333 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 4, - "x": 44 - } - ], - "ordered": true - }, - "commandName": "insert", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1 - }, - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 3 - }, - "u": { - "$set": { - "x": 333 - } - }, - "upsert": { - "$$unsetOrMatches": false - }, - "multi": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true - }, - "commandName": "update", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1 - }, - "commandName": "update" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/command.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/command.json deleted file mode 100644 index c28af95fed2..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/command.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "description": "command", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "A successful command", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "ping": 1 - }, - "commandName": "ping" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "commandName": "ping", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1 - }, - "commandName": "ping" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/deleteMany.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/deleteMany.json deleted file mode 100644 index 78ebad1f98c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/deleteMany.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "description": "deleteMany", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "A successful deleteMany", - "operations": [ - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "limit": 0 - } - ], - "ordered": true - }, - "commandName": "delete", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 2 - }, - "commandName": "delete" - } - } - ] - } - ] - }, - { - "description": "A successful deleteMany with write errors", - "operations": [ - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$unsupported": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": { - "$unsupported": 1 - } - }, - "limit": 0 - } - ], - "ordered": true - }, - "commandName": "delete", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 0, - "writeErrors": { - "$$type": "array" - } - }, - "commandName": "delete" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/deleteOne.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/deleteOne.json deleted file mode 100644 index 2420794fe50..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/deleteOne.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "description": "deleteOne", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "A successful deleteOne", - "operations": [ - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "limit": 1 - } - ], - "ordered": true - }, - "commandName": "delete", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1 - }, - "commandName": "delete" - } - } - ] - } - ] - }, - { - "description": "A successful deleteOne with write errors", - "operations": [ - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$unsupported": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": { - "$unsupported": 1 - } - }, - "limit": 1 - } - ], - "ordered": true - }, - "commandName": "delete", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 0, - "writeErrors": { - "$$type": "array" - } - }, - "commandName": "delete" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/find.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/find.json deleted file mode 100644 index 68ce294240e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/find.json +++ /dev/null @@ -1,559 +0,0 @@ -{ - "description": "find", - "schemaVersion": "1.15", - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "_yamlAnchors": { - "namespace": "command-monitoring-tests.test" - }, - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "tests": [ - { - "description": "A successful find with no options", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": 1 - } - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "cursor": { - "id": 0, - "ns": "command-monitoring-tests.test", - "firstBatch": [ - { - "_id": 1, - "x": 11 - } - ] - } - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - } - ] - } - ] - }, - { - "description": "A successful find with options", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "sort": { - "x": -1 - }, - "projection": { - "_id": 0, - "x": 1 - }, - "skip": 2, - "comment": "test", - "hint": { - "_id": 1 - }, - "max": { - "_id": 6 - }, - "maxTimeMS": 6000, - "min": { - "_id": 0 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": { - "$gt": 1 - } - }, - "sort": { - "x": -1 - }, - "projection": { - "_id": 0, - "x": 1 - }, - "skip": 2, - "comment": "test", - "hint": { - "_id": 1 - }, - "max": { - "_id": 6 - }, - "maxTimeMS": 6000, - "min": { - "_id": 0 - } - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "cursor": { - "id": 0, - "ns": "command-monitoring-tests.test", - "firstBatch": [ - { - "x": 33 - }, - { - "x": 22 - } - ] - } - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - } - ] - } - ] - }, - { - "description": "A successful find with showRecordId and returnKey", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "showRecordId": true, - "returnKey": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "showRecordId": true, - "returnKey": true - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "cursor": { - "id": 0, - "ns": "command-monitoring-tests.test", - "firstBatch": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - }, - { - "_id": 5 - } - ] - } - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - } - ] - } - ] - }, - { - "description": "A successful find with a getMore", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$gte": 1 - } - }, - "sort": { - "_id": 1 - }, - "batchSize": 3 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": { - "$gte": 1 - } - }, - "sort": { - "_id": 1 - }, - "batchSize": 3 - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "cursor": { - "id": { - "$$type": [ - "int", - "long" - ] - }, - "ns": "command-monitoring-tests.test", - "firstBatch": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3 - }, - "commandName": "getMore", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "cursor": { - "id": 0, - "ns": "command-monitoring-tests.test", - "nextBatch": [ - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - }, - "commandName": "getMore", - "databaseName": "command-monitoring-tests" - } - } - ] - } - ] - }, - { - "description": "A successful find event with a getmore and the server kills the cursor (<= 4.4)", - "comment": "UPDATED final batchSize to 3 as batchSize is no longer calculated see: DRIVERS-1448 ", - "runOnRequirements": [ - { - "minServerVersion": "3.1", - "maxServerVersion": "4.4.99", - "topologies": [ - "single", - "replicaset" - ] - } - ], - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$gte": 1 - } - }, - "sort": { - "_id": 1 - }, - "batchSize": 3, - "limit": 4 - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": { - "$gte": 1 - } - }, - "sort": { - "_id": 1 - }, - "batchSize": 3, - "limit": 4 - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "cursor": { - "id": { - "$$type": [ - "int", - "long" - ] - }, - "ns": "command-monitoring-tests.test", - "firstBatch": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3 - }, - "commandName": "getMore", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "cursor": { - "id": 0, - "ns": "command-monitoring-tests.test", - "nextBatch": [ - { - "_id": 4, - "x": 44 - } - ] - } - }, - "commandName": "getMore", - "databaseName": "command-monitoring-tests" - } - } - ] - } - ] - }, - { - "description": "A failed find event", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "$or": true - } - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/insertMany.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/insertMany.json deleted file mode 100644 index a80a218c67a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/insertMany.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "description": "insertMany", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "A successful insertMany", - "operations": [ - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "ordered": true - }, - "commandName": "insert", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1 - }, - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "A successful insertMany with write errors", - "operations": [ - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1, - "x": 11 - } - ], - "ordered": true - }, - "commandName": "insert", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 0, - "writeErrors": { - "$$type": "array" - } - }, - "commandName": "insert" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/insertOne.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/insertOne.json deleted file mode 100644 index 6ff732e41be..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/insertOne.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "description": "insertOne", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "A successful insertOne", - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "ordered": true - }, - "commandName": "insert", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1 - }, - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "A successful insertOne with write errors", - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1, - "x": 11 - } - ], - "ordered": true - }, - "commandName": "insert", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 0, - "writeErrors": { - "$$type": "array" - } - }, - "commandName": "insert" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/pre-42-server-connection-id.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/pre-42-server-connection-id.json deleted file mode 100644 index 141fbe584f7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/pre-42-server-connection-id.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "description": "pre-42-server-connection-id", - "schemaVersion": "1.6", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "server-connection-id-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "databaseName": "server-connection-id-tests", - "collectionName": "coll", - "documents": [] - } - ], - "tests": [ - { - "description": "command events do not include server connection id", - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "hasServerConnectionId": false - } - }, - { - "commandSucceededEvent": { - "commandName": "insert", - "hasServerConnectionId": false - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "hasServerConnectionId": false - } - }, - { - "commandFailedEvent": { - "commandName": "find", - "hasServerConnectionId": false - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/redacted-commands.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/redacted-commands.json deleted file mode 100644 index 4302ba89004..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/redacted-commands.json +++ /dev/null @@ -1,679 +0,0 @@ -{ - "description": "redacted-commands", - "schemaVersion": "1.5", - "runOnRequirements": [ - { - "minServerVersion": "5.0", - "auth": false - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent" - ], - "observeSensitiveCommands": true - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - } - ], - "tests": [ - { - "description": "authenticate", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "authenticate", - "command": { - "authenticate": 1, - "mechanism": "MONGODB-X509", - "user": "CN=myName,OU=myOrgUnit,O=myOrg,L=myLocality,ST=myState,C=myCountry", - "db": "$external" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "authenticate", - "command": { - "authenticate": { - "$$exists": false - }, - "mechanism": { - "$$exists": false - }, - "user": { - "$$exists": false - }, - "db": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "saslStart", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "saslStart", - "command": { - "saslStart": 1, - "payload": "definitely-invalid-payload", - "db": "admin" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "saslStart", - "command": { - "saslStart": { - "$$exists": false - }, - "payload": { - "$$exists": false - }, - "db": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "saslContinue", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "saslContinue", - "command": { - "saslContinue": 1, - "conversationId": 0, - "payload": "definitely-invalid-payload" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "saslContinue", - "command": { - "saslContinue": { - "$$exists": false - }, - "conversationId": { - "$$exists": false - }, - "payload": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "getnonce", - "runOnRequirements": [ - { - "maxServerVersion": "6.1.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "getnonce", - "command": { - "getnonce": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "getnonce", - "command": { - "getnonce": { - "$$exists": false - } - } - } - }, - { - "commandSucceededEvent": { - "commandName": "getnonce", - "reply": { - "ok": { - "$$exists": false - }, - "nonce": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "createUser", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "createUser", - "command": { - "createUser": "private", - "pwd": {}, - "roles": [] - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "createUser", - "command": { - "createUser": { - "$$exists": false - }, - "pwd": { - "$$exists": false - }, - "roles": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "updateUser", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "updateUser", - "command": { - "updateUser": "private", - "pwd": {}, - "roles": [] - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "updateUser", - "command": { - "updateUser": { - "$$exists": false - }, - "pwd": { - "$$exists": false - }, - "roles": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "copydbgetnonce", - "runOnRequirements": [ - { - "maxServerVersion": "3.6.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydbgetnonce", - "command": { - "copydbgetnonce": "private" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "copydbgetnonce", - "command": { - "copydbgetnonce": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "copydbsaslstart", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydbsaslstart", - "command": { - "copydbsaslstart": "private" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "copydbsaslstart", - "command": { - "copydbsaslstart": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "copydb", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "copydb", - "command": { - "copydb": "private" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "copydb", - "command": { - "copydb": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "hello with speculative authenticate", - "runOnRequirements": [ - { - "minServerVersion": "4.9" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "hello", - "command": { - "hello": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "hello", - "command": { - "hello": { - "$$exists": false - }, - "speculativeAuthenticate": { - "$$exists": false - } - } - } - }, - { - "commandSucceededEvent": { - "commandName": "hello", - "reply": { - "isWritablePrimary": { - "$$exists": false - }, - "speculativeAuthenticate": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "legacy hello with speculative authenticate", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ismaster", - "command": { - "ismaster": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "isMaster", - "command": { - "isMaster": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "ismaster", - "command": { - "ismaster": { - "$$exists": false - }, - "speculativeAuthenticate": { - "$$exists": false - } - } - } - }, - { - "commandSucceededEvent": { - "commandName": "ismaster", - "reply": { - "ismaster": { - "$$exists": false - }, - "speculativeAuthenticate": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "isMaster", - "command": { - "isMaster": { - "$$exists": false - }, - "speculativeAuthenticate": { - "$$exists": false - } - } - } - }, - { - "commandSucceededEvent": { - "commandName": "isMaster", - "reply": { - "ismaster": { - "$$exists": false - }, - "speculativeAuthenticate": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "hello without speculative authenticate is not redacted", - "runOnRequirements": [ - { - "minServerVersion": "4.9" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "hello", - "command": { - "hello": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "hello", - "command": { - "hello": 1 - } - } - }, - { - "commandSucceededEvent": { - "commandName": "hello", - "reply": { - "isWritablePrimary": { - "$$exists": true - } - } - } - } - ] - } - ] - }, - { - "description": "legacy hello without speculative authenticate is not redacted", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ismaster", - "command": { - "ismaster": 1 - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "isMaster", - "command": { - "isMaster": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "ismaster", - "command": { - "ismaster": 1 - } - } - }, - { - "commandSucceededEvent": { - "commandName": "ismaster", - "reply": { - "ismaster": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "isMaster", - "command": { - "isMaster": 1 - } - } - }, - { - "commandSucceededEvent": { - "commandName": "isMaster", - "reply": { - "ismaster": { - "$$exists": true - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/server-connection-id.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/server-connection-id.json deleted file mode 100644 index a8f27637fc0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/server-connection-id.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "description": "server-connection-id", - "schemaVersion": "1.6", - "runOnRequirements": [ - { - "minServerVersion": "4.2" - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "server-connection-id-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "databaseName": "server-connection-id-tests", - "collectionName": "coll", - "documents": [] - } - ], - "tests": [ - { - "description": "command events include server connection id", - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "hasServerConnectionId": true - } - }, - { - "commandSucceededEvent": { - "commandName": "insert", - "hasServerConnectionId": true - } - }, - { - "commandStartedEvent": { - "commandName": "find", - "hasServerConnectionId": true - } - }, - { - "commandFailedEvent": { - "commandName": "find", - "hasServerConnectionId": true - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/unacknowledged-client-bulkWrite.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/unacknowledged-client-bulkWrite.json deleted file mode 100644 index 61bb00726c0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/unacknowledged-client-bulkWrite.json +++ /dev/null @@ -1,220 +0,0 @@ -{ - "description": "unacknowledged-client-bulkWrite", - "schemaVersion": "1.7", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ], - "uriOptions": { - "w": 0 - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "command-monitoring-tests.test" - }, - "tests": [ - { - "description": "A successful mixed client bulkWrite", - "operations": [ - { - "object": "client", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "command-monitoring-tests.test", - "document": { - "_id": 4, - "x": 44 - } - } - }, - { - "updateOne": { - "namespace": "command-monitoring-tests.test", - "filter": { - "_id": 3 - }, - "update": { - "$set": { - "x": 333 - } - } - } - } - ], - "ordered": false - }, - "expectResult": { - "insertedCount": { - "$$unsetOrMatches": 0 - }, - "upsertedCount": { - "$$unsetOrMatches": 0 - }, - "matchedCount": { - "$$unsetOrMatches": 0 - }, - "modifiedCount": { - "$$unsetOrMatches": 0 - }, - "deletedCount": { - "$$unsetOrMatches": 0 - }, - "insertResults": { - "$$unsetOrMatches": {} - }, - "updateResults": { - "$$unsetOrMatches": {} - }, - "deleteResults": { - "$$unsetOrMatches": {} - } - } - }, - { - "object": "collection", - "name": "find", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 333 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": true, - "ordered": false, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - }, - { - "update": 0, - "filter": { - "_id": 3 - }, - "updateMods": { - "$set": { - "x": 333 - } - }, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "command-monitoring-tests.test" - } - ] - } - } - }, - { - "commandSucceededEvent": { - "commandName": "bulkWrite", - "reply": { - "ok": 1, - "nInserted": { - "$$exists": false - }, - "nMatched": { - "$$exists": false - }, - "nModified": { - "$$exists": false - }, - "nUpserted": { - "$$exists": false - }, - "nDeleted": { - "$$exists": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/unacknowledgedBulkWrite.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/unacknowledgedBulkWrite.json deleted file mode 100644 index 78ddde767ff..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/unacknowledgedBulkWrite.json +++ /dev/null @@ -1,117 +0,0 @@ -{ - "description": "unacknowledgedBulkWrite", - "schemaVersion": "1.7", - "createEntities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "A successful unordered bulk write with an unacknowledged write concern", - "operations": [ - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": "unorderedBulkWriteInsertW0", - "x": 44 - } - } - } - ], - "ordered": false - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": "unorderedBulkWriteInsertW0", - "x": 44 - } - ], - "ordered": false, - "writeConcern": { - "w": 0 - } - }, - "commandName": "insert", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": { - "$$exists": false - } - }, - "commandName": "insert" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/updateMany.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/updateMany.json deleted file mode 100644 index b15434226c8..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/updateMany.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "description": "updateMany", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "A successful updateMany", - "operations": [ - { - "name": "updateMany", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "upsert": { - "$$unsetOrMatches": false - }, - "multi": true - } - ], - "ordered": true - }, - "commandName": "update", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 2 - }, - "commandName": "update" - } - } - ] - } - ] - }, - { - "description": "A successful updateMany with write errors", - "operations": [ - { - "name": "updateMany", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$unsupported": { - "x": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$unsupported": { - "x": 1 - } - }, - "upsert": { - "$$unsetOrMatches": false - }, - "multi": true - } - ], - "ordered": true - }, - "commandName": "update", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 0, - "writeErrors": { - "$$type": "array" - } - }, - "commandName": "update" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/updateOne.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/updateOne.json deleted file mode 100644 index a0ae99e88db..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/updateOne.json +++ /dev/null @@ -1,260 +0,0 @@ -{ - "description": "updateOne", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "A successful updateOne", - "operations": [ - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "upsert": { - "$$unsetOrMatches": false - }, - "multi": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true - }, - "commandName": "update", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1 - }, - "commandName": "update" - } - } - ] - } - ] - }, - { - "description": "A successful updateOne with upsert where the upserted id is not an ObjectId", - "operations": [ - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 4 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "upsert": true, - "multi": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true - }, - "commandName": "update", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1, - "upserted": [ - { - "index": 0, - "_id": 4 - } - ] - }, - "commandName": "update" - } - } - ] - } - ] - }, - { - "description": "A successful updateOne with write errors", - "operations": [ - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$unsupported": { - "x": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$unsupported": { - "x": 1 - } - }, - "upsert": { - "$$unsetOrMatches": false - }, - "multi": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true - }, - "commandName": "update", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 0, - "writeErrors": { - "$$type": "array" - } - }, - "commandName": "update" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/command-monitoring/writeConcernError.json b/driver-core/src/test/resources/unified-test-format/command-monitoring/writeConcernError.json deleted file mode 100644 index 455e5422b72..00000000000 --- a/driver-core/src/test/resources/unified-test-format/command-monitoring/writeConcernError.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "description": "writeConcernError", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "A retryable write with write concern errors publishes success event", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91 - } - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "ordered": true - }, - "commandName": "insert", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1, - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91 - } - }, - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "ordered": true - }, - "commandName": "insert", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1 - }, - "commandName": "insert" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/connection-monitoring-and-pooling/logging/connection-logging.json b/driver-core/src/test/resources/unified-test-format/connection-monitoring-and-pooling/logging/connection-logging.json deleted file mode 100644 index 72103b3cabd..00000000000 --- a/driver-core/src/test/resources/unified-test-format/connection-monitoring-and-pooling/logging/connection-logging.json +++ /dev/null @@ -1,523 +0,0 @@ -{ - "description": "connection-logging", - "schemaVersion": "1.13", - "runOnRequirements": [ - { - "topologies": [ - "single" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "failPointClient" - } - } - ], - "tests": [ - { - "description": "Create a client, run a command, and close the client", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "connection": "debug" - } - } - } - ] - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "filter": {} - } - }, - { - "name": "close", - "object": "client" - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool created", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool ready", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection checkout started", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection created", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection ready", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "durationMS": { - "$$type": [ - "double", - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection checked out", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "durationMS": { - "$$type": [ - "double", - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection checked in", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection checkout started", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection checked out", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "durationMS": { - "$$type": [ - "double", - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection checked in", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection closed", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "reason": "Connection pool was closed" - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool closed", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - }, - { - "description": "Connection checkout fails due to error establishing connection", - "runOnRequirements": [ - { - "auth": true, - "minServerVersion": "4.0" - } - ], - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "retryReads": false, - "appname": "clientAppName", - "heartbeatFrequencyMS": 10000 - }, - "observeLogMessages": { - "connection": "debug" - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "saslContinue" - ], - "closeConnection": true, - "appName": "clientAppName" - } - } - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "filter": {} - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool created", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool ready", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection checkout started", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection created", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool cleared", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection closed", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "reason": "An error occurred while using the connection", - "error": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection checkout failed", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "reason": "An error occurred while trying to establish a new connection", - "error": { - "$$exists": true - }, - "durationMS": { - "$$type": [ - "double", - "int", - "long" - ] - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/connection-monitoring-and-pooling/logging/connection-pool-options.json b/driver-core/src/test/resources/unified-test-format/connection-monitoring-and-pooling/logging/connection-pool-options.json deleted file mode 100644 index 69bb20dbe18..00000000000 --- a/driver-core/src/test/resources/unified-test-format/connection-monitoring-and-pooling/logging/connection-pool-options.json +++ /dev/null @@ -1,460 +0,0 @@ -{ - "description": "connection-pool-options", - "schemaVersion": "1.13", - "runOnRequirements": [ - { - "topologies": [ - "single" - ] - } - ], - "tests": [ - { - "description": "Options should be included in connection pool created message when specified", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "connectionReadyEvent" - ], - "observeLogMessages": { - "connection": "debug" - }, - "uriOptions": { - "minPoolSize": 1, - "maxPoolSize": 5, - "maxIdleTimeMS": 10000 - } - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "connectionReadyEvent": {} - }, - "count": 1 - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool created", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "minPoolSize": 1, - "maxPoolSize": 5, - "maxIdleTimeMS": 10000 - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool ready", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection created", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection ready", - "driverConnectionId": { - "$$type": [ - "int", - "long" - ] - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "durationMS": { - "$$type": [ - "double", - "int", - "long" - ] - } - } - } - ] - } - ] - }, - { - "description": "maxConnecting should be included in connection pool created message when specified", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "poolReadyEvent" - ], - "observeLogMessages": { - "connection": "debug" - }, - "uriOptions": { - "maxConnecting": 5 - } - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolReadyEvent": {} - }, - "count": 1 - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool created", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "maxConnecting": 5 - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool ready", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - }, - { - "description": "waitQueueTimeoutMS should be included in connection pool created message when specified", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "poolReadyEvent" - ], - "observeLogMessages": { - "connection": "debug" - }, - "uriOptions": { - "waitQueueTimeoutMS": 10000 - } - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolReadyEvent": {} - }, - "count": 1 - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool created", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "waitQueueTimeoutMS": 10000 - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool ready", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - }, - { - "description": "waitQueueSize should be included in connection pool created message when specified", - "skipReason": "DRIVERS-1206. Setting waitQueueSize property is not supported", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "poolReadyEvent" - ], - "observeLogMessages": { - "connection": "debug" - }, - "uriOptions": { - "waitQueueSize": 100 - } - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolReadyEvent": {} - }, - "count": 1 - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool created", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "waitQueueSize": 100 - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool ready", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - }, - { - "description": "waitQueueMultiple should be included in connection pool created message when specified", - "skipReason": "DRIVERS-1206. Setting waitQueueMultiple property is not supported", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "poolReadyEvent" - ], - "observeLogMessages": { - "connection": "debug" - }, - "uriOptions": { - "waitQueueSize": 5 - } - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolReadyEvent": {} - }, - "count": 1 - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool created", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "waitQueueMultiple": 5 - } - }, - { - "level": "debug", - "component": "connection", - "data": { - "message": "Connection pool ready", - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/aggregate-allowdiskuse.json b/driver-core/src/test/resources/unified-test-format/crud/aggregate-allowdiskuse.json deleted file mode 100644 index 2e54175b8a0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/aggregate-allowdiskuse.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "description": "aggregate-allowdiskuse", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Aggregate does not send allowDiskUse when value is not specified", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": {} - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": {} - } - ], - "allowDiskUse": { - "$$exists": false - } - }, - "commandName": "aggregate", - "databaseName": "crud-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate sends allowDiskUse false when false is specified", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": {} - } - ], - "allowDiskUse": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": {} - } - ], - "allowDiskUse": false - }, - "commandName": "aggregate", - "databaseName": "crud-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate sends allowDiskUse true when true is specified", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": {} - } - ], - "allowDiskUse": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": {} - } - ], - "allowDiskUse": true - }, - "commandName": "aggregate", - "databaseName": "crud-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/aggregate-collation.json b/driver-core/src/test/resources/unified-test-format/crud/aggregate-collation.json deleted file mode 100644 index e7f0c3a7f1b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/aggregate-collation.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "description": "aggregate-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": "ping" - } - ] - } - ], - "tests": [ - { - "description": "Aggregate with collation", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "x": "PING" - } - } - ], - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": [ - { - "_id": 1, - "x": "ping" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/aggregate-let.json b/driver-core/src/test/resources/unified-test-format/crud/aggregate-let.json deleted file mode 100644 index 039900920fb..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/aggregate-let.json +++ /dev/null @@ -1,376 +0,0 @@ -{ - "description": "aggregate-let", - "schemaVersion": "1.4", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - }, - { - "collection": { - "id": "collection1", - "database": "database0", - "collectionName": "coll1" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - }, - { - "collectionName": "coll1", - "databaseName": "crud-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Aggregate with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - } - }, - { - "$project": { - "_id": 0, - "x": "$$x", - "y": "$$y", - "rand": "$$rand" - } - } - ], - "let": { - "id": 1, - "x": "foo", - "y": { - "$literal": "$bar" - }, - "rand": { - "$rand": {} - } - } - }, - "expectResult": [ - { - "x": "foo", - "y": "$bar", - "rand": { - "$$type": "double" - } - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - } - }, - { - "$project": { - "_id": 0, - "x": "$$x", - "y": "$$y", - "rand": "$$rand" - } - } - ], - "let": { - "id": 1, - "x": "foo", - "y": { - "$literal": "$bar" - }, - "rand": { - "$rand": {} - } - } - } - } - } - ] - } - ] - }, - { - "description": "Aggregate with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "2.6.0", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "let": { - "x": "foo" - } - }, - "expectError": { - "errorContains": "unrecognized field 'let'", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "let": { - "x": "foo" - } - } - } - } - ] - } - ] - }, - { - "description": "Aggregate to collection with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0", - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - } - }, - { - "$project": { - "_id": 1 - } - }, - { - "$out": "coll1" - } - ], - "let": { - "id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - } - }, - { - "$project": { - "_id": 1 - } - }, - { - "$out": "coll1" - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll1", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "Aggregate to collection with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "2.6.0", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - } - }, - { - "$project": { - "_id": 1 - } - }, - { - "$out": "coll1" - } - ], - "let": { - "id": 1 - } - }, - "expectError": { - "errorContains": "unrecognized field 'let'", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - } - }, - { - "$project": { - "_id": 1 - } - }, - { - "$out": "coll1" - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/aggregate-merge-errorResponse.json b/driver-core/src/test/resources/unified-test-format/crud/aggregate-merge-errorResponse.json deleted file mode 100644 index 6c7305fd91f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/aggregate-merge-errorResponse.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "description": "aggregate-merge-errorResponse", - "schemaVersion": "1.12", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 1 - }, - { - "_id": 2, - "x": 1 - } - ] - } - ], - "tests": [ - { - "description": "aggregate $merge DuplicateKey error is accessible", - "runOnRequirements": [ - { - "minServerVersion": "5.1", - "topologies": [ - "single", - "replicaset" - ] - } - ], - "operations": [ - { - "name": "aggregate", - "object": "database0", - "arguments": { - "pipeline": [ - { - "$documents": [ - { - "_id": 2, - "x": 1 - } - ] - }, - { - "$merge": { - "into": "test", - "whenMatched": "fail" - } - } - ] - }, - "expectError": { - "errorCode": 11000, - "errorResponse": { - "keyPattern": { - "_id": 1 - }, - "keyValue": { - "_id": 2 - } - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/aggregate-merge.json b/driver-core/src/test/resources/unified-test-format/crud/aggregate-merge.json deleted file mode 100644 index ac61ceb8a6f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/aggregate-merge.json +++ /dev/null @@ -1,497 +0,0 @@ -{ - "description": "aggregate-merge", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.1.11" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_aggregate_merge" - } - }, - { - "collection": { - "id": "collection_readConcern_majority", - "database": "database0", - "collectionName": "test_aggregate_merge", - "collectionOptions": { - "readConcern": { - "level": "majority" - } - } - } - }, - { - "collection": { - "id": "collection_readConcern_local", - "database": "database0", - "collectionName": "test_aggregate_merge", - "collectionOptions": { - "readConcern": { - "level": "local" - } - } - } - }, - { - "collection": { - "id": "collection_readConcern_available", - "database": "database0", - "collectionName": "test_aggregate_merge", - "collectionOptions": { - "readConcern": { - "level": "available" - } - } - } - } - ], - "initialData": [ - { - "collectionName": "test_aggregate_merge", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Aggregate with $merge", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$merge": { - "into": "other_test_collection" - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test_aggregate_merge", - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$merge": { - "into": "other_test_collection" - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "other_test_collection", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "Aggregate with $merge and batch size of 0", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$merge": { - "into": "other_test_collection" - } - } - ], - "batchSize": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test_aggregate_merge", - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$merge": { - "into": "other_test_collection" - } - } - ], - "cursor": {} - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "other_test_collection", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "Aggregate with $merge and majority readConcern", - "operations": [ - { - "object": "collection_readConcern_majority", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$merge": { - "into": "other_test_collection" - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test_aggregate_merge", - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$merge": { - "into": "other_test_collection" - } - } - ], - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "other_test_collection", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "Aggregate with $merge and local readConcern", - "operations": [ - { - "object": "collection_readConcern_local", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$merge": { - "into": "other_test_collection" - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test_aggregate_merge", - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$merge": { - "into": "other_test_collection" - } - } - ], - "readConcern": { - "level": "local" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "other_test_collection", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "Aggregate with $merge and available readConcern", - "operations": [ - { - "object": "collection_readConcern_available", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$merge": { - "into": "other_test_collection" - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test_aggregate_merge", - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$merge": { - "into": "other_test_collection" - } - } - ], - "readConcern": { - "level": "available" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "other_test_collection", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/aggregate-out-readConcern.json b/driver-core/src/test/resources/unified-test-format/crud/aggregate-out-readConcern.json deleted file mode 100644 index e293457c1c7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/aggregate-out-readConcern.json +++ /dev/null @@ -1,407 +0,0 @@ -{ - "description": "aggregate-out-readConcern", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.1.0", - "topologies": [ - "replicaset", - "sharded" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_aggregate_out_readconcern" - } - }, - { - "collection": { - "id": "collection_readConcern_majority", - "database": "database0", - "collectionName": "test_aggregate_out_readconcern", - "collectionOptions": { - "readConcern": { - "level": "majority" - } - } - } - }, - { - "collection": { - "id": "collection_readConcern_local", - "database": "database0", - "collectionName": "test_aggregate_out_readconcern", - "collectionOptions": { - "readConcern": { - "level": "local" - } - } - } - }, - { - "collection": { - "id": "collection_readConcern_available", - "database": "database0", - "collectionName": "test_aggregate_out_readconcern", - "collectionOptions": { - "readConcern": { - "level": "available" - } - } - } - }, - { - "collection": { - "id": "collection_readConcern_linearizable", - "database": "database0", - "collectionName": "test_aggregate_out_readconcern", - "collectionOptions": { - "readConcern": { - "level": "linearizable" - } - } - } - } - ], - "initialData": [ - { - "collectionName": "test_aggregate_out_readconcern", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "readConcern majority with out stage", - "operations": [ - { - "object": "collection_readConcern_majority", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_test_collection" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test_aggregate_out_readconcern", - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_test_collection" - } - ], - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "other_test_collection", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "readConcern local with out stage", - "operations": [ - { - "object": "collection_readConcern_local", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_test_collection" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test_aggregate_out_readconcern", - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_test_collection" - } - ], - "readConcern": { - "level": "local" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "other_test_collection", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "readConcern available with out stage", - "operations": [ - { - "object": "collection_readConcern_available", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_test_collection" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test_aggregate_out_readconcern", - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_test_collection" - } - ], - "readConcern": { - "level": "available" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "other_test_collection", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "readConcern linearizable with out stage", - "operations": [ - { - "object": "collection_readConcern_linearizable", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_test_collection" - } - ] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test_aggregate_out_readconcern", - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_test_collection" - } - ], - "readConcern": { - "level": "linearizable" - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/aggregate-out.json b/driver-core/src/test/resources/unified-test-format/crud/aggregate-out.json deleted file mode 100644 index db0d7918cf5..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/aggregate-out.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "description": "aggregate-out", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "2.6", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Aggregate with $out", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_test_collection" - } - ], - "batchSize": 2 - } - } - ], - "outcome": [ - { - "collectionName": "other_test_collection", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "Aggregate with $out and batch size of 0", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_test_collection" - } - ], - "batchSize": 0 - } - } - ], - "outcome": [ - { - "collectionName": "other_test_collection", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/aggregate-write-readPreference.json b/driver-core/src/test/resources/unified-test-format/crud/aggregate-write-readPreference.json deleted file mode 100644 index c1fa3b4574a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/aggregate-write-readPreference.json +++ /dev/null @@ -1,391 +0,0 @@ -{ - "description": "aggregate-write-readPreference", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "_yamlAnchors": { - "readConcern": { - "level": "local" - }, - "writeConcern": { - "w": 1 - } - }, - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "uriOptions": { - "readConcernLevel": "local", - "w": 1 - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "readPreference": { - "mode": "secondaryPreferred", - "maxStalenessSeconds": 600 - } - } - } - }, - { - "collection": { - "id": "collection1", - "database": "database0", - "collectionName": "coll1" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Aggregate with $out includes read preference for 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0", - "serverless": "forbid" - } - ], - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$out": "coll1" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$out": "coll1" - } - ], - "$readPreference": { - "mode": "secondaryPreferred", - "maxStalenessSeconds": 600 - }, - "readConcern": { - "level": "local" - }, - "writeConcern": { - "w": 1 - } - } - } - } - ] - } - ] - }, - { - "description": "Aggregate with $out omits read preference for pre-5.0 server", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.4.99", - "serverless": "forbid" - } - ], - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$out": "coll1" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$out": "coll1" - } - ], - "$readPreference": { - "$$exists": false - }, - "readConcern": { - "level": "local" - }, - "writeConcern": { - "w": 1 - } - } - } - } - ] - } - ] - }, - { - "description": "Aggregate with $merge includes read preference for 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$merge": { - "into": "coll1" - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$merge": { - "into": "coll1" - } - } - ], - "$readPreference": { - "mode": "secondaryPreferred", - "maxStalenessSeconds": 600 - }, - "readConcern": { - "level": "local" - }, - "writeConcern": { - "w": 1 - } - } - } - } - ] - } - ] - }, - { - "description": "Aggregate with $merge omits read preference for pre-5.0 server", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$merge": { - "into": "coll1" - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$merge": { - "into": "coll1" - } - } - ], - "$readPreference": { - "$$exists": false - }, - "readConcern": { - "level": "local" - }, - "writeConcern": { - "w": 1 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/aggregate.json b/driver-core/src/test/resources/unified-test-format/crud/aggregate.json deleted file mode 100644 index 55634f05f60..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/aggregate.json +++ /dev/null @@ -1,615 +0,0 @@ -{ - "description": "aggregate", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "aggregate-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "aggregate-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - } - ] - } - ], - "tests": [ - { - "description": "aggregate with multiple batches works", - "operations": [ - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "batchSize": 2 - }, - "object": "collection0", - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "cursor": { - "batchSize": 2 - } - }, - "commandName": "aggregate", - "databaseName": "aggregate-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0", - "batchSize": 2 - }, - "commandName": "getMore", - "databaseName": "aggregate-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0", - "batchSize": 2 - }, - "commandName": "getMore", - "databaseName": "aggregate-tests" - } - } - ] - } - ] - }, - { - "description": "aggregate with a string comment", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0" - } - ], - "operations": [ - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "comment": "comment" - }, - "object": "collection0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "comment": "comment" - } - } - } - ] - } - ] - }, - { - "description": "aggregate with a document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "comment": { - "content": "test" - } - }, - "object": "collection0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "comment": { - "content": "test" - } - } - } - } - ] - } - ] - }, - { - "description": "aggregate with a document comment - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "comment": { - "content": "test" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "comment": { - "content": "test" - } - }, - "commandName": "aggregate", - "databaseName": "aggregate-tests" - } - } - ] - } - ] - }, - { - "description": "aggregate with comment sets comment on getMore", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "batchSize": 2, - "comment": { - "content": "test" - } - }, - "object": "collection0", - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "cursor": { - "batchSize": 2 - }, - "comment": { - "content": "test" - } - }, - "commandName": "aggregate", - "databaseName": "aggregate-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0", - "batchSize": 2, - "comment": { - "content": "test" - } - }, - "commandName": "getMore", - "databaseName": "aggregate-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0", - "batchSize": 2, - "comment": { - "content": "test" - } - }, - "commandName": "getMore", - "databaseName": "aggregate-tests" - } - } - ] - } - ] - }, - { - "description": "aggregate with comment does not set comment on getMore - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "maxServerVersion": "4.3.99" - } - ], - "operations": [ - { - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "batchSize": 2, - "comment": "comment" - }, - "object": "collection0", - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "cursor": { - "batchSize": 2 - }, - "comment": "comment" - }, - "commandName": "aggregate", - "databaseName": "aggregate-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0", - "batchSize": 2, - "comment": { - "$$exists": false - } - }, - "commandName": "getMore", - "databaseName": "aggregate-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0", - "batchSize": 2, - "comment": { - "$$exists": false - } - }, - "commandName": "getMore", - "databaseName": "aggregate-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate with multiple stages", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "batchSize": 2 - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-arrayFilters-clientError.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-arrayFilters-clientError.json deleted file mode 100644 index 63815e32337..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-arrayFilters-clientError.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "description": "bulkWrite-arrayFilters-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.5.5" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "crud-v2" - } - } - ], - "initialData": [ - { - "collectionName": "crud-v2", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite on server that doesn't support arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": {}, - "update": { - "$set": { - "y.0.b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 1 - } - ] - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "BulkWrite on server that doesn't support arrayFilters with arrayFilters on second op", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": {}, - "update": { - "$set": { - "y.0.b": 2 - } - } - } - }, - { - "updateMany": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 1 - } - ] - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-arrayFilters.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-arrayFilters.json deleted file mode 100644 index bc4e7b9fcb5..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-arrayFilters.json +++ /dev/null @@ -1,364 +0,0 @@ -{ - "description": "bulkWrite-arrayFilters", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.5.6" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite updateOne with arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 3 - } - ] - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": {}, - "u": { - "$set": { - "y.$[i].b": 2 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "arrayFilters": [ - { - "i.b": 3 - } - ] - } - ], - "ordered": true - }, - "commandName": "update", - "databaseName": "crud-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 2 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - } - ] - } - ] - }, - { - "description": "BulkWrite updateMany with arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 1 - } - ] - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": {}, - "u": { - "$set": { - "y.$[i].b": 2 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - }, - "arrayFilters": [ - { - "i.b": 1 - } - ] - } - ], - "ordered": true - }, - "commandName": "update", - "databaseName": "crud-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 2 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 2 - } - ] - } - ] - } - ] - }, - { - "description": "BulkWrite with arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 3 - } - ] - } - }, - { - "updateMany": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 1 - } - ] - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 3, - "modifiedCount": 3, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 2 - }, - { - "b": 2 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 2 - } - ] - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-collation.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-collation.json deleted file mode 100644 index fe54b1a1e35..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-collation.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "description": "bulkWrite-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - }, - { - "_id": 3, - "x": "pINg" - }, - { - "_id": 4, - "x": "pong" - }, - { - "_id": 5, - "x": "pONg" - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite with delete operations and collation", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "x": "PING" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - { - "deleteOne": { - "filter": { - "x": "PING" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - { - "deleteMany": { - "filter": { - "x": "PONG" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 4, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "BulkWrite with update operations and collation", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "x": "ping" - }, - "update": { - "$set": { - "x": "PONG" - } - }, - "collation": { - "locale": "en_US", - "strength": 3 - } - } - }, - { - "updateOne": { - "filter": { - "x": "ping" - }, - "update": { - "$set": { - "x": "PONG" - } - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - }, - { - "replaceOne": { - "filter": { - "x": "ping" - }, - "replacement": { - "_id": 6, - "x": "ping" - }, - "upsert": true, - "collation": { - "locale": "en_US", - "strength": 3 - } - } - }, - { - "updateMany": { - "filter": { - "x": "pong" - }, - "update": { - "$set": { - "x": "PONG" - } - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 6, - "modifiedCount": 4, - "upsertedCount": 1, - "upsertedIds": { - "2": 6 - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "PONG" - }, - { - "_id": 3, - "x": "PONG" - }, - { - "_id": 4, - "x": "PONG" - }, - { - "_id": 5, - "x": "PONG" - }, - { - "_id": 6, - "x": "ping" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-comment.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-comment.json deleted file mode 100644 index d88ffb7a33e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-comment.json +++ /dev/null @@ -1,545 +0,0 @@ -{ - "description": "bulkWrite-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "BulkWrite_comment" - } - } - ], - "initialData": [ - { - "collectionName": "BulkWrite_comment", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 5, - "x": "inserted" - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": "replaced" - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$set": { - "x": "updated" - } - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 3 - } - } - } - ], - "comment": "comment" - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 5 - } - }, - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "note": "Events split due to : JAVA-4537 ", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "BulkWrite_comment", - "documents": [ - { - "_id": 5, - "x": "inserted" - } - ], - "ordered": true, - "comment": "comment" - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "BulkWrite_comment", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "x": "replaced" - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "comment": "comment" - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "BulkWrite_comment", - "updates": [ - { - "q": { - "_id": 2 - }, - "u": { - "$set": { - "x": "updated" - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "comment": "comment" - } - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "BulkWrite_comment", - "deletes": [ - { - "q": { - "_id": 3 - }, - "limit": 1 - } - ], - "ordered": true, - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "BulkWrite_comment", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": "replaced" - }, - { - "_id": 2, - "x": "updated" - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": "inserted" - } - ] - } - ] - }, - { - "description": "BulkWrite with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 5, - "x": "inserted" - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": "replaced" - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$set": { - "x": "updated" - } - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 3 - } - } - } - ], - "comment": { - "key": "value" - } - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 5 - } - }, - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "note": "Events split due to : JAVA-4537 ", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "BulkWrite_comment", - "documents": [ - { - "_id": 5, - "x": "inserted" - } - ], - "ordered": true, - "comment": { - "key": "value" - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "BulkWrite_comment", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "x": "replaced" - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "comment": { - "key": "value" - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "BulkWrite_comment", - "updates": [ - { - "q": { - "_id": 2 - }, - "u": { - "$set": { - "x": "updated" - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "comment": { - "key": "value" - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "BulkWrite_comment", - "deletes": [ - { - "q": { - "_id": 3 - }, - "limit": 1 - } - ], - "ordered": true, - "comment": { - "key": "value" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "BulkWrite_comment", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": "replaced" - }, - { - "_id": 2, - "x": "updated" - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": "inserted" - } - ] - } - ] - }, - { - "description": "BulkWrite with comment - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 5, - "x": "inserted" - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": "replaced" - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$set": { - "x": "updated" - } - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 3 - } - } - } - ], - "comment": "comment" - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "BulkWrite_comment", - "documents": [ - { - "_id": 5, - "x": "inserted" - } - ], - "ordered": true, - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "BulkWrite_comment", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-delete-hint-clientError.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-delete-hint-clientError.json deleted file mode 100644 index 2961b55dc05..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-delete-hint-clientError.json +++ /dev/null @@ -1,193 +0,0 @@ -{ - "description": "bulkWrite-delete-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.3.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "BulkWrite_delete_hint" - } - } - ], - "initialData": [ - { - "collectionName": "BulkWrite_delete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite deleteOne with hints unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - }, - "hint": "_id_" - } - }, - { - "deleteOne": { - "filter": { - "_id": 2 - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "BulkWrite_delete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite deleteMany with hints unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "hint": "_id_" - } - }, - { - "deleteMany": { - "filter": { - "_id": { - "$gte": 4 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "BulkWrite_delete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-delete-hint-serverError.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-delete-hint-serverError.json deleted file mode 100644 index fa995220935..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-delete-hint-serverError.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "description": "bulkWrite-delete-hint-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.3.3" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "BulkWrite_delete_hint" - } - } - ], - "initialData": [ - { - "collectionName": "BulkWrite_delete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite deleteOne with hints unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - }, - "hint": "_id_" - } - }, - { - "deleteOne": { - "filter": { - "_id": 2 - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "BulkWrite_delete_hint", - "deletes": [ - { - "q": { - "_id": 1 - }, - "hint": "_id_", - "limit": 1 - }, - { - "q": { - "_id": 2 - }, - "hint": { - "_id": 1 - }, - "limit": 1 - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "BulkWrite_delete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite deleteMany with hints unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "hint": "_id_" - } - }, - { - "deleteMany": { - "filter": { - "_id": { - "$gte": 4 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "BulkWrite_delete_hint", - "deletes": [ - { - "q": { - "_id": { - "$lt": 3 - } - }, - "hint": "_id_", - "limit": 0 - }, - { - "q": { - "_id": { - "$gte": 4 - } - }, - "hint": { - "_id": 1 - }, - "limit": 0 - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "BulkWrite_delete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-delete-hint.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-delete-hint.json deleted file mode 100644 index 9fcdecefd70..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-delete-hint.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "description": "bulkWrite-delete-hint", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.3.4" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "BulkWrite_delete_hint" - } - } - ], - "initialData": [ - { - "collectionName": "BulkWrite_delete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite deleteOne with hints", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - }, - "hint": "_id_" - } - }, - { - "deleteOne": { - "filter": { - "_id": 2 - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 2, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "BulkWrite_delete_hint", - "deletes": [ - { - "q": { - "_id": 1 - }, - "hint": "_id_", - "limit": 1 - }, - { - "q": { - "_id": 2 - }, - "hint": { - "_id": 1 - }, - "limit": 1 - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "BulkWrite_delete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite deleteMany with hints", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "hint": "_id_" - } - }, - { - "deleteMany": { - "filter": { - "_id": { - "$gte": 4 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 3, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "BulkWrite_delete_hint", - "deletes": [ - { - "q": { - "_id": { - "$lt": 3 - } - }, - "hint": "_id_", - "limit": 0 - }, - { - "q": { - "_id": { - "$gte": 4 - } - }, - "hint": { - "_id": 1 - }, - "limit": 0 - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "BulkWrite_delete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-deleteMany-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-deleteMany-hint-unacknowledged.json deleted file mode 100644 index 2dda9486e88..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-deleteMany-hint-unacknowledged.json +++ /dev/null @@ -1,269 +0,0 @@ -{ - "description": "bulkWrite-deleteMany-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged deleteMany with hint string fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged deleteMany with hint document fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged deleteMany with hint string on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - } - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "limit": 0 - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged deleteMany with hint document on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "limit": 0 - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-deleteMany-let.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-deleteMany-let.json deleted file mode 100644 index 45c20ea49ad..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-deleteMany-let.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "description": "BulkWrite deleteMany-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite deleteMany with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteMany": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - } - } - } - ], - "let": { - "id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "limit": 0 - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "BulkWrite deleteMany with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - } - } - } - ], - "let": { - "id": 1 - } - }, - "expectError": { - "errorContains": "'delete.let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "limit": 1 - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-deleteOne-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-deleteOne-hint-unacknowledged.json deleted file mode 100644 index aadf6d9e991..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-deleteOne-hint-unacknowledged.json +++ /dev/null @@ -1,265 +0,0 @@ -{ - "description": "bulkWrite-deleteOne-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged deleteOne with hint string fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged deleteOne with hint document fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged deleteOne with hint string on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - } - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "limit": 1 - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged deleteOne with hint document on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "limit": 1 - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-deleteOne-let.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-deleteOne-let.json deleted file mode 100644 index f3268163cb6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-deleteOne-let.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "description": "BulkWrite deleteOne-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite deleteOne with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - } - } - } - ], - "let": { - "id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "limit": 1 - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "BulkWrite deleteOne with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "maxServerVersion": "4.9" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - } - } - } - ], - "let": { - "id": 1 - } - }, - "expectError": { - "errorContains": "'delete.let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "limit": 1 - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-errorResponse.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-errorResponse.json deleted file mode 100644 index 157637c713a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-errorResponse.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "description": "bulkWrite-errorResponse", - "schemaVersion": "1.12", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "tests": [ - { - "description": "bulkWrite operations support errorResponse assertions", - "runOnRequirements": [ - { - "minServerVersion": "4.0.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.2.0", - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 8 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "errorCode": 8, - "errorResponse": { - "code": 8 - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-insertOne-dots_and_dollars.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-insertOne-dots_and_dollars.json deleted file mode 100644 index 92bbb1aaf25..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-insertOne-dots_and_dollars.json +++ /dev/null @@ -1,374 +0,0 @@ -{ - "description": "bulkWrite-insertOne-dots_and_dollars", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Inserting document with top-level dollar-prefixed key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1, - "$a": 1 - } - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 1 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "$a": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "$a": 1 - } - ] - } - ] - }, - { - "description": "Inserting document with top-level dollar-prefixed key on pre-5.0 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "4.99" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1, - "$a": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "$a": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [] - } - ] - }, - { - "description": "Inserting document with top-level dotted key", - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1, - "a.b": 1 - } - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 1 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "a.b": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a.b": 1 - } - ] - } - ] - }, - { - "description": "Inserting document with dollar-prefixed key in embedded doc", - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1, - "a": { - "$b": 1 - } - } - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 1 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "a": { - "$b": 1 - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "$b": 1 - } - } - ] - } - ] - }, - { - "description": "Inserting document with dotted key in embedded doc", - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1, - "a": { - "b.c": 1 - } - } - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 1 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "a": { - "b.c": 1 - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "b.c": 1 - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-replaceOne-dots_and_dollars.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-replaceOne-dots_and_dollars.json deleted file mode 100644 index fce647d8f4b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-replaceOne-dots_and_dollars.json +++ /dev/null @@ -1,532 +0,0 @@ -{ - "description": "bulkWrite-replaceOne-dots_and_dollars", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ], - "tests": [ - { - "description": "Replacing document with top-level dotted key on 3.6+ server", - "runOnRequirements": [ - { - "minServerVersion": "3.6" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a.b": 1 - } - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a.b": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a.b": 1 - } - ] - } - ] - }, - { - "description": "Replacing document with top-level dotted key on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a.b": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a.b": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "Replacing document with dollar-prefixed key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "$b": 1 - } - } - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a": { - "$b": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "$b": 1 - } - } - ] - } - ] - }, - { - "description": "Replacing document with dollar-prefixed key in embedded doc on pre-5.0 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "4.99" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "$b": 1 - } - } - } - } - ] - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a": { - "$b": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "Replacing document with dotted key in embedded doc on 3.6+ server", - "runOnRequirements": [ - { - "minServerVersion": "3.6" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "b.c": 1 - } - } - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a": { - "b.c": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "b.c": 1 - } - } - ] - } - ] - }, - { - "description": "Replacing document with dotted key in embedded doc on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "b.c": 1 - } - } - } - } - ] - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a": { - "b.c": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-replaceOne-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-replaceOne-hint-unacknowledged.json deleted file mode 100644 index e54cd704df6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-replaceOne-hint-unacknowledged.json +++ /dev/null @@ -1,293 +0,0 @@ -{ - "description": "bulkWrite-replaceOne-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged replaceOne with hint string fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": "_id_" - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged replaceOne with hint document fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged replaceOne with hint string on 4.2+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": "_id_" - } - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "x": 111 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "$$type": [ - "string", - "object" - ] - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged replaceOne with hint document on 4.2+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "x": 111 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "$$type": [ - "string", - "object" - ] - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-replaceOne-let.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-replaceOne-let.json deleted file mode 100644 index 70f63837a84..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-replaceOne-let.json +++ /dev/null @@ -1,226 +0,0 @@ -{ - "description": "BulkWrite replaceOne-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite replaceOne with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "replacement": { - "x": 3 - } - } - } - ], - "let": { - "id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "u": { - "x": 3 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 3 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "BulkWrite replaceOne with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.9" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "replacement": { - "x": 3 - } - } - } - ], - "let": { - "id": 1 - } - }, - "expectError": { - "errorContains": "'update.let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "u": { - "x": 3 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-replaceOne-sort.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-replaceOne-sort.json deleted file mode 100644 index c0bd3835142..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-replaceOne-sort.json +++ /dev/null @@ -1,239 +0,0 @@ -{ - "description": "BulkWrite replaceOne-sort", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite replaceOne with sort option", - "runOnRequirements": [ - { - "minServerVersion": "8.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "sort": { - "_id": -1 - }, - "replacement": { - "x": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "x": 1 - }, - "sort": { - "_id": -1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1 - }, - "commandName": "update" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 1 - } - ] - } - ] - }, - { - "description": "BulkWrite replaceOne with sort option unsupported (server-side error)", - "runOnRequirements": [ - { - "maxServerVersion": "7.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "sort": { - "_id": -1 - }, - "replacement": { - "x": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "x": 1 - }, - "sort": { - "_id": -1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-update-hint-clientError.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-update-hint-clientError.json deleted file mode 100644 index d5eb71c29e8..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-update-hint-clientError.json +++ /dev/null @@ -1,284 +0,0 @@ -{ - "description": "bulkWrite-update-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.3.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_bulkwrite_update_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite updateOne with update hints unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - }, - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite updateMany with update hints unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - }, - { - "updateMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite replaceOne with update hints unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 3 - }, - "replacement": { - "x": 333 - }, - "hint": "_id_" - } - }, - { - "replaceOne": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 444 - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-update-hint-serverError.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-update-hint-serverError.json deleted file mode 100644 index b0f7e1b3817..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-update-hint-serverError.json +++ /dev/null @@ -1,422 +0,0 @@ -{ - "description": "bulkWrite-update-hint-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.1.9" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_bulkwrite_update_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite updateOne with update hints unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - }, - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_bulkwrite_update_hint", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_", - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": 1 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite updateMany with update hints unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - }, - { - "updateMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_bulkwrite_update_hint", - "updates": [ - { - "q": { - "_id": { - "$lt": 3 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "hint": "_id_", - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": { - "$lt": 3 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "hint": { - "_id": 1 - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite replaceOne with update hints unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 3 - }, - "replacement": { - "x": 333 - }, - "hint": "_id_" - } - }, - { - "replaceOne": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 444 - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_bulkwrite_update_hint", - "updates": [ - { - "q": { - "_id": 3 - }, - "u": { - "x": 333 - }, - "hint": "_id_", - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": 4 - }, - "u": { - "x": 444 - }, - "hint": { - "_id": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-update-hint.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-update-hint.json deleted file mode 100644 index 4206359891f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-update-hint.json +++ /dev/null @@ -1,445 +0,0 @@ -{ - "description": "bulkWrite-update-hint", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_bulkwrite_update_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite updateOne with update hints", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - }, - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_bulkwrite_update_hint", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": "_id_" - }, - { - "q": { - "_id": 1 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "_id": 1 - } - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 13 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite updateMany with update hints", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - }, - { - "updateMany": { - "filter": { - "_id": { - "$lt": 3 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 4, - "modifiedCount": 4, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_bulkwrite_update_hint", - "updates": [ - { - "q": { - "_id": { - "$lt": 3 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": "_id_" - }, - { - "q": { - "_id": { - "$lt": 3 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "_id": 1 - } - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 13 - }, - { - "_id": 2, - "x": 24 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite replaceOne with update hints", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 3 - }, - "replacement": { - "x": 333 - }, - "hint": "_id_" - } - }, - { - "replaceOne": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 444 - }, - "hint": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_bulkwrite_update_hint", - "updates": [ - { - "q": { - "_id": 3 - }, - "u": { - "x": 333 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": "_id_" - }, - { - "q": { - "_id": 4 - }, - "u": { - "x": 444 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "_id": 1 - } - } - ], - "ordered": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_bulkwrite_update_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 333 - }, - { - "_id": 4, - "x": 444 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-update-validation.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-update-validation.json deleted file mode 100644 index f9bfda0edd0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-update-validation.json +++ /dev/null @@ -1,210 +0,0 @@ -{ - "description": "bulkWrite-update-validation", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite replaceOne prohibits atomic modifiers", - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "$set": { - "x": 22 - } - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite updateOne requires atomic modifiers", - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "x": 22 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite updateMany requires atomic modifiers", - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "x": 44 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateMany-dots_and_dollars.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateMany-dots_and_dollars.json deleted file mode 100644 index 35a5cdd52a9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateMany-dots_and_dollars.json +++ /dev/null @@ -1,452 +0,0 @@ -{ - "description": "bulkWrite-updateMany-dots_and_dollars", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {} - } - ] - } - ], - "tests": [ - { - "description": "Updating document to set top-level dollar-prefixed key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ] - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {}, - "$a": 1 - } - ] - } - ] - }, - { - "description": "Updating document to set top-level dotted key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ] - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {}, - "a.b": 1 - } - ] - } - ] - }, - { - "description": "Updating document to set dollar-prefixed key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ] - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": { - "$a": 1 - } - } - ] - } - ] - }, - { - "description": "Updating document to set dotted key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ] - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": { - "a.b": 1 - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateMany-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateMany-hint-unacknowledged.json deleted file mode 100644 index 87478918d29..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateMany-hint-unacknowledged.json +++ /dev/null @@ -1,305 +0,0 @@ -{ - "description": "bulkWrite-updateMany-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged updateMany with hint string fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged updateMany with hint document fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged updateMany with hint string on 4.2+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "$$type": [ - "string", - "object" - ] - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged updateMany with hint document on 4.2+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "$$type": [ - "string", - "object" - ] - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateMany-let.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateMany-let.json deleted file mode 100644 index fbeba1a6074..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateMany-let.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "description": "BulkWrite updateMany-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 20 - }, - { - "_id": 2, - "x": 21 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite updateMany with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "update": [ - { - "$set": { - "x": 21 - } - } - ] - } - } - ], - "let": { - "id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "u": [ - { - "$set": { - "x": 21 - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 21 - }, - { - "_id": 2, - "x": 21 - } - ] - } - ] - }, - { - "description": "BulkWrite updateMany with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.9" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "update": [ - { - "$set": { - "x": 21 - } - } - ] - } - } - ], - "let": { - "id": 1 - } - }, - "expectError": { - "errorContains": "'update.let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "u": [ - { - "$set": { - "x": 21 - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 20 - }, - { - "_id": 2, - "x": 21 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateOne-dots_and_dollars.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateOne-dots_and_dollars.json deleted file mode 100644 index cbbe113ce86..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateOne-dots_and_dollars.json +++ /dev/null @@ -1,460 +0,0 @@ -{ - "description": "bulkWrite-updateOne-dots_and_dollars", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {} - } - ] - } - ], - "tests": [ - { - "description": "Updating document to set top-level dollar-prefixed key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ] - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {}, - "$a": 1 - } - ] - } - ] - }, - { - "description": "Updating document to set top-level dotted key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ] - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {}, - "a.b": 1 - } - ] - } - ] - }, - { - "description": "Updating document to set dollar-prefixed key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ] - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": { - "$a": 1 - } - } - ] - } - ] - }, - { - "description": "Updating document to set dotted key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ] - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": { - "a.b": 1 - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateOne-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateOne-hint-unacknowledged.json deleted file mode 100644 index 1345f6b5366..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateOne-hint-unacknowledged.json +++ /dev/null @@ -1,305 +0,0 @@ -{ - "description": "bulkWrite-updateOne-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged updateOne with hint string fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged updateOne with hint document fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged updateOne with hint string on 4.2+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "$$type": [ - "string", - "object" - ] - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged updateOne with hint document on 4.2+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "$$type": [ - "string", - "object" - ] - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateOne-let.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateOne-let.json deleted file mode 100644 index 96783c782fb..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateOne-let.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "description": "BulkWrite updateOne-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 20 - }, - { - "_id": 2, - "x": 21 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite updateOne with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "update": [ - { - "$set": { - "x": 22 - } - } - ] - } - } - ], - "let": { - "id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "u": [ - { - "$set": { - "x": 22 - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 22 - }, - { - "_id": 2, - "x": 21 - } - ] - } - ] - }, - { - "description": "BulkWrite updateOne with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.9" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "update": [ - { - "$set": { - "x": 22 - } - } - ] - } - } - ], - "let": { - "id": 1 - } - }, - "expectError": { - "errorContains": "'update.let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "u": [ - { - "$set": { - "x": 22 - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 20 - }, - { - "_id": 2, - "x": 21 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateOne-sort.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateOne-sort.json deleted file mode 100644 index f78bd3bf3e3..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite-updateOne-sort.json +++ /dev/null @@ -1,255 +0,0 @@ -{ - "description": "BulkWrite updateOne-sort", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite updateOne with sort option", - "runOnRequirements": [ - { - "minServerVersion": "8.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "sort": { - "_id": -1 - }, - "update": [ - { - "$set": { - "x": 1 - } - } - ] - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": [ - { - "$set": { - "x": 1 - } - } - ], - "sort": { - "_id": -1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1 - }, - "commandName": "update" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 1 - } - ] - } - ] - }, - { - "description": "BulkWrite updateOne with sort option unsupported (server-side error)", - "runOnRequirements": [ - { - "maxServerVersion": "7.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "sort": { - "_id": -1 - }, - "update": [ - { - "$set": { - "x": 1 - } - } - ] - } - } - ] - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": [ - { - "$set": { - "x": 1 - } - } - ], - "sort": { - "_id": -1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite.json b/driver-core/src/test/resources/unified-test-format/crud/bulkWrite.json deleted file mode 100644 index 59b33cbac58..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/bulkWrite.json +++ /dev/null @@ -1,829 +0,0 @@ -{ - "description": "bulkWrite", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "2.6" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite with deleteOne operations", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 3 - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 2 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "BulkWrite with deleteMany operations", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteMany": { - "filter": { - "x": { - "$lt": 11 - } - } - } - }, - { - "deleteMany": { - "filter": { - "x": { - "$lte": 22 - } - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 2, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [] - } - ] - }, - { - "description": "BulkWrite with insertOne operations", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "insertOne": { - "document": { - "_id": 4, - "x": 44 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 2, - "insertedIds": { - "$$unsetOrMatches": { - "0": 3, - "1": 4 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite with replaceOne operations", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 3 - }, - "replacement": { - "x": 33 - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 12 - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 3 - }, - "replacement": { - "x": 33 - }, - "upsert": true - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 1, - "upsertedIds": { - "2": 3 - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite with updateOne operations", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 0 - }, - "update": { - "$set": { - "x": 0 - } - } - } - }, - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 11 - } - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "updateOne": { - "filter": { - "_id": 3 - }, - "update": { - "$set": { - "x": 33 - } - }, - "upsert": true - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 2, - "modifiedCount": 1, - "upsertedCount": 1, - "upsertedIds": { - "3": 3 - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite with updateMany operations", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "x": { - "$lt": 11 - } - }, - "update": { - "$set": { - "x": 0 - } - } - } - }, - { - "updateMany": { - "filter": { - "x": { - "$lte": 22 - } - }, - "update": { - "$unset": { - "y": 1 - } - } - } - }, - { - "updateMany": { - "filter": { - "x": { - "$lte": 22 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "updateMany": { - "filter": { - "_id": 3 - }, - "update": { - "$set": { - "x": 33 - } - }, - "upsert": true - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 4, - "modifiedCount": 2, - "upsertedCount": 1, - "upsertedIds": { - "3": 3 - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite with mixed ordered operations", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "updateMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "insertOne": { - "document": { - "_id": 4, - "x": 44 - } - } - }, - { - "deleteMany": { - "filter": { - "x": { - "$nin": [ - 24, - 34 - ] - } - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 44 - }, - "upsert": true - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 2, - "insertedCount": 2, - "insertedIds": { - "$$unsetOrMatches": { - "0": 3, - "3": 4 - } - }, - "matchedCount": 3, - "modifiedCount": 3, - "upsertedCount": 1, - "upsertedIds": { - "5": 4 - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 2, - "x": 24 - }, - { - "_id": 3, - "x": 34 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite with mixed unordered operations", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "replaceOne": { - "filter": { - "_id": 3 - }, - "replacement": { - "_id": 3, - "x": 33 - }, - "upsert": true - } - }, - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": false - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 1, - "upsertedIds": { - "0": 3 - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite continue-on-error behavior with unordered (preexisting duplicate key)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "insertOne": { - "document": { - "_id": 4, - "x": 44 - } - } - } - ], - "ordered": false - }, - "expectError": { - "isError": true, - "expectResult": { - "deletedCount": 0, - "insertedCount": 2, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "BulkWrite continue-on-error behavior with unordered (duplicate key in requests)", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "insertOne": { - "document": { - "_id": 4, - "x": 44 - } - } - } - ], - "ordered": false - }, - "expectError": { - "isError": true, - "expectResult": { - "deletedCount": 0, - "insertedCount": 2, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-delete-options.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-delete-options.json deleted file mode 100644 index d9987897dcd..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-delete-options.json +++ /dev/null @@ -1,268 +0,0 @@ -{ - "description": "client bulkWrite delete options", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "crud-tests.coll0", - "collation": { - "locale": "simple" - }, - "hint": "_id_" - }, - "tests": [ - { - "description": "client bulk write delete with collation", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - }, - "collation": { - "locale": "simple" - } - } - }, - { - "deleteMany": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": { - "$gt": 1 - } - }, - "collation": { - "locale": "simple" - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 0, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 3, - "insertResults": {}, - "updateResults": {}, - "deleteResults": { - "0": { - "deletedCount": 1 - }, - "1": { - "deletedCount": 2 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "delete": 0, - "filter": { - "_id": 1 - }, - "collation": { - "locale": "simple" - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": { - "$gt": 1 - } - }, - "collation": { - "locale": "simple" - }, - "multi": true - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "databaseName": "crud-tests", - "collectionName": "coll0", - "documents": [] - } - ] - }, - { - "description": "client bulk write delete with hint", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - }, - "hint": "_id_" - } - }, - { - "deleteMany": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 0, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 3, - "insertResults": {}, - "updateResults": {}, - "deleteResults": { - "0": { - "deletedCount": 1 - }, - "1": { - "deletedCount": 2 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "delete": 0, - "filter": { - "_id": 1 - }, - "hint": "_id_", - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_", - "multi": true - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "databaseName": "crud-tests", - "collectionName": "coll0", - "documents": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-errorResponse.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-errorResponse.json deleted file mode 100644 index b828aad3b93..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-errorResponse.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "description": "client bulkWrite errorResponse", - "schemaVersion": "1.12", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - } - ], - "_yamlAnchors": { - "namespace": "crud-tests.coll0" - }, - "tests": [ - { - "description": "client bulkWrite operations support errorResponse assertions", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorCode": 8 - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "errorCode": 8, - "errorResponse": { - "code": 8 - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-errors.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-errors.json deleted file mode 100644 index 015bd95c990..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-errors.json +++ /dev/null @@ -1,513 +0,0 @@ -{ - "description": "client bulkWrite errors", - "schemaVersion": "1.21", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "uriOptions": { - "retryWrites": false - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "crud-tests.coll0", - "writeConcernErrorCode": 91, - "writeConcernErrorMessage": "Replication is being shut down", - "undefinedVarCode": 17276 - }, - "tests": [ - { - "description": "an individual operation fails during an ordered bulkWrite", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - } - } - }, - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id2" - ] - } - } - } - }, - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 3 - } - } - } - ], - "verboseResults": true - }, - "expectError": { - "expectResult": { - "insertedCount": 0, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 1, - "insertResults": {}, - "updateResults": {}, - "deleteResults": { - "0": { - "deletedCount": 1 - } - } - }, - "writeErrors": { - "1": { - "code": 17276 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "an individual operation fails during an unordered bulkWrite", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - } - } - }, - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id2" - ] - } - } - } - }, - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 3 - } - } - } - ], - "verboseResults": true, - "ordered": false - }, - "expectError": { - "expectResult": { - "insertedCount": 0, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 2, - "insertResults": {}, - "updateResults": {}, - "deleteResults": { - "0": { - "deletedCount": 1 - }, - "2": { - "deletedCount": 1 - } - } - }, - "writeErrors": { - "1": { - "code": 17276 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "detailed results are omitted from error when verboseResults is false", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - } - } - }, - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id2" - ] - } - } - } - }, - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 3 - } - } - } - ], - "verboseResults": false - }, - "expectError": { - "expectResult": { - "insertedCount": 0, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 1, - "insertResults": { - "$$unsetOrMatches": {} - }, - "updateResults": { - "$$unsetOrMatches": {} - }, - "deleteResults": { - "$$unsetOrMatches": {} - } - }, - "writeErrors": { - "1": { - "code": 17276 - } - } - } - } - ] - }, - { - "description": "a top-level failure occurs during a bulkWrite", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorCode": 8 - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "x": 1 - } - } - } - ], - "verboseResults": true - }, - "expectError": { - "errorCode": 8 - } - } - ] - }, - { - "description": "a bulk write with only errors does not report a partial result", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id2" - ] - } - } - } - } - ], - "verboseResults": true - }, - "expectError": { - "expectResult": { - "$$unsetOrMatches": {} - }, - "writeErrors": { - "0": { - "code": 17276 - } - } - } - } - ] - }, - { - "description": "a write concern error occurs during a bulkWrite", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 10 - } - } - } - ], - "verboseResults": true - }, - "expectError": { - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 10 - } - }, - "updateResults": {}, - "deleteResults": {} - }, - "writeConcernErrors": [ - { - "code": 91, - "message": "Replication is being shut down" - } - ] - } - } - ] - }, - { - "description": "an empty list of write models is a client-side error", - "operations": [ - { - "name": "clientBulkWrite", - "object": "client0", - "arguments": { - "models": [], - "verboseResults": true - }, - "expectError": { - "isClientError": true - } - } - ] - }, - { - "description": "Requesting unacknowledged write with verboseResults is a client-side error", - "operations": [ - { - "name": "clientBulkWrite", - "object": "client0", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 10 - } - } - } - ], - "verboseResults": true, - "ordered": false, - "writeConcern": { - "w": 0 - } - }, - "expectError": { - "isClientError": true, - "errorContains": "Cannot request unacknowledged write concern and verbose results" - } - } - ] - }, - { - "description": "Requesting unacknowledged write with ordered is a client-side error", - "operations": [ - { - "name": "clientBulkWrite", - "object": "client0", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 10 - } - } - } - ], - "writeConcern": { - "w": 0 - } - }, - "expectError": { - "isClientError": true, - "errorContains": "Cannot request unacknowledged write concern and ordered writes" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-mixed-namespaces.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-mixed-namespaces.json deleted file mode 100644 index 55f06189233..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-mixed-namespaces.json +++ /dev/null @@ -1,315 +0,0 @@ -{ - "description": "client bulkWrite with mixed namespaces", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - }, - { - "collection": { - "id": "collection1", - "database": "database0", - "collectionName": "coll1" - } - }, - { - "database": { - "id": "database1", - "client": "client0", - "databaseName": "db1" - } - }, - { - "collection": { - "id": "collection2", - "database": "database1", - "collectionName": "coll2" - } - } - ], - "initialData": [ - { - "databaseName": "db0", - "collectionName": "coll0", - "documents": [] - }, - { - "databaseName": "db0", - "collectionName": "coll1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - }, - { - "databaseName": "db1", - "collectionName": "coll2", - "documents": [ - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "_yamlAnchors": { - "db0Coll0Namespace": "db0.coll0", - "db0Coll1Namespace": "db0.coll1", - "db1Coll2Namespace": "db1.coll2" - }, - "tests": [ - { - "description": "client bulkWrite with mixed namespaces", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "db0.coll0", - "document": { - "_id": 1 - } - } - }, - { - "insertOne": { - "namespace": "db0.coll0", - "document": { - "_id": 2 - } - } - }, - { - "updateOne": { - "namespace": "db0.coll1", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteOne": { - "namespace": "db1.coll2", - "filter": { - "_id": 3 - } - } - }, - { - "deleteOne": { - "namespace": "db0.coll1", - "filter": { - "_id": 2 - } - } - }, - { - "replaceOne": { - "namespace": "db1.coll2", - "filter": { - "_id": 4 - }, - "replacement": { - "x": 45 - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 2, - "upsertedCount": 0, - "matchedCount": 2, - "modifiedCount": 2, - "deletedCount": 2, - "insertResults": { - "0": { - "insertedId": 1 - }, - "1": { - "insertedId": 2 - } - }, - "updateResults": { - "2": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - }, - "5": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - } - }, - "deleteResults": { - "3": { - "deletedCount": 1 - }, - "4": { - "deletedCount": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "bulkWrite": 1, - "ops": [ - { - "insert": 0, - "document": { - "_id": 1 - } - }, - { - "insert": 0, - "document": { - "_id": 2 - } - }, - { - "update": 1, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "delete": 2, - "filter": { - "_id": 3 - }, - "multi": false - }, - { - "delete": 1, - "filter": { - "_id": 2 - }, - "multi": false - }, - { - "update": 2, - "filter": { - "_id": 4 - }, - "updateMods": { - "x": 45 - }, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "db0.coll0" - }, - { - "ns": "db0.coll1" - }, - { - "ns": "db1.coll2" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "databaseName": "db0", - "collectionName": "coll0", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - }, - { - "databaseName": "db0", - "collectionName": "coll1", - "documents": [ - { - "_id": 1, - "x": 12 - } - ] - }, - { - "databaseName": "db1", - "collectionName": "coll2", - "documents": [ - { - "_id": 4, - "x": 45 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-options.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-options.json deleted file mode 100644 index 708fe4e85b0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-options.json +++ /dev/null @@ -1,716 +0,0 @@ -{ - "description": "client bulkWrite top-level options", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "client": { - "id": "writeConcernClient", - "uriOptions": { - "w": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "crud-tests.coll0", - "comment": { - "bulk": "write" - }, - "let": { - "id1": 1, - "id2": 2 - }, - "writeConcern": { - "w": "majority" - } - }, - "tests": [ - { - "description": "client bulkWrite comment", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 3, - "x": 33 - } - } - } - ], - "comment": { - "bulk": "write" - }, - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 3 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "comment": { - "bulk": "write" - }, - "ops": [ - { - "insert": 0, - "document": { - "_id": 3, - "x": 33 - } - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "client bulkWrite bypassDocumentValidation", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 3, - "x": 33 - } - } - } - ], - "bypassDocumentValidation": true, - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 3 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "bypassDocumentValidation": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 3, - "x": 33 - } - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "client bulkWrite let", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "updateOne": { - "namespace": "crud-tests.coll0", - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id1" - ] - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id2" - ] - } - } - } - } - ], - "let": { - "id1": 1, - "id2": 2 - }, - "verboseResults": true - }, - "expectResult": { - "insertedCount": 0, - "upsertedCount": 0, - "matchedCount": 1, - "modifiedCount": 1, - "deletedCount": 1, - "insertResults": {}, - "updateResults": { - "0": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - } - }, - "deleteResults": { - "1": { - "deletedCount": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "let": { - "id1": 1, - "id2": 2 - }, - "ops": [ - { - "update": 0, - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id1" - ] - } - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id2" - ] - } - }, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "databaseName": "crud-tests", - "collectionName": "coll0", - "documents": [ - { - "_id": 1, - "x": 12 - } - ] - } - ] - }, - { - "description": "client bulkWrite bypassDocumentValidation: false is sent", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 3, - "x": 33 - } - } - } - ], - "bypassDocumentValidation": false, - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 3 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "bypassDocumentValidation": false, - "ops": [ - { - "insert": 0, - "document": { - "_id": 3, - "x": 33 - } - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "client bulkWrite writeConcern", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 3, - "x": 33 - } - } - } - ], - "writeConcern": { - "w": "majority" - }, - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 3 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "writeConcern": { - "w": "majority" - }, - "ops": [ - { - "insert": 0, - "document": { - "_id": 3, - "x": 33 - } - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ] - }, - { - "description": "client bulkWrite inherits writeConcern from client", - "operations": [ - { - "object": "writeConcernClient", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 3, - "x": 33 - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 3 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "writeConcernClient", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "writeConcern": { - "w": 1 - }, - "ops": [ - { - "insert": 0, - "document": { - "_id": 3, - "x": 33 - } - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ] - }, - { - "description": "client bulkWrite writeConcern option overrides client writeConcern", - "operations": [ - { - "object": "writeConcernClient", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 3, - "x": 33 - } - } - } - ], - "writeConcern": { - "w": "majority" - }, - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 3 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "writeConcernClient", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "writeConcern": { - "w": "majority" - }, - "ops": [ - { - "insert": 0, - "document": { - "_id": 3, - "x": 33 - } - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-ordered.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-ordered.json deleted file mode 100644 index 6fb10d992f0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-ordered.json +++ /dev/null @@ -1,291 +0,0 @@ -{ - "description": "client bulkWrite with ordered option", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [] - } - ], - "_yamlAnchors": { - "namespace": "crud-tests.coll0" - }, - "tests": [ - { - "description": "client bulkWrite with ordered: false", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - } - ], - "verboseResults": true, - "ordered": false - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 1 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": false, - "ops": [ - { - "insert": 0, - "document": { - "_id": 1, - "x": 11 - } - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "client bulkWrite with ordered: true", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - } - ], - "verboseResults": true, - "ordered": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 1 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 1, - "x": 11 - } - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "client bulkWrite defaults to ordered: true", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 1 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 1, - "x": 11 - } - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-partialResults.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-partialResults.json deleted file mode 100644 index b35e94a2ea2..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-partialResults.json +++ /dev/null @@ -1,540 +0,0 @@ -{ - "description": "client bulkWrite partial results", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "crud-tests.coll0", - "newDocument": { - "_id": 2, - "x": 22 - } - }, - "tests": [ - { - "description": "partialResult is unset when first operation fails during an ordered bulk write (verbose)", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - }, - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "ordered": true, - "verboseResults": true - }, - "expectError": { - "expectResult": { - "$$unsetOrMatches": { - "insertedCount": { - "$$exists": false - }, - "upsertedCount": { - "$$exists": false - }, - "matchedCount": { - "$$exists": false - }, - "modifiedCount": { - "$$exists": false - }, - "deletedCount": { - "$$exists": false - }, - "insertResults": { - "$$exists": false - }, - "updateResults": { - "$$exists": false - }, - "deleteResults": { - "$$exists": false - } - } - } - } - } - ] - }, - { - "description": "partialResult is unset when first operation fails during an ordered bulk write (summary)", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - }, - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "ordered": true, - "verboseResults": false - }, - "expectError": { - "expectResult": { - "$$unsetOrMatches": { - "insertedCount": { - "$$exists": false - }, - "upsertedCount": { - "$$exists": false - }, - "matchedCount": { - "$$exists": false - }, - "modifiedCount": { - "$$exists": false - }, - "deletedCount": { - "$$exists": false - }, - "insertResults": { - "$$exists": false - }, - "updateResults": { - "$$exists": false - }, - "deleteResults": { - "$$exists": false - } - } - } - } - } - ] - }, - { - "description": "partialResult is set when second operation fails during an ordered bulk write (verbose)", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - } - ], - "ordered": true, - "verboseResults": true - }, - "expectError": { - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 2 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - } - ] - }, - { - "description": "partialResult is set when second operation fails during an ordered bulk write (summary)", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - } - ], - "ordered": true, - "verboseResults": false - }, - "expectError": { - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "$$unsetOrMatches": {} - }, - "updateResults": { - "$$unsetOrMatches": {} - }, - "deleteResults": { - "$$unsetOrMatches": {} - } - } - } - } - ] - }, - { - "description": "partialResult is unset when all operations fail during an unordered bulk write", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - }, - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - } - ], - "ordered": false - }, - "expectError": { - "expectResult": { - "$$unsetOrMatches": { - "insertedCount": { - "$$exists": false - }, - "upsertedCount": { - "$$exists": false - }, - "matchedCount": { - "$$exists": false - }, - "modifiedCount": { - "$$exists": false - }, - "deletedCount": { - "$$exists": false - }, - "insertResults": { - "$$exists": false - }, - "updateResults": { - "$$exists": false - }, - "deleteResults": { - "$$exists": false - } - } - } - } - } - ] - }, - { - "description": "partialResult is set when first operation fails during an unordered bulk write (verbose)", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - }, - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "ordered": false, - "verboseResults": true - }, - "expectError": { - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "1": { - "insertedId": 2 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - } - ] - }, - { - "description": "partialResult is set when first operation fails during an unordered bulk write (summary)", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - }, - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "ordered": false, - "verboseResults": false - }, - "expectError": { - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "$$unsetOrMatches": {} - }, - "updateResults": { - "$$unsetOrMatches": {} - }, - "deleteResults": { - "$$unsetOrMatches": {} - } - } - } - } - ] - }, - { - "description": "partialResult is set when second operation fails during an unordered bulk write (verbose)", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - } - ], - "ordered": false, - "verboseResults": true - }, - "expectError": { - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 2 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - } - ] - }, - { - "description": "partialResult is set when first operation fails during an unordered bulk write (summary)", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 1, - "x": 11 - } - } - } - ], - "ordered": false, - "verboseResults": false - }, - "expectError": { - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "$$unsetOrMatches": {} - }, - "updateResults": { - "$$unsetOrMatches": {} - }, - "deleteResults": { - "$$unsetOrMatches": {} - } - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-replaceOne-sort.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-replaceOne-sort.json deleted file mode 100644 index b86bc5f9429..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-replaceOne-sort.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "description": "client bulkWrite updateOne-sort", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "crud-tests.coll0" - }, - "tests": [ - { - "description": "client bulkWrite replaceOne with sort option", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "replaceOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": { - "$gt": 1 - } - }, - "sort": { - "_id": -1 - }, - "replacement": { - "x": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "ops": [ - { - "update": 0, - "filter": { - "_id": { - "$gt": 1 - } - }, - "updateMods": { - "x": 1 - }, - "sort": { - "_id": -1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "nErrors": 0, - "nMatched": 1, - "nModified": 1 - }, - "commandName": "bulkWrite" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-results.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-results.json deleted file mode 100644 index accf5a9cbf5..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-results.json +++ /dev/null @@ -1,833 +0,0 @@ -{ - "description": "client bulkWrite results", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - }, - { - "_id": 7, - "x": 77 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "crud-tests.coll0" - }, - "tests": [ - { - "description": "client bulkWrite with verboseResults: true returns detailed results", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 8, - "x": 88 - } - } - }, - { - "updateOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "updateMany": { - "namespace": "crud-tests.coll0", - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "update": { - "$inc": { - "x": 2 - } - } - } - }, - { - "replaceOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "upsert": true - } - }, - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 5 - } - } - }, - { - "deleteMany": { - "namespace": "crud-tests.coll0", - "filter": { - "$and": [ - { - "_id": { - "$gt": 5 - } - }, - { - "_id": { - "$lte": 7 - } - } - ] - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 1, - "matchedCount": 3, - "modifiedCount": 3, - "deletedCount": 3, - "insertResults": { - "0": { - "insertedId": 8 - } - }, - "updateResults": { - "1": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - }, - "2": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedId": { - "$$exists": false - } - }, - "3": { - "matchedCount": 1, - "modifiedCount": 0, - "upsertedId": 4 - } - }, - "deleteResults": { - "4": { - "deletedCount": 1 - }, - "5": { - "deletedCount": 2 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 8, - "x": 88 - } - }, - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "update": 0, - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "updateMods": { - "$inc": { - "x": 2 - } - }, - "multi": true - }, - { - "update": 0, - "filter": { - "_id": 4 - }, - "updateMods": { - "x": 44 - }, - "upsert": true, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": 5 - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "$and": [ - { - "_id": { - "$gt": 5 - } - }, - { - "_id": { - "$lte": 7 - } - } - ] - }, - "multi": true - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 24 - }, - { - "_id": 3, - "x": 35 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 8, - "x": 88 - } - ] - } - ] - }, - { - "description": "client bulkWrite with verboseResults: false omits detailed results", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 8, - "x": 88 - } - } - }, - { - "updateOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "updateMany": { - "namespace": "crud-tests.coll0", - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "update": { - "$inc": { - "x": 2 - } - } - } - }, - { - "replaceOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "upsert": true - } - }, - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 5 - } - } - }, - { - "deleteMany": { - "namespace": "crud-tests.coll0", - "filter": { - "$and": [ - { - "_id": { - "$gt": 5 - } - }, - { - "_id": { - "$lte": 7 - } - } - ] - } - } - } - ], - "verboseResults": false - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 1, - "matchedCount": 3, - "modifiedCount": 3, - "deletedCount": 3, - "insertResults": { - "$$unsetOrMatches": {} - }, - "updateResults": { - "$$unsetOrMatches": {} - }, - "deleteResults": { - "$$unsetOrMatches": {} - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": true, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 8, - "x": 88 - } - }, - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "update": 0, - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "updateMods": { - "$inc": { - "x": 2 - } - }, - "multi": true - }, - { - "update": 0, - "filter": { - "_id": 4 - }, - "updateMods": { - "x": 44 - }, - "upsert": true, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": 5 - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "$and": [ - { - "_id": { - "$gt": 5 - } - }, - { - "_id": { - "$lte": 7 - } - } - ] - }, - "multi": true - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 24 - }, - { - "_id": 3, - "x": 35 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 8, - "x": 88 - } - ] - } - ] - }, - { - "description": "client bulkWrite defaults to verboseResults: false", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "crud-tests.coll0", - "document": { - "_id": 8, - "x": 88 - } - } - }, - { - "updateOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "updateMany": { - "namespace": "crud-tests.coll0", - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "update": { - "$inc": { - "x": 2 - } - } - } - }, - { - "replaceOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "upsert": true - } - }, - { - "deleteOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 5 - } - } - }, - { - "deleteMany": { - "namespace": "crud-tests.coll0", - "filter": { - "$and": [ - { - "_id": { - "$gt": 5 - } - }, - { - "_id": { - "$lte": 7 - } - } - ] - } - } - } - ] - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 1, - "matchedCount": 3, - "modifiedCount": 3, - "deletedCount": 3, - "insertResults": { - "$$unsetOrMatches": {} - }, - "updateResults": { - "$$unsetOrMatches": {} - }, - "deleteResults": { - "$$unsetOrMatches": {} - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": true, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 8, - "x": 88 - } - }, - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "update": 0, - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "updateMods": { - "$inc": { - "x": 2 - } - }, - "multi": true - }, - { - "update": 0, - "filter": { - "_id": 4 - }, - "updateMods": { - "x": 44 - }, - "upsert": true, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": 5 - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "$and": [ - { - "_id": { - "$gt": 5 - } - }, - { - "_id": { - "$lte": 7 - } - } - ] - }, - "multi": true - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 24 - }, - { - "_id": 3, - "x": 35 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 8, - "x": 88 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-update-options.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-update-options.json deleted file mode 100644 index ce6241c6812..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-update-options.json +++ /dev/null @@ -1,949 +0,0 @@ -{ - "description": "client bulkWrite update options", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "array": [ - 1, - 2, - 3 - ] - }, - { - "_id": 2, - "array": [ - 1, - 2, - 3 - ] - }, - { - "_id": 3, - "array": [ - 1, - 2, - 3 - ] - }, - { - "_id": 4, - "array": [ - 1, - 2, - 3 - ] - } - ] - } - ], - "_yamlAnchors": { - "namespace": "crud-tests.coll0", - "collation": { - "locale": "simple" - }, - "hint": "_id_" - }, - "tests": [ - { - "description": "client bulkWrite update with arrayFilters", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "updateOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "array.$[i]": 4 - } - }, - "arrayFilters": [ - { - "i": { - "$gte": 2 - } - } - ] - } - }, - { - "updateMany": { - "namespace": "crud-tests.coll0", - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "update": { - "$set": { - "array.$[i]": 5 - } - }, - "arrayFilters": [ - { - "i": { - "$gte": 2 - } - } - ] - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 0, - "upsertedCount": 0, - "matchedCount": 3, - "modifiedCount": 3, - "deletedCount": 0, - "insertResults": {}, - "updateResults": { - "0": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - }, - "1": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedId": { - "$$exists": false - } - } - }, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$set": { - "array.$[i]": 4 - } - }, - "arrayFilters": [ - { - "i": { - "$gte": 2 - } - } - ], - "multi": false - }, - { - "update": 0, - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "updateMods": { - "$set": { - "array.$[i]": 5 - } - }, - "arrayFilters": [ - { - "i": { - "$gte": 2 - } - } - ], - "multi": true - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "databaseName": "crud-tests", - "collectionName": "coll0", - "documents": [ - { - "_id": 1, - "array": [ - 1, - 4, - 4 - ] - }, - { - "_id": 2, - "array": [ - 1, - 5, - 5 - ] - }, - { - "_id": 3, - "array": [ - 1, - 5, - 5 - ] - }, - { - "_id": 4, - "array": [ - 1, - 2, - 3 - ] - } - ] - } - ] - }, - { - "description": "client bulkWrite update with collation", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "updateOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "array": [ - 1, - 2, - 4 - ] - } - }, - "collation": { - "locale": "simple" - } - } - }, - { - "updateMany": { - "namespace": "crud-tests.coll0", - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "update": { - "$set": { - "array": [ - 1, - 2, - 5 - ] - } - }, - "collation": { - "locale": "simple" - } - } - }, - { - "replaceOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 4 - }, - "replacement": { - "array": [ - 1, - 2, - 6 - ] - }, - "collation": { - "locale": "simple" - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 0, - "upsertedCount": 0, - "matchedCount": 4, - "modifiedCount": 4, - "deletedCount": 0, - "insertResults": {}, - "updateResults": { - "0": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - }, - "1": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedId": { - "$$exists": false - } - }, - "2": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - } - }, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$set": { - "array": [ - 1, - 2, - 4 - ] - } - }, - "collation": { - "locale": "simple" - }, - "multi": false - }, - { - "update": 0, - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "updateMods": { - "$set": { - "array": [ - 1, - 2, - 5 - ] - } - }, - "collation": { - "locale": "simple" - }, - "multi": true - }, - { - "update": 0, - "filter": { - "_id": 4 - }, - "updateMods": { - "array": [ - 1, - 2, - 6 - ] - }, - "collation": { - "locale": "simple" - }, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "databaseName": "crud-tests", - "collectionName": "coll0", - "documents": [ - { - "_id": 1, - "array": [ - 1, - 2, - 4 - ] - }, - { - "_id": 2, - "array": [ - 1, - 2, - 5 - ] - }, - { - "_id": 3, - "array": [ - 1, - 2, - 5 - ] - }, - { - "_id": 4, - "array": [ - 1, - 2, - 6 - ] - } - ] - } - ] - }, - { - "description": "client bulkWrite update with hint", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "updateOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "array": [ - 1, - 2, - 4 - ] - } - }, - "hint": "_id_" - } - }, - { - "updateMany": { - "namespace": "crud-tests.coll0", - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "update": { - "$set": { - "array": [ - 1, - 2, - 5 - ] - } - }, - "hint": "_id_" - } - }, - { - "replaceOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 4 - }, - "replacement": { - "array": [ - 1, - 2, - 6 - ] - }, - "hint": "_id_" - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 0, - "upsertedCount": 0, - "matchedCount": 4, - "modifiedCount": 4, - "deletedCount": 0, - "insertResults": {}, - "updateResults": { - "0": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - }, - "1": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedId": { - "$$exists": false - } - }, - "2": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - } - }, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$set": { - "array": [ - 1, - 2, - 4 - ] - } - }, - "hint": "_id_", - "multi": false - }, - { - "update": 0, - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "updateMods": { - "$set": { - "array": [ - 1, - 2, - 5 - ] - } - }, - "hint": "_id_", - "multi": true - }, - { - "update": 0, - "filter": { - "_id": 4 - }, - "updateMods": { - "array": [ - 1, - 2, - 6 - ] - }, - "hint": "_id_", - "multi": false - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "databaseName": "crud-tests", - "collectionName": "coll0", - "documents": [ - { - "_id": 1, - "array": [ - 1, - 2, - 4 - ] - }, - { - "_id": 2, - "array": [ - 1, - 2, - 5 - ] - }, - { - "_id": 3, - "array": [ - 1, - 2, - 5 - ] - }, - { - "_id": 4, - "array": [ - 1, - 2, - 6 - ] - } - ] - } - ] - }, - { - "description": "client bulkWrite update with upsert", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "updateOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 5 - }, - "update": { - "$set": { - "array": [ - 1, - 2, - 4 - ] - } - }, - "upsert": true - } - }, - { - "replaceOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 6 - }, - "replacement": { - "array": [ - 1, - 2, - 6 - ] - }, - "upsert": true - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 0, - "upsertedCount": 2, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": {}, - "updateResults": { - "0": { - "matchedCount": 1, - "modifiedCount": 0, - "upsertedId": 5 - }, - "1": { - "matchedCount": 1, - "modifiedCount": 0, - "upsertedId": 6 - } - }, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "update": 0, - "filter": { - "_id": 5 - }, - "updateMods": { - "$set": { - "array": [ - 1, - 2, - 4 - ] - } - }, - "upsert": true, - "multi": false - }, - { - "update": 0, - "filter": { - "_id": 6 - }, - "updateMods": { - "array": [ - 1, - 2, - 6 - ] - }, - "upsert": true, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "databaseName": "crud-tests", - "collectionName": "coll0", - "documents": [ - { - "_id": 1, - "array": [ - 1, - 2, - 3 - ] - }, - { - "_id": 2, - "array": [ - 1, - 2, - 3 - ] - }, - { - "_id": 3, - "array": [ - 1, - 2, - 3 - ] - }, - { - "_id": 4, - "array": [ - 1, - 2, - 3 - ] - }, - { - "_id": 5, - "array": [ - 1, - 2, - 4 - ] - }, - { - "_id": 6, - "array": [ - 1, - 2, - 6 - ] - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-update-pipeline.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-update-pipeline.json deleted file mode 100644 index 9dba5ee6c57..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-update-pipeline.json +++ /dev/null @@ -1,258 +0,0 @@ -{ - "description": "client bulkWrite update pipeline", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 1 - }, - { - "_id": 2, - "x": 2 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "crud-tests.coll0" - }, - "tests": [ - { - "description": "client bulkWrite updateOne with pipeline", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "updateOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - }, - "update": [ - { - "$addFields": { - "foo": 1 - } - } - ] - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 0, - "upsertedCount": 0, - "matchedCount": 1, - "modifiedCount": 1, - "deletedCount": 0, - "insertResults": {}, - "updateResults": { - "0": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - } - }, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": [ - { - "$addFields": { - "foo": 1 - } - } - ], - "multi": false - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "databaseName": "crud-tests", - "collectionName": "coll0", - "documents": [ - { - "_id": 1, - "x": 1, - "foo": 1 - }, - { - "_id": 2, - "x": 2 - } - ] - } - ] - }, - { - "description": "client bulkWrite updateMany with pipeline", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "updateMany": { - "namespace": "crud-tests.coll0", - "filter": {}, - "update": [ - { - "$addFields": { - "foo": 1 - } - } - ] - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 0, - "upsertedCount": 0, - "matchedCount": 2, - "modifiedCount": 2, - "deletedCount": 0, - "insertResults": {}, - "updateResults": { - "0": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedId": { - "$$exists": false - } - } - }, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "update": 0, - "filter": {}, - "updateMods": [ - { - "$addFields": { - "foo": 1 - } - } - ], - "multi": true - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "databaseName": "crud-tests", - "collectionName": "coll0", - "documents": [ - { - "_id": 1, - "x": 1, - "foo": 1 - }, - { - "_id": 2, - "x": 2, - "foo": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-update-validation.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-update-validation.json deleted file mode 100644 index 617e711338a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-update-validation.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "description": "client-bulkWrite-update-validation", - "schemaVersion": "1.1", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "crud-tests.coll0" - }, - "tests": [ - { - "description": "client bulkWrite replaceOne prohibits atomic modifiers", - "operations": [ - { - "name": "clientBulkWrite", - "object": "client0", - "arguments": { - "models": [ - { - "replaceOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - }, - "replacement": { - "$set": { - "x": 22 - } - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "client bulkWrite updateOne requires atomic modifiers", - "operations": [ - { - "name": "clientBulkWrite", - "object": "client0", - "arguments": { - "models": [ - { - "updateOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "x": 22 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "client bulkWrite updateMany requires atomic modifiers", - "operations": [ - { - "name": "clientBulkWrite", - "object": "client0", - "arguments": { - "models": [ - { - "updateMany": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "x": 44 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-updateOne-sort.json b/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-updateOne-sort.json deleted file mode 100644 index ef75dcb3741..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/client-bulkWrite-updateOne-sort.json +++ /dev/null @@ -1,167 +0,0 @@ -{ - "description": "client bulkWrite updateOne-sort", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "crud-tests.coll0" - }, - "tests": [ - { - "description": "client bulkWrite updateOne with sort option", - "operations": [ - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "updateOne": { - "namespace": "crud-tests.coll0", - "filter": { - "_id": { - "$gt": 1 - } - }, - "sort": { - "_id": -1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "ops": [ - { - "update": 0, - "filter": { - "_id": { - "$gt": 1 - } - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "sort": { - "_id": -1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "nsInfo": [ - { - "ns": "crud-tests.coll0" - } - ] - } - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "nErrors": 0, - "nMatched": 1, - "nModified": 1 - }, - "commandName": "bulkWrite" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 34 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/count-collation.json b/driver-core/src/test/resources/unified-test-format/crud/count-collation.json deleted file mode 100644 index eef65e08804..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/count-collation.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "description": "count-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": "ping" - } - ] - } - ], - "tests": [ - { - "description": "Count documents with collation", - "operations": [ - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "x": "ping" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": 1 - } - ] - }, - { - "description": "Deprecated count with collation", - "operations": [ - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": { - "x": "ping" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": 1 - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/count-empty.json b/driver-core/src/test/resources/unified-test-format/crud/count-empty.json deleted file mode 100644 index 29d8d76f67c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/count-empty.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "description": "count-empty", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [] - } - ], - "tests": [ - { - "description": "Estimated document count with empty collection", - "operations": [ - { - "object": "collection0", - "name": "estimatedDocumentCount", - "arguments": {}, - "expectResult": 0 - } - ] - }, - { - "description": "Count documents with empty collection", - "operations": [ - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 0 - } - ] - }, - { - "description": "Deprecated count with empty collection", - "operations": [ - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 0 - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/count.json b/driver-core/src/test/resources/unified-test-format/crud/count.json deleted file mode 100644 index 80fff5a30c6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/count.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "description": "count", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Estimated document count", - "operations": [ - { - "object": "collection0", - "name": "estimatedDocumentCount", - "arguments": {}, - "expectResult": 3 - } - ] - }, - { - "description": "Count documents without a filter", - "operations": [ - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 3 - } - ] - }, - { - "description": "Count documents with a filter", - "operations": [ - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": 2 - } - ] - }, - { - "description": "Count documents with skip and limit", - "operations": [ - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {}, - "skip": 1, - "limit": 3 - }, - "expectResult": 2 - } - ] - }, - { - "description": "Deprecated count without a filter", - "operations": [ - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 3 - } - ] - }, - { - "description": "Deprecated count with a filter", - "operations": [ - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": 2 - } - ] - }, - { - "description": "Deprecated count with skip and limit", - "operations": [ - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {}, - "skip": 1, - "limit": 3 - }, - "expectResult": 2 - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/countDocuments-comment.json b/driver-core/src/test/resources/unified-test-format/crud/countDocuments-comment.json deleted file mode 100644 index e6c7ae81709..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/countDocuments-comment.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "description": "countDocuments-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "countDocuments-comments-test" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "countDocuments-comments-test", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "countDocuments with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "filter": {}, - "comment": { - "key": "value" - } - }, - "expectResult": 3 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ], - "comment": { - "key": "value" - } - }, - "commandName": "aggregate", - "databaseName": "countDocuments-comments-test" - } - } - ] - } - ] - }, - { - "description": "countDocuments with string comment", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0" - } - ], - "operations": [ - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "filter": {}, - "comment": "comment" - }, - "expectResult": 3 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ], - "comment": "comment" - }, - "commandName": "aggregate", - "databaseName": "countDocuments-comments-test" - } - } - ] - } - ] - }, - { - "description": "countDocuments with document comment on less than 4.4.0 - server error", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "maxServerVersion": "4.3.99" - } - ], - "operations": [ - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "filter": {}, - "comment": { - "key": "value" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ], - "comment": { - "key": "value" - } - }, - "commandName": "aggregate", - "databaseName": "countDocuments-comments-test" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/db-aggregate-write-readPreference.json b/driver-core/src/test/resources/unified-test-format/crud/db-aggregate-write-readPreference.json deleted file mode 100644 index b6460f001f2..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/db-aggregate-write-readPreference.json +++ /dev/null @@ -1,395 +0,0 @@ -{ - "description": "db-aggregate-write-readPreference", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ], - "serverless": "forbid" - } - ], - "_yamlAnchors": { - "readConcern": { - "level": "local" - }, - "writeConcern": { - "w": 1 - } - }, - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "uriOptions": { - "readConcernLevel": "local", - "w": 1 - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0", - "databaseOptions": { - "readPreference": { - "mode": "secondaryPreferred", - "maxStalenessSeconds": 600 - } - } - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "tests": [ - { - "description": "Database-level aggregate with $out includes read preference for 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0", - "serverless": "forbid" - } - ], - "operations": [ - { - "object": "database0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - }, - { - "$addFields": { - "_id": 1 - } - }, - { - "$project": { - "_id": 1 - } - }, - { - "$out": "coll0" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - }, - { - "$addFields": { - "_id": 1 - } - }, - { - "$project": { - "_id": 1 - } - }, - { - "$out": "coll0" - } - ], - "$readPreference": { - "mode": "secondaryPreferred", - "maxStalenessSeconds": 600 - }, - "readConcern": { - "level": "local" - }, - "writeConcern": { - "w": 1 - } - } - } - } - ] - } - ] - }, - { - "description": "Database-level aggregate with $out omits read preference for pre-5.0 server", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.4.99", - "serverless": "forbid" - } - ], - "operations": [ - { - "object": "database0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - }, - { - "$addFields": { - "_id": 1 - } - }, - { - "$project": { - "_id": 1 - } - }, - { - "$out": "coll0" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - }, - { - "$addFields": { - "_id": 1 - } - }, - { - "$project": { - "_id": 1 - } - }, - { - "$out": "coll0" - } - ], - "$readPreference": { - "$$exists": false - }, - "readConcern": { - "level": "local" - }, - "writeConcern": { - "w": 1 - } - } - } - } - ] - } - ] - }, - { - "description": "Database-level aggregate with $merge includes read preference for 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "object": "database0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - }, - { - "$addFields": { - "_id": 1 - } - }, - { - "$project": { - "_id": 1 - } - }, - { - "$merge": { - "into": "coll0" - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - }, - { - "$addFields": { - "_id": 1 - } - }, - { - "$project": { - "_id": 1 - } - }, - { - "$merge": { - "into": "coll0" - } - } - ], - "$readPreference": { - "mode": "secondaryPreferred", - "maxStalenessSeconds": 600 - }, - "readConcern": { - "level": "local" - }, - "writeConcern": { - "w": 1 - } - } - } - } - ] - } - ] - }, - { - "description": "Database-level aggregate with $merge omits read preference for pre-5.0 server", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "object": "database0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - }, - { - "$addFields": { - "_id": 1 - } - }, - { - "$project": { - "_id": 1 - } - }, - { - "$merge": { - "into": "coll0" - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - }, - { - "$addFields": { - "_id": 1 - } - }, - { - "$project": { - "_id": 1 - } - }, - { - "$merge": { - "into": "coll0" - } - } - ], - "$readPreference": { - "$$exists": false - }, - "readConcern": { - "level": "local" - }, - "writeConcern": { - "w": 1 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/db-aggregate.json b/driver-core/src/test/resources/unified-test-format/crud/db-aggregate.json deleted file mode 100644 index 5015405bfca..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/db-aggregate.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "description": "db-aggregate", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "admin" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "crud-v2" - } - } - ], - "tests": [ - { - "description": "Aggregate with $listLocalSessions", - "operations": [ - { - "object": "database0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - }, - { - "$addFields": { - "dummy": "dummy field" - } - }, - { - "$project": { - "_id": 0, - "dummy": 1 - } - } - ] - }, - "expectResult": [ - { - "dummy": "dummy field" - } - ] - } - ] - }, - { - "description": "Aggregate with $listLocalSessions and allowDiskUse", - "operations": [ - { - "object": "database0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - }, - { - "$addFields": { - "dummy": "dummy field" - } - }, - { - "$project": { - "_id": 0, - "dummy": 1 - } - } - ], - "allowDiskUse": true - }, - "expectResult": [ - { - "dummy": "dummy field" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-collation.json b/driver-core/src/test/resources/unified-test-format/crud/deleteMany-collation.json deleted file mode 100644 index 23d2f037cbe..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-collation.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "description": "deleteMany-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - }, - { - "_id": 3, - "x": "pINg" - } - ] - } - ], - "tests": [ - { - "description": "DeleteMany when many documents match with collation", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "x": "PING" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": { - "deletedCount": 2 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-comment.json b/driver-core/src/test/resources/unified-test-format/crud/deleteMany-comment.json deleted file mode 100644 index 6abc5fd58a3..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-comment.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "description": "deleteMany-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2, - "name": "name2" - }, - { - "_id": 3, - "name": "name3" - } - ] - } - ], - "tests": [ - { - "description": "deleteMany with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "deleteMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "comment": "comment" - }, - "expectResult": { - "deletedCount": 2 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "limit": 0 - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "deleteMany with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "deleteMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "comment": { - "key": "value" - } - }, - "expectResult": { - "deletedCount": 2 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "limit": 0 - } - ], - "comment": { - "key": "value" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "deleteMany with comment - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "deleteMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "comment": "comment" - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "limit": 0 - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2, - "name": "name2" - }, - { - "_id": 3, - "name": "name3" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-hint-clientError.json b/driver-core/src/test/resources/unified-test-format/crud/deleteMany-hint-clientError.json deleted file mode 100644 index 66320122b5b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-hint-clientError.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "description": "deleteMany-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.3.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "DeleteMany_hint" - } - } - ], - "initialData": [ - { - "collectionName": "DeleteMany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "DeleteMany with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "DeleteMany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "DeleteMany with hint document unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "DeleteMany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-hint-serverError.json b/driver-core/src/test/resources/unified-test-format/crud/deleteMany-hint-serverError.json deleted file mode 100644 index 88d4a655769..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-hint-serverError.json +++ /dev/null @@ -1,190 +0,0 @@ -{ - "description": "deleteMany-hint-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.3.3" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "DeleteMany_hint" - } - } - ], - "initialData": [ - { - "collectionName": "DeleteMany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "DeleteMany with hint string unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "DeleteMany_hint", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_", - "limit": 0 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "DeleteMany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "DeleteMany with hint document unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "DeleteMany_hint", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - }, - "limit": 0 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "DeleteMany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/deleteMany-hint-unacknowledged.json deleted file mode 100644 index ab7e9c7c094..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-hint-unacknowledged.json +++ /dev/null @@ -1,245 +0,0 @@ -{ - "description": "deleteMany-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged deleteMany with hint string fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged deleteMany with hint document fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged deleteMany with hint string on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "limit": 0 - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged deleteMany with hint document on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "limit": 0 - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-hint.json b/driver-core/src/test/resources/unified-test-format/crud/deleteMany-hint.json deleted file mode 100644 index 59d903d201f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-hint.json +++ /dev/null @@ -1,173 +0,0 @@ -{ - "description": "deleteMany-hint", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.3.4" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "DeleteMany_hint" - } - } - ], - "initialData": [ - { - "collectionName": "DeleteMany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "DeleteMany with hint string", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - }, - "expectResult": { - "deletedCount": 2 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "DeleteMany_hint", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_", - "limit": 0 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "DeleteMany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "DeleteMany with hint document", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 2 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "DeleteMany_hint", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - }, - "limit": 0 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "DeleteMany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-let.json b/driver-core/src/test/resources/unified-test-format/crud/deleteMany-let.json deleted file mode 100644 index 71bf26a013f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteMany-let.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "description": "deleteMany-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2, - "name": "name" - }, - { - "_id": 3, - "name": "name" - } - ] - } - ], - "tests": [ - { - "description": "deleteMany with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "deleteMany", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$name", - "$$name" - ] - } - }, - "let": { - "name": "name" - } - }, - "expectResult": { - "deletedCount": 2 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "$expr": { - "$eq": [ - "$name", - "$$name" - ] - } - }, - "limit": 0 - } - ], - "let": { - "name": "name" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "deleteMany with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "name": "deleteMany", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$name", - "$$name" - ] - } - }, - "let": { - "name": "name" - } - }, - "expectError": { - "errorContains": "'delete.let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "$expr": { - "$eq": [ - "$name", - "$$name" - ] - } - }, - "limit": 0 - } - ], - "let": { - "name": "name" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2, - "name": "name" - }, - { - "_id": 3, - "name": "name" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteMany.json b/driver-core/src/test/resources/unified-test-format/crud/deleteMany.json deleted file mode 100644 index 36cdff8dc01..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteMany.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "description": "deleteMany", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "DeleteMany when many documents match", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": { - "deletedCount": 2 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "DeleteMany when no document matches", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": { - "_id": 4 - } - }, - "expectResult": { - "deletedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-collation.json b/driver-core/src/test/resources/unified-test-format/crud/deleteOne-collation.json deleted file mode 100644 index 44bab6e120f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-collation.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "description": "deleteOne-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - }, - { - "_id": 3, - "x": "pINg" - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne when many documents matches with collation", - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "x": "PING" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 3, - "x": "pINg" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-comment.json b/driver-core/src/test/resources/unified-test-format/crud/deleteOne-comment.json deleted file mode 100644 index 0f42b086a30..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-comment.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "description": "deleteOne-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2, - "name": "name" - }, - { - "_id": 3, - "name": "name" - } - ] - } - ], - "tests": [ - { - "description": "deleteOne with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "deleteOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "comment": "comment" - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": 1 - }, - "limit": 1 - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 2, - "name": "name" - }, - { - "_id": 3, - "name": "name" - } - ] - } - ] - }, - { - "description": "deleteOne with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "deleteOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "comment": { - "key": "value" - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": 1 - }, - "limit": 1 - } - ], - "comment": { - "key": "value" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 2, - "name": "name" - }, - { - "_id": 3, - "name": "name" - } - ] - } - ] - }, - { - "description": "deleteOne with comment - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "deleteOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "comment": "comment" - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": 1 - }, - "limit": 1 - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2, - "name": "name" - }, - { - "_id": 3, - "name": "name" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-errorResponse.json b/driver-core/src/test/resources/unified-test-format/crud/deleteOne-errorResponse.json deleted file mode 100644 index 1f3a266f1ef..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-errorResponse.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "description": "deleteOne-errorResponse", - "schemaVersion": "1.12", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "tests": [ - { - "description": "delete operations support errorResponse assertions", - "runOnRequirements": [ - { - "minServerVersion": "4.0.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.2.0", - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 8 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorCode": 8, - "errorResponse": { - "code": 8 - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-hint-clientError.json b/driver-core/src/test/resources/unified-test-format/crud/deleteOne-hint-clientError.json deleted file mode 100644 index cf629f59e03..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-hint-clientError.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "description": "deleteOne-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.3.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "DeleteOne_hint" - } - } - ], - "initialData": [ - { - "collectionName": "DeleteOne_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "DeleteOne_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne with hint document unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "DeleteOne_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-hint-serverError.json b/driver-core/src/test/resources/unified-test-format/crud/deleteOne-hint-serverError.json deleted file mode 100644 index 15541ed857b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-hint-serverError.json +++ /dev/null @@ -1,170 +0,0 @@ -{ - "description": "deleteOne-hint-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.3.3" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "DeleteOne_hint" - } - } - ], - "initialData": [ - { - "collectionName": "DeleteOne_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne with hint string unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "DeleteOne_hint", - "deletes": [ - { - "q": { - "_id": 1 - }, - "hint": "_id_", - "limit": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "DeleteOne_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne with hint document unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "DeleteOne_hint", - "deletes": [ - { - "q": { - "_id": 1 - }, - "hint": { - "_id": 1 - }, - "limit": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "DeleteOne_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/deleteOne-hint-unacknowledged.json deleted file mode 100644 index 1782f0f5251..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-hint-unacknowledged.json +++ /dev/null @@ -1,241 +0,0 @@ -{ - "description": "deleteOne-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged deleteOne with hint string fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged deleteOne with hint document fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged deleteOne with hint string on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "limit": 1 - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged deleteOne with hint document on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "limit": 1 - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-hint.json b/driver-core/src/test/resources/unified-test-format/crud/deleteOne-hint.json deleted file mode 100644 index bcc4bc2347a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-hint.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "description": "deleteOne-hint", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.3.4" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "DeleteOne_hint" - } - } - ], - "initialData": [ - { - "collectionName": "DeleteOne_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne with hint string", - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": "_id_" - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "DeleteOne_hint", - "deletes": [ - { - "q": { - "_id": 1 - }, - "hint": "_id_", - "limit": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "DeleteOne_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "deleteOne with hint document", - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "DeleteOne_hint", - "deletes": [ - { - "q": { - "_id": 1 - }, - "hint": { - "_id": 1 - }, - "limit": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "DeleteOne_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-let.json b/driver-core/src/test/resources/unified-test-format/crud/deleteOne-let.json deleted file mode 100644 index 9718682235d..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteOne-let.json +++ /dev/null @@ -1,191 +0,0 @@ -{ - "description": "deleteOne-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "deleteOne with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "deleteOne", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "let": { - "id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "limit": 1 - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "deleteOne with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "name": "deleteOne", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "let": { - "id": 1 - } - }, - "expectError": { - "errorContains": "'delete.let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll0", - "deletes": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "limit": 1 - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/deleteOne.json b/driver-core/src/test/resources/unified-test-format/crud/deleteOne.json deleted file mode 100644 index 8177b2fb6b5..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/deleteOne.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "description": "deleteOne", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne when many documents match", - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ] - }, - { - "description": "DeleteOne when one document matches", - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 2 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "DeleteOne when no documents match", - "operations": [ - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 4 - } - }, - "expectResult": { - "deletedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/distinct-collation.json b/driver-core/src/test/resources/unified-test-format/crud/distinct-collation.json deleted file mode 100644 index e40cb0b2cf1..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/distinct-collation.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "description": "distinct-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "string": "PING" - }, - { - "_id": 2, - "string": "ping" - } - ] - } - ], - "tests": [ - { - "description": "Distinct with a collation", - "operations": [ - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "string", - "filter": {}, - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": [ - "PING" - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/distinct-comment.json b/driver-core/src/test/resources/unified-test-format/crud/distinct-comment.json deleted file mode 100644 index 11bce9ac9d7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/distinct-comment.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "description": "distinct-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "distinct-comment-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "distinct-comment-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "distinct with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4.14" - } - ], - "operations": [ - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "comment": { - "key": "value" - } - }, - "expectResult": [ - 11, - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll0", - "key": "x", - "query": {}, - "comment": { - "key": "value" - } - }, - "commandName": "distinct", - "databaseName": "distinct-comment-tests" - } - } - ] - } - ] - }, - { - "description": "distinct with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "comment": "comment" - }, - "expectResult": [ - 11, - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll0", - "key": "x", - "query": {}, - "comment": "comment" - }, - "commandName": "distinct", - "databaseName": "distinct-comment-tests" - } - } - ] - } - ] - }, - { - "description": "distinct with document comment - pre 4.4, server error", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "maxServerVersion": "4.4.13" - } - ], - "operations": [ - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "comment": { - "key": "value" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll0", - "key": "x", - "query": {}, - "comment": { - "key": "value" - } - }, - "commandName": "distinct", - "databaseName": "distinct-comment-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/distinct-hint.json b/driver-core/src/test/resources/unified-test-format/crud/distinct-hint.json deleted file mode 100644 index 2a6869cbe08..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/distinct-hint.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "description": "distinct-hint", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "7.1.0" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "distinct-hint-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "distinct-hint-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "distinct with hint string", - "operations": [ - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": { - "_id": 1 - }, - "hint": "_id_" - }, - "expectResult": [ - 11 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll0", - "key": "x", - "query": { - "_id": 1 - }, - "hint": "_id_" - }, - "commandName": "distinct", - "databaseName": "distinct-hint-tests" - } - } - ] - } - ] - }, - { - "description": "distinct with hint document", - "operations": [ - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": { - "_id": 1 - }, - "hint": { - "_id": 1 - } - }, - "expectResult": [ - 11 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll0", - "key": "x", - "query": { - "_id": 1 - }, - "hint": { - "_id": 1 - } - }, - "commandName": "distinct", - "databaseName": "distinct-hint-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/distinct.json b/driver-core/src/test/resources/unified-test-format/crud/distinct.json deleted file mode 100644 index 9accffabc99..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/distinct.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "description": "distinct", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Distinct without a filter", - "operations": [ - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": {} - }, - "expectResult": [ - 11, - 22, - 33 - ] - } - ] - }, - { - "description": "Distinct with a filter", - "operations": [ - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/estimatedDocumentCount-comment.json b/driver-core/src/test/resources/unified-test-format/crud/estimatedDocumentCount-comment.json deleted file mode 100644 index 6c0adacc8f1..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/estimatedDocumentCount-comment.json +++ /dev/null @@ -1,170 +0,0 @@ -{ - "description": "estimatedDocumentCount-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "edc-comment-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "edc-comment-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "estimatedDocumentCount with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4.14" - } - ], - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection0", - "arguments": { - "comment": { - "key": "value" - } - }, - "expectResult": 3 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll0", - "comment": { - "key": "value" - } - }, - "commandName": "count", - "databaseName": "edc-comment-tests" - } - } - ] - } - ] - }, - { - "description": "estimatedDocumentCount with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection0", - "arguments": { - "comment": "comment" - }, - "expectResult": 3 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll0", - "comment": "comment" - }, - "commandName": "count", - "databaseName": "edc-comment-tests" - } - } - ] - } - ] - }, - { - "description": "estimatedDocumentCount with document comment - pre 4.4.14, server error", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "maxServerVersion": "4.4.13", - "topologies": [ - "single", - "replicaset" - ] - } - ], - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection0", - "arguments": { - "comment": { - "key": "value" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll0", - "comment": { - "key": "value" - } - }, - "commandName": "count", - "databaseName": "edc-comment-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/estimatedDocumentCount.json b/driver-core/src/test/resources/unified-test-format/crud/estimatedDocumentCount.json deleted file mode 100644 index 1b650c1cb6c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/estimatedDocumentCount.json +++ /dev/null @@ -1,357 +0,0 @@ -{ - "description": "estimatedDocumentCount", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "edc-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - }, - { - "collection": { - "id": "collection1", - "database": "database0", - "collectionName": "coll1" - } - }, - { - "collection": { - "id": "collection0View", - "database": "database0", - "collectionName": "coll0view" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "edc-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "estimatedDocumentCount always uses count", - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection0", - "expectResult": 3 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll0" - }, - "commandName": "count", - "databaseName": "edc-tests" - } - } - ] - } - ] - }, - { - "description": "estimatedDocumentCount with maxTimeMS", - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection0", - "arguments": { - "maxTimeMS": 6000 - }, - "expectResult": 3 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll0", - "maxTimeMS": 6000 - }, - "commandName": "count", - "databaseName": "edc-tests" - } - } - ] - } - ] - }, - { - "description": "estimatedDocumentCount on non-existent collection", - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection1", - "expectResult": 0 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll1" - }, - "commandName": "count", - "databaseName": "edc-tests" - } - } - ] - } - ] - }, - { - "description": "estimatedDocumentCount errors correctly--command error", - "runOnRequirements": [ - { - "minServerVersion": "4.0.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.2.0", - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 8 - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection0", - "expectError": { - "errorCode": 8 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll0" - }, - "commandName": "count", - "databaseName": "edc-tests" - } - } - ] - } - ] - }, - { - "description": "estimatedDocumentCount errors correctly--socket error", - "runOnRequirements": [ - { - "minServerVersion": "4.0.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.2.0", - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - } - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection0", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll0" - }, - "commandName": "count", - "databaseName": "edc-tests" - } - } - ] - } - ] - }, - { - "description": "estimatedDocumentCount works correctly on views", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0" - } - ], - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "coll0view" - } - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "collection": "coll0view", - "viewOn": "coll0", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ] - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection0View", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "coll0view" - }, - "commandName": "drop", - "databaseName": "edc-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "create": "coll0view", - "viewOn": "coll0", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ] - }, - "commandName": "create", - "databaseName": "edc-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll0view" - }, - "commandName": "count", - "databaseName": "edc-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/find-allowdiskuse-clientError.json b/driver-core/src/test/resources/unified-test-format/crud/find-allowdiskuse-clientError.json deleted file mode 100644 index 5bd954e79d7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/find-allowdiskuse-clientError.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "description": "find-allowdiskuse-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.0.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_find_allowdiskuse_clienterror" - } - } - ], - "tests": [ - { - "description": "Find fails when allowDiskUse true is specified against pre 3.2 server", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "allowDiskUse": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Find fails when allowDiskUse false is specified against pre 3.2 server", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "allowDiskUse": false - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/find-allowdiskuse-serverError.json b/driver-core/src/test/resources/unified-test-format/crud/find-allowdiskuse-serverError.json deleted file mode 100644 index dc58f8f0e3a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/find-allowdiskuse-serverError.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "description": "find-allowdiskuse-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.2", - "maxServerVersion": "4.3.0" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_find_allowdiskuse_servererror" - } - } - ], - "tests": [ - { - "description": "Find fails when allowDiskUse true is specified against pre 4.4 server (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "allowDiskUse": true - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test_find_allowdiskuse_servererror", - "filter": {}, - "allowDiskUse": true - } - } - } - ] - } - ] - }, - { - "description": "Find fails when allowDiskUse false is specified against pre 4.4 server (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "allowDiskUse": false - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test_find_allowdiskuse_servererror", - "filter": {}, - "allowDiskUse": false - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/find-allowdiskuse.json b/driver-core/src/test/resources/unified-test-format/crud/find-allowdiskuse.json deleted file mode 100644 index eb238ab93a8..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/find-allowdiskuse.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "description": "find-allowdiskuse", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_find_allowdiskuse" - } - } - ], - "tests": [ - { - "description": "Find does not send allowDiskUse when value is not specified", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test_find_allowdiskuse", - "allowDiskUse": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "Find sends allowDiskUse false when false is specified", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "allowDiskUse": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test_find_allowdiskuse", - "allowDiskUse": false - } - } - } - ] - } - ] - }, - { - "description": "Find sends allowDiskUse true when true is specified", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "allowDiskUse": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test_find_allowdiskuse", - "allowDiskUse": true - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/find-collation.json b/driver-core/src/test/resources/unified-test-format/crud/find-collation.json deleted file mode 100644 index 13b105ad5aa..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/find-collation.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "description": "find-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": "ping" - } - ] - } - ], - "tests": [ - { - "description": "Find with a collation", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "x": "PING" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": [ - { - "_id": 1, - "x": "ping" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/find-comment.json b/driver-core/src/test/resources/unified-test-format/crud/find-comment.json deleted file mode 100644 index 600a3723f15..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/find-comment.json +++ /dev/null @@ -1,403 +0,0 @@ -{ - "description": "find-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - } - ] - } - ], - "tests": [ - { - "description": "find with string comment", - "runOnRequirements": [ - { - "minServerVersion": "3.6" - } - ], - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "comment": "comment" - }, - "expectResult": [ - { - "_id": 1 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": { - "_id": 1 - }, - "comment": "comment" - } - } - } - ] - } - ] - }, - { - "description": "find with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "comment": { - "key": "value" - } - }, - "expectResult": [ - { - "_id": 1 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": { - "_id": 1 - }, - "comment": { - "key": "value" - } - } - } - } - ] - } - ] - }, - { - "description": "find with document comment - pre 4.4", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99", - "minServerVersion": "3.6" - } - ], - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "comment": { - "key": "value" - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": { - "_id": 1 - }, - "comment": { - "key": "value" - } - } - } - } - ] - } - ] - }, - { - "description": "find with comment sets comment on getMore", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "batchSize": 2, - "comment": { - "key": "value" - } - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": { - "_id": { - "$gt": 1 - } - }, - "batchSize": 2, - "comment": { - "key": "value" - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0", - "batchSize": 2, - "comment": { - "key": "value" - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0", - "batchSize": 2, - "comment": { - "key": "value" - } - } - } - } - ] - } - ] - }, - { - "description": "find with comment does not set comment on getMore - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "maxServerVersion": "4.3.99" - } - ], - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "batchSize": 2, - "comment": "comment" - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": { - "_id": { - "$gt": 1 - } - }, - "batchSize": 2, - "comment": "comment" - } - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0", - "batchSize": 2, - "comment": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0", - "batchSize": 2, - "comment": { - "$$exists": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/find-let.json b/driver-core/src/test/resources/unified-test-format/crud/find-let.json deleted file mode 100644 index 4e9c9c99f4f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/find-let.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "description": "find-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "Find with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "let": { - "id": 1 - } - }, - "expectResult": [ - { - "_id": 1 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "let": { - "id": 1 - } - } - } - } - ] - } - ] - }, - { - "description": "Find with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "let": { - "x": 1 - } - }, - "expectError": { - "errorContains": "Unrecognized field 'let'", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": { - "_id": 1 - }, - "let": { - "x": 1 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/find.json b/driver-core/src/test/resources/unified-test-format/crud/find.json deleted file mode 100644 index 6bf1e4e4453..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/find.json +++ /dev/null @@ -1,242 +0,0 @@ -{ - "description": "find", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "find-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "find-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - } - ] - } - ], - "tests": [ - { - "description": "find with multiple batches works", - "operations": [ - { - "name": "find", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "batchSize": 2 - }, - "object": "collection0", - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": { - "_id": { - "$gt": 1 - } - }, - "batchSize": 2 - }, - "commandName": "find", - "databaseName": "find-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0", - "batchSize": 2 - }, - "commandName": "getMore", - "databaseName": "find-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0", - "batchSize": 2 - }, - "commandName": "getMore", - "databaseName": "find-tests" - } - } - ] - } - ] - }, - { - "description": "Find with filter", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "Find with filter, sort, skip, and limit", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": { - "$gt": 2 - } - }, - "sort": { - "_id": 1 - }, - "skip": 2, - "limit": 2 - }, - "expectResult": [ - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - } - ] - } - ] - }, - { - "description": "Find with limit, sort, and batchsize", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4, - "batchSize": 2 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-collation.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-collation.json deleted file mode 100644 index a0452876a32..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-collation.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "description": "findOneAndDelete-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - }, - { - "_id": 3, - "x": "pINg" - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndDelete when one document matches with collation", - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 2, - "x": "PING" - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": { - "x": "ping" - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 3, - "x": "pINg" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-comment.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-comment.json deleted file mode 100644 index 6853b9cc2d7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-comment.json +++ /dev/null @@ -1,211 +0,0 @@ -{ - "description": "findOneAndDelete-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "findOneAndDelete with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "findOneAndDelete", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "comment": "comment" - }, - "expectResult": { - "_id": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "remove": true, - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "findOneAndDelete with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "findOneAndDelete", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "comment": { - "key": "value" - } - }, - "expectResult": { - "_id": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "remove": true, - "comment": { - "key": "value" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "findOneAndDelete with comment - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "findOneAndDelete", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "comment": "comment" - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "remove": true, - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-hint-clientError.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-hint-clientError.json deleted file mode 100644 index c6ff467866d..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-hint-clientError.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "description": "findOneAndDelete-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "findOneAndDelete_hint" - } - } - ], - "initialData": [ - { - "collectionName": "findOneAndDelete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndDelete with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "findOneAndDelete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete with hint document", - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "findOneAndDelete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-hint-serverError.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-hint-serverError.json deleted file mode 100644 index b874102728b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-hint-serverError.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "description": "findOneAndDelete-hint-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.3.3" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "findOneAndDelete_hint" - } - } - ], - "initialData": [ - { - "collectionName": "findOneAndDelete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndDelete with hint string unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "findOneAndDelete_hint", - "query": { - "_id": 1 - }, - "hint": "_id_", - "remove": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "findOneAndDelete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete with hint document unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "findOneAndDelete_hint", - "query": { - "_id": 1 - }, - "hint": { - "_id": 1 - }, - "remove": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "findOneAndDelete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-hint-unacknowledged.json deleted file mode 100644 index 077f9892b93..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-hint-unacknowledged.json +++ /dev/null @@ -1,225 +0,0 @@ -{ - "description": "findOneAndDelete-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged findOneAndDelete with hint string fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged findOneAndDelete with hint document fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged findOneAndDelete with hint string on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": "_id_" - }, - "expectResult": { - "$$unsetOrMatches": null - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": { - "$gt": 1 - } - }, - "remove": true, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged findOneAndDelete with hint document on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": null - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": { - "$gt": 1 - } - }, - "remove": true, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-hint.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-hint.json deleted file mode 100644 index 8b53f2bd3ff..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-hint.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "description": "findOneAndDelete-hint", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.3.4" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "findOneAndDelete_hint" - } - } - ], - "initialData": [ - { - "collectionName": "findOneAndDelete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndDelete with hint string", - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": "_id_" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "findOneAndDelete_hint", - "query": { - "_id": 1 - }, - "hint": "_id_", - "remove": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "findOneAndDelete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete with hint document", - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 1 - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "findOneAndDelete_hint", - "query": { - "_id": 1 - }, - "hint": { - "_id": 1 - }, - "remove": true - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "findOneAndDelete_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-let.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-let.json deleted file mode 100644 index ba8e681c0e5..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete-let.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "description": "findOneAndDelete-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "findOneAndDelete with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "findOneAndDelete", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "let": { - "id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "remove": true, - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "findOneAndDelete with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "name": "findOneAndDelete", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "let": { - "id": 1 - } - }, - "expectError": { - "errorContains": "field 'let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "remove": true, - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete.json deleted file mode 100644 index e434b3b7409..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndDelete.json +++ /dev/null @@ -1,171 +0,0 @@ -{ - "description": "findOneAndDelete", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndDelete when many documents match", - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "x": 22 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete when one document matches", - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 2 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "x": 22 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete when no documents match", - "operations": [ - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "_id": 4 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - }, - "expectResult": null - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-collation.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-collation.json deleted file mode 100644 index 0d60d541645..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-collation.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "description": "findOneAndReplace-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace when one document matches with collation returning the document after modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "x": "PING" - }, - "replacement": { - "x": "pong" - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": { - "x": "pong" - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "pong" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-comment.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-comment.json deleted file mode 100644 index f817bb69375..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-comment.json +++ /dev/null @@ -1,234 +0,0 @@ -{ - "description": "findOneAndReplace-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "findOneAndReplace with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 5 - }, - "comment": "comment" - }, - "expectResult": { - "_id": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": { - "x": 5 - }, - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 5 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "findOneAndReplace with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 5 - }, - "comment": { - "key": "value" - } - }, - "expectResult": { - "_id": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": { - "x": 5 - }, - "comment": { - "key": "value" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 5 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "findOneAndReplace with comment - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 5 - }, - "comment": "comment" - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": { - "x": 5 - }, - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-dots_and_dollars.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-dots_and_dollars.json deleted file mode 100644 index 19ac447f842..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-dots_and_dollars.json +++ /dev/null @@ -1,430 +0,0 @@ -{ - "description": "findOneAndReplace-dots_and_dollars", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ], - "tests": [ - { - "description": "Replacing document with top-level dotted key on 3.6+ server", - "runOnRequirements": [ - { - "minServerVersion": "3.6" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a.b": 1 - } - }, - "expectResult": { - "_id": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": { - "_id": 1, - "a.b": 1 - }, - "new": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a.b": 1 - } - ] - } - ] - }, - { - "description": "Replacing document with top-level dotted key on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a.b": 1 - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": { - "_id": 1, - "a.b": 1 - }, - "new": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "Replacing document with dollar-prefixed key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "$b": 1 - } - } - }, - "expectResult": { - "_id": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": { - "_id": 1, - "a": { - "$b": 1 - } - }, - "new": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "$b": 1 - } - } - ] - } - ] - }, - { - "description": "Replacing document with dollar-prefixed key in embedded doc on pre-5.0 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "4.99" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "$b": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": { - "_id": 1, - "a": { - "$b": 1 - } - }, - "new": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "Replacing document with dotted key in embedded doc on 3.6+ server", - "runOnRequirements": [ - { - "minServerVersion": "3.6" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "b.c": 1 - } - } - }, - "expectResult": { - "_id": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": { - "_id": 1, - "a": { - "b.c": 1 - } - }, - "new": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "b.c": 1 - } - } - ] - } - ] - }, - { - "description": "Replacing document with dotted key in embedded doc on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "b.c": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": { - "_id": 1, - "a": { - "b.c": 1 - } - }, - "new": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-hint-clientError.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-hint-clientError.json deleted file mode 100644 index 6b07eb1f4d9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-hint-clientError.json +++ /dev/null @@ -1,139 +0,0 @@ -{ - "description": "findOneAndReplace-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "findOneAndReplace_hint" - } - } - ], - "initialData": [ - { - "collectionName": "findOneAndReplace_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 33 - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "findOneAndReplace_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace with hint document unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 33 - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "findOneAndReplace_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-hint-serverError.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-hint-serverError.json deleted file mode 100644 index 7fbf5a0ea3b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-hint-serverError.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "description": "findOneAndReplace-hint-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.3.0" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "findOneAndReplace_hint" - } - } - ], - "initialData": [ - { - "collectionName": "findOneAndReplace_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace with hint string unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 33 - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "findOneAndReplace_hint", - "query": { - "_id": 1 - }, - "update": { - "x": 33 - }, - "hint": "_id_" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "findOneAndReplace_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace with hint document unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 33 - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "findOneAndReplace_hint", - "query": { - "_id": 1 - }, - "update": { - "x": 33 - }, - "hint": { - "_id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "findOneAndReplace_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-hint-unacknowledged.json deleted file mode 100644 index 8228d8a2aa9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-hint-unacknowledged.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "description": "findOneAndReplace-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - }, - { - "collection": { - "id": "collection1", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged findOneAndReplace with hint string fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": "_id_" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged findOneAndReplace with hint document fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged findOneAndReplace with hint string on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": "_id_" - }, - "expectResult": { - "$$unsetOrMatches": null - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": { - "$gt": 1 - } - }, - "update": { - "x": 111 - }, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged findOneAndReplace with hint document on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": null - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": { - "$gt": 1 - } - }, - "update": { - "x": 111 - }, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-hint.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-hint.json deleted file mode 100644 index d07c5921a7a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-hint.json +++ /dev/null @@ -1,173 +0,0 @@ -{ - "description": "findOneAndReplace-hint", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "findOneAndReplace_hint" - } - } - ], - "initialData": [ - { - "collectionName": "findOneAndReplace_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace with hint string", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 33 - }, - "hint": "_id_" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "findOneAndReplace_hint", - "query": { - "_id": 1 - }, - "update": { - "x": 33 - }, - "hint": "_id_" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "findOneAndReplace_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 33 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace with hint document", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 33 - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "findOneAndReplace_hint", - "query": { - "_id": 1 - }, - "update": { - "x": 33 - }, - "hint": { - "_id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "findOneAndReplace_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 33 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-let.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-let.json deleted file mode 100644 index 5e5de44b311..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-let.json +++ /dev/null @@ -1,197 +0,0 @@ -{ - "description": "findOneAndReplace-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "findOneAndReplace with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "replacement": { - "x": "x" - }, - "let": { - "id": 1 - } - }, - "expectResult": { - "_id": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "update": { - "x": "x" - }, - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": "x" - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "findOneAndReplace with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "replacement": { - "x": "x" - }, - "let": { - "id": 1 - } - }, - "expectError": { - "errorContains": "field 'let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "update": { - "x": "x" - }, - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-upsert.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-upsert.json deleted file mode 100644 index f1f18996c8a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace-upsert.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "description": "findOneAndReplace-upsert", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "2.6" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace when no documents match without id specified with upsert returning the document before modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "upsert": true - }, - "expectResult": null - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace when no documents match without id specified with upsert returning the document after modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - }, - "upsert": true - }, - "expectResult": { - "x": 44 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace when no documents match with id specified with upsert returning the document before modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "upsert": true - }, - "expectResult": null - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace when no documents match with id specified with upsert returning the document after modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - }, - "upsert": true - }, - "expectResult": { - "x": 44 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace.json deleted file mode 100644 index a4731602c42..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndReplace.json +++ /dev/null @@ -1,332 +0,0 @@ -{ - "description": "findOneAndReplace", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace when many documents match returning the document before modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 32 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "x": 22 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 32 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace when many documents match returning the document after modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 32 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - } - }, - "expectResult": { - "x": 32 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 32 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace when one document matches returning the document before modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 2 - }, - "replacement": { - "x": 32 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "x": 22 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 32 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace when one document matches returning the document after modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 2 - }, - "replacement": { - "x": 32 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - } - }, - "expectResult": { - "x": 32 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 32 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace when no documents match returning the document before modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - }, - "expectResult": null - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace when no documents match returning the document after modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - } - }, - "expectResult": null - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-arrayFilters.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-arrayFilters.json deleted file mode 100644 index 6c99e4ff663..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-arrayFilters.json +++ /dev/null @@ -1,251 +0,0 @@ -{ - "description": "findOneAndUpdate-arrayFilters", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.5.6" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate when no document matches arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 4 - } - ] - }, - "expectResult": { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate when one document matches arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 3 - } - ] - }, - "expectResult": { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 2 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate when multiple documents match arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 1 - } - ] - }, - "expectResult": { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 2 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-collation.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-collation.json deleted file mode 100644 index 7a49347a3a9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-collation.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "description": "findOneAndUpdate-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - }, - { - "_id": 3, - "x": "pINg" - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate when many documents match with collation returning the document before modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "x": "PING" - }, - "update": { - "$set": { - "x": "pong" - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "_id": 1 - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": { - "x": "ping" - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "pong" - }, - { - "_id": 3, - "x": "pINg" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-comment.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-comment.json deleted file mode 100644 index 6dec5b39eee..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-comment.json +++ /dev/null @@ -1,228 +0,0 @@ -{ - "description": "findOneAndUpdate-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "findOneAndUpdate with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "x": 5 - } - } - ], - "comment": "comment" - }, - "expectResult": { - "_id": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": [ - { - "$set": { - "x": 5 - } - } - ], - "comment": "comment" - } - } - } - ] - } - ] - }, - { - "description": "findOneAndUpdate with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "x": 5 - } - } - ], - "comment": { - "key": "value" - } - }, - "expectResult": { - "_id": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": [ - { - "$set": { - "x": 5 - } - } - ], - "comment": { - "key": "value" - } - } - } - } - ] - } - ] - }, - { - "description": "findOneAndUpdate with comment - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "x": 5 - } - } - ], - "comment": "comment" - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": [ - { - "$set": { - "x": 5 - } - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-dots_and_dollars.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-dots_and_dollars.json deleted file mode 100644 index 40eb5473928..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-dots_and_dollars.json +++ /dev/null @@ -1,380 +0,0 @@ -{ - "description": "findOneAndUpdate-dots_and_dollars", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {} - } - ] - } - ], - "tests": [ - { - "description": "Updating document to set top-level dollar-prefixed key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ] - }, - "expectResult": { - "_id": 1, - "foo": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ], - "new": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {}, - "$a": 1 - } - ] - } - ] - }, - { - "description": "Updating document to set top-level dotted key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ] - }, - "expectResult": { - "_id": 1, - "foo": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ], - "new": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {}, - "a.b": 1 - } - ] - } - ] - }, - { - "description": "Updating document to set dollar-prefixed key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ] - }, - "expectResult": { - "_id": 1, - "foo": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ], - "new": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": { - "$a": 1 - } - } - ] - } - ] - }, - { - "description": "Updating document to set dotted key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ] - }, - "expectResult": { - "_id": 1, - "foo": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": 1 - }, - "update": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ], - "new": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": { - "a.b": 1 - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-errorResponse.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-errorResponse.json deleted file mode 100644 index 5023a450f33..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-errorResponse.json +++ /dev/null @@ -1,132 +0,0 @@ -{ - "description": "findOneAndUpdate-errorResponse", - "schemaVersion": "1.12", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": "foo" - } - ] - } - ], - "tests": [ - { - "description": "findOneAndUpdate DuplicateKey error is accessible", - "runOnRequirements": [ - { - "minServerVersion": "4.2" - } - ], - "operations": [ - { - "name": "createIndex", - "object": "collection0", - "arguments": { - "keys": { - "x": 1 - }, - "unique": true - } - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 2 - }, - "update": { - "$set": { - "x": "foo" - } - }, - "upsert": true - }, - "expectError": { - "errorCode": 11000, - "errorResponse": { - "keyPattern": { - "x": 1 - }, - "keyValue": { - "x": "foo" - } - } - } - } - ] - }, - { - "description": "findOneAndUpdate document validation errInfo is accessible", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "modifyCollection", - "object": "database0", - "arguments": { - "collection": "test", - "validator": { - "x": { - "$type": "string" - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - }, - "expectError": { - "errorCode": 121, - "errorResponse": { - "errInfo": { - "failingDocumentId": 1, - "details": { - "$$type": "object" - } - } - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-hint-clientError.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-hint-clientError.json deleted file mode 100644 index d0b51313c95..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-hint-clientError.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "description": "findOneAndUpdate-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "findOneAndUpdate_hint" - } - } - ], - "initialData": [ - { - "collectionName": "findOneAndUpdate_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "findOneAndUpdate_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate with hint document unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "findOneAndUpdate_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-hint-serverError.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-hint-serverError.json deleted file mode 100644 index 99fd9938f8c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-hint-serverError.json +++ /dev/null @@ -1,180 +0,0 @@ -{ - "description": "findOneAndUpdate-hint-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.3.0" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "findOneAndUpdate_hint" - } - } - ], - "initialData": [ - { - "collectionName": "findOneAndUpdate_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate with hint string unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "findOneAndUpdate_hint", - "query": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "findOneAndUpdate_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate with hint document unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "findOneAndUpdate_hint", - "query": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "findOneAndUpdate_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-hint-unacknowledged.json deleted file mode 100644 index d116a06d0d0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-hint-unacknowledged.json +++ /dev/null @@ -1,253 +0,0 @@ -{ - "description": "findOneAndUpdate-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged findOneAndUpdate with hint string fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged findOneAndUpdate with hint document fails with client-side error on pre-4.4 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged findOneAndUpdate with hint string on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectResult": { - "$$unsetOrMatches": null - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged findOneAndUpdate with hint document on 4.4+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": null - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "$$type": [ - "string", - "object" - ] - }, - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-hint.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-hint.json deleted file mode 100644 index 5be6d2b3e8e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-hint.json +++ /dev/null @@ -1,181 +0,0 @@ -{ - "description": "findOneAndUpdate-hint", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "findOneAndUpdate_hint" - } - } - ], - "initialData": [ - { - "collectionName": "findOneAndUpdate_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate with hint string", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "findOneAndUpdate_hint", - "query": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "findOneAndUpdate_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate with hint document", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "findOneAndUpdate_hint", - "query": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "findOneAndUpdate_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-let.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-let.json deleted file mode 100644 index 74d7d0e58bd..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate-let.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "description": "findOneAndUpdate-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "findOneAndUpdate with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "update": [ - { - "$set": { - "x": "$$x" - } - } - ], - "let": { - "id": 1, - "x": "foo" - } - }, - "expectResult": { - "_id": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "update": [ - { - "$set": { - "x": "$$x" - } - } - ], - "let": { - "id": 1, - "x": "foo" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": "foo" - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "findOneAndUpdate with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "update": [ - { - "$set": { - "x": "$$x" - } - } - ], - "let": { - "id": 1, - "x": "foo" - } - }, - "expectError": { - "errorContains": "field 'let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll0", - "query": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "update": [ - { - "$set": { - "x": "$$x" - } - } - ], - "let": { - "id": 1, - "x": "foo" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate.json b/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate.json deleted file mode 100644 index d79cf8ac5b0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/findOneAndUpdate.json +++ /dev/null @@ -1,448 +0,0 @@ -{ - "description": "findOneAndUpdate", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate when many documents match returning the document before modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "x": 22 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate when many documents match returning the document after modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - } - }, - "expectResult": { - "x": 23 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate when one document matches returning the document before modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "x": 22 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate when one document matches returning the document after modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - } - }, - "expectResult": { - "x": 23 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate when no documents match returning the document before modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "sort": { - "x": 1 - } - }, - "expectResult": null - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate when no documents match with upsert returning the document before modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "upsert": true - }, - "expectResult": null - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate when no documents match returning the document after modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - } - }, - "expectResult": null - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate when no documents match with upsert returning the document after modification", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "projection": { - "x": 1, - "_id": 0 - }, - "returnDocument": "After", - "sort": { - "x": 1 - }, - "upsert": true - }, - "expectResult": { - "x": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/insertMany-comment.json b/driver-core/src/test/resources/unified-test-format/crud/insertMany-comment.json deleted file mode 100644 index 2b4c80b3f06..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/insertMany-comment.json +++ /dev/null @@ -1,226 +0,0 @@ -{ - "description": "insertMany-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "insertMany with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "comment": "comment" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "insertMany with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "comment": { - "key": "value" - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "comment": { - "key": "value" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "insertMany with comment - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "comment": "comment" - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/insertMany-dots_and_dollars.json b/driver-core/src/test/resources/unified-test-format/crud/insertMany-dots_and_dollars.json deleted file mode 100644 index eed8997df94..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/insertMany-dots_and_dollars.json +++ /dev/null @@ -1,338 +0,0 @@ -{ - "description": "insertMany-dots_and_dollars", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Inserting document with top-level dollar-prefixed key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "documents": [ - { - "_id": 1, - "$a": 1 - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 1 - } - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "$a": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "$a": 1 - } - ] - } - ] - }, - { - "description": "Inserting document with top-level dollar-prefixed key on pre-5.0 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "4.99" - } - ], - "operations": [ - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "documents": [ - { - "_id": 1, - "$a": 1 - } - ] - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "$a": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [] - } - ] - }, - { - "description": "Inserting document with top-level dotted key", - "operations": [ - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "documents": [ - { - "_id": 1, - "a.b": 1 - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 1 - } - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "a.b": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a.b": 1 - } - ] - } - ] - }, - { - "description": "Inserting document with dollar-prefixed key in embedded doc", - "operations": [ - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "documents": [ - { - "_id": 1, - "a": { - "$b": 1 - } - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 1 - } - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "a": { - "$b": 1 - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "$b": 1 - } - } - ] - } - ] - }, - { - "description": "Inserting document with dotted key in embedded doc", - "operations": [ - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "documents": [ - { - "_id": 1, - "a": { - "b.c": 1 - } - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 1 - } - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "a": { - "b.c": 1 - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "b.c": 1 - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/insertMany.json b/driver-core/src/test/resources/unified-test-format/crud/insertMany.json deleted file mode 100644 index 643b7f44de9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/insertMany.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "description": "insertMany", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "InsertMany with non-existing documents", - "operations": [ - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertMany continue-on-error behavior with unordered (preexisting duplicate key)", - "operations": [ - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": false - }, - "expectError": { - "isError": true, - "expectResult": { - "deletedCount": 0, - "insertedCount": 2, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertMany continue-on-error behavior with unordered (duplicate key in requests)", - "operations": [ - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": false - }, - "expectError": { - "isError": true, - "expectResult": { - "deletedCount": 0, - "insertedCount": 2, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/insertOne-comment.json b/driver-core/src/test/resources/unified-test-format/crud/insertOne-comment.json deleted file mode 100644 index dbd83d9f642..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/insertOne-comment.json +++ /dev/null @@ -1,220 +0,0 @@ -{ - "description": "insertOne-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "insertOne with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 2, - "x": 22 - }, - "comment": "comment" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "insertOne with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 2, - "x": 22 - }, - "comment": { - "key": "value" - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "comment": { - "key": "value" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "insertOne with comment - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 2, - "x": 22 - }, - "comment": "comment" - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/insertOne-dots_and_dollars.json b/driver-core/src/test/resources/unified-test-format/crud/insertOne-dots_and_dollars.json deleted file mode 100644 index fdc17af2e8f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/insertOne-dots_and_dollars.json +++ /dev/null @@ -1,614 +0,0 @@ -{ - "description": "insertOne-dots_and_dollars", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - }, - { - "collection": { - "id": "collection1", - "database": "database0", - "collectionName": "coll1", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Inserting document with top-level dollar-prefixed key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "$a": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "$a": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "$a": 1 - } - ] - } - ] - }, - { - "description": "Inserting document with top-level dollar-prefixed key on pre-5.0 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "4.99" - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "$a": 1 - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "$a": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [] - } - ] - }, - { - "description": "Inserting document with top-level dotted key", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a.b": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "a.b": 1 - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a.b": 1 - } - ] - } - ] - }, - { - "description": "Inserting document with dollar-prefixed key in embedded doc", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": { - "$b": 1 - } - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "a": { - "$b": 1 - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "$b": 1 - } - } - ] - } - ] - }, - { - "description": "Inserting document with dotted key in embedded doc", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": { - "b.c": 1 - } - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "a": { - "b.c": 1 - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "b.c": 1 - } - } - ] - } - ] - }, - { - "description": "Inserting document with dollar-prefixed key in _id yields server-side error", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": { - "$a": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": { - "$a": 1 - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [] - } - ] - }, - { - "description": "Inserting document with dotted key in _id on 3.6+ server", - "runOnRequirements": [ - { - "minServerVersion": "3.6" - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": { - "a.b": 1 - } - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": { - "a.b": 1 - } - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": { - "a.b": 1 - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": { - "a.b": 1 - } - } - ] - } - ] - }, - { - "description": "Inserting document with dotted key in _id on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": { - "a.b": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": { - "a.b": 1 - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [] - } - ] - }, - { - "description": "Inserting document with DBRef-like keys", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "a": { - "$db": "foo" - } - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1, - "a": { - "$db": "foo" - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "$db": "foo" - } - } - ] - } - ] - }, - { - "description": "Unacknowledged write using dollar-prefixed or dotted keys may be silently rejected on pre-5.0 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.99" - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection1", - "arguments": { - "document": { - "_id": { - "$a": 1 - } - } - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll1", - "documents": [ - { - "_id": { - "$a": 1 - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/insertOne-errorResponse.json b/driver-core/src/test/resources/unified-test-format/crud/insertOne-errorResponse.json deleted file mode 100644 index 04ea6a74513..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/insertOne-errorResponse.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "description": "insertOne-errorResponse", - "schemaVersion": "1.12", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "tests": [ - { - "description": "insert operations support errorResponse assertions", - "runOnRequirements": [ - { - "minServerVersion": "4.0.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.2.0", - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 8 - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1 - } - }, - "expectError": { - "errorCode": 8, - "errorResponse": { - "code": 8 - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/insertOne.json b/driver-core/src/test/resources/unified-test-format/crud/insertOne.json deleted file mode 100644 index 1a909134768..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/insertOne.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "description": "insertOne", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "InsertOne with a non-existing document", - "operations": [ - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 2, - "x": 22 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-collation.json b/driver-core/src/test/resources/unified-test-format/crud/replaceOne-collation.json deleted file mode 100644 index dd76b9d616a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-collation.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "description": "replaceOne-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne when one document matches with collation", - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "x": "PING" - }, - "replacement": { - "_id": 2, - "x": "pong" - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "pong" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-comment.json b/driver-core/src/test/resources/unified-test-format/crud/replaceOne-comment.json deleted file mode 100644 index 88bee5d7b7a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-comment.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "description": "replaceOne-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 22 - }, - "comment": "comment" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "x": 22 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 22 - } - ] - } - ] - }, - { - "description": "ReplaceOne with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 22 - }, - "comment": { - "key": "value" - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "x": 22 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "comment": { - "key": "value" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 22 - } - ] - } - ] - }, - { - "description": "ReplaceOne with comment - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 22 - }, - "comment": "comment" - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "x": 22 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-dots_and_dollars.json b/driver-core/src/test/resources/unified-test-format/crud/replaceOne-dots_and_dollars.json deleted file mode 100644 index d5003dc5ea4..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-dots_and_dollars.json +++ /dev/null @@ -1,567 +0,0 @@ -{ - "description": "replaceOne-dots_and_dollars", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - }, - { - "collection": { - "id": "collection1", - "database": "database0", - "collectionName": "coll1", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ], - "tests": [ - { - "description": "Replacing document with top-level dotted key on 3.6+ server", - "runOnRequirements": [ - { - "minServerVersion": "3.6" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a.b": 1 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a.b": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a.b": 1 - } - ] - } - ] - }, - { - "description": "Replacing document with top-level dotted key on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a.b": 1 - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a.b": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "Replacing document with dollar-prefixed key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "$b": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a": { - "$b": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "$b": 1 - } - } - ] - } - ] - }, - { - "description": "Replacing document with dollar-prefixed key in embedded doc on pre-5.0 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "4.99" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "$b": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a": { - "$b": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "Replacing document with dotted key in embedded doc on 3.6+ server", - "runOnRequirements": [ - { - "minServerVersion": "3.6" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "b.c": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a": { - "b.c": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "a": { - "b.c": 1 - } - } - ] - } - ] - }, - { - "description": "Replacing document with dotted key in embedded doc on pre-3.6 server yields server-side error", - "runOnRequirements": [ - { - "maxServerVersion": "3.4.99" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "b.c": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a": { - "b.c": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "Unacknowledged write using dollar-prefixed or dotted keys may be silently rejected on pre-5.0 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.99" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection1", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "a": { - "$b": 1 - } - } - }, - "expectResult": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll1", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "_id": 1, - "a": { - "$b": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/replaceOne-hint-unacknowledged.json deleted file mode 100644 index 5c5dec64f66..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-hint-unacknowledged.json +++ /dev/null @@ -1,269 +0,0 @@ -{ - "description": "replaceOne-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged replaceOne with hint string fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": "_id_" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged replaceOne with hint document fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged replaceOne with hint string on 4.2+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": "_id_" - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "x": 111 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "$$type": [ - "string", - "object" - ] - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged replaceOne with hint document on 4.2+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "x": 111 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "$$type": [ - "string", - "object" - ] - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-hint.json b/driver-core/src/test/resources/unified-test-format/crud/replaceOne-hint.json deleted file mode 100644 index 6926e9d8dfe..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-hint.json +++ /dev/null @@ -1,203 +0,0 @@ -{ - "description": "replaceOne-hint", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_replaceone_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_replaceone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne with hint string", - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": "_id_" - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_replaceone_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "x": 111 - }, - "hint": "_id_", - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_replaceone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 111 - } - ] - } - ] - }, - { - "description": "ReplaceOne with hint document", - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_replaceone_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "x": 111 - }, - "hint": { - "_id": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_replaceone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 111 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-let.json b/driver-core/src/test/resources/unified-test-format/crud/replaceOne-let.json deleted file mode 100644 index e7a7ee65a53..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-let.json +++ /dev/null @@ -1,219 +0,0 @@ -{ - "description": "replaceOne-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "replacement": { - "x": "foo" - }, - "let": { - "id": 1 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "u": { - "x": "foo" - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": "foo" - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "ReplaceOne with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "replacement": { - "x": "foo" - }, - "let": { - "id": 1 - } - }, - "expectError": { - "errorContains": "'update.let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "u": { - "x": "foo" - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "let": { - "id": 1 - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-sort.json b/driver-core/src/test/resources/unified-test-format/crud/replaceOne-sort.json deleted file mode 100644 index cf2271dda57..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-sort.json +++ /dev/null @@ -1,232 +0,0 @@ -{ - "description": "replaceOne-sort", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne with sort option", - "runOnRequirements": [ - { - "minServerVersion": "8.0" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "sort": { - "_id": -1 - }, - "replacement": { - "x": 1 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "x": 1 - }, - "sort": { - "_id": -1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1 - }, - "commandName": "update" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 1 - } - ] - } - ] - }, - { - "description": "replaceOne with sort option unsupported (server-side error)", - "runOnRequirements": [ - { - "maxServerVersion": "7.99" - } - ], - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "sort": { - "_id": -1 - }, - "replacement": { - "x": 1 - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "x": 1 - }, - "sort": { - "_id": -1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-validation.json b/driver-core/src/test/resources/unified-test-format/crud/replaceOne-validation.json deleted file mode 100644 index 6f5b173e023..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/replaceOne-validation.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "description": "replaceOne-validation", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne prohibits atomic modifiers", - "operations": [ - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "$set": { - "x": 22 - } - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/replaceOne.json b/driver-core/src/test/resources/unified-test-format/crud/replaceOne.json deleted file mode 100644 index bdb7556f2f9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/replaceOne.json +++ /dev/null @@ -1,259 +0,0 @@ -{ - "description": "replaceOne", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "2.6" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne when many documents match", - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "replacement": { - "x": 111 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ] - }, - { - "description": "ReplaceOne when one document matches", - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "ReplaceOne when no documents match", - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 1 - } - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "ReplaceOne with upsert when no documents match without an id specified", - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "x": 1 - }, - "upsert": true - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - ] - }, - { - "description": "ReplaceOne with upsert when no documents match with an id specified", - "operations": [ - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 1 - }, - "upsert": true - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateMany-arrayFilters.json b/driver-core/src/test/resources/unified-test-format/crud/updateMany-arrayFilters.json deleted file mode 100644 index 8730caeb42b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateMany-arrayFilters.json +++ /dev/null @@ -1,233 +0,0 @@ -{ - "description": "updateMany-arrayFilters", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.5.6" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - } - ] - } - ], - "tests": [ - { - "description": "UpdateMany when no documents match arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 4 - } - ] - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 0, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - } - ] - } - ] - }, - { - "description": "UpdateMany when one document matches arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 3 - } - ] - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 2 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - } - ] - } - ] - }, - { - "description": "UpdateMany when multiple documents match arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 1 - } - ] - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 2 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 2 - } - ] - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateMany-collation.json b/driver-core/src/test/resources/unified-test-format/crud/updateMany-collation.json deleted file mode 100644 index 0c780a3c2d0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateMany-collation.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "description": "updateMany-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - }, - { - "_id": 3, - "x": "pINg" - } - ] - } - ], - "tests": [ - { - "description": "UpdateMany when many documents match with collation", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "x": "ping" - }, - "update": { - "$set": { - "x": "pong" - } - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "pong" - }, - { - "_id": 3, - "x": "pong" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateMany-comment.json b/driver-core/src/test/resources/unified-test-format/crud/updateMany-comment.json deleted file mode 100644 index 88b8b67f5a1..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateMany-comment.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "description": "updateMany-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "UpdateMany with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 22 - } - }, - "comment": "comment" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 22 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateMany with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 22 - } - }, - "comment": { - "key": "value" - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 22 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "comment": { - "key": "value" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateMany with comment - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 22 - } - }, - "comment": "comment" - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 22 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateMany-dots_and_dollars.json b/driver-core/src/test/resources/unified-test-format/crud/updateMany-dots_and_dollars.json deleted file mode 100644 index 5d3b9d0453a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateMany-dots_and_dollars.json +++ /dev/null @@ -1,404 +0,0 @@ -{ - "description": "updateMany-dots_and_dollars", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {} - } - ] - } - ], - "tests": [ - { - "description": "Updating document to set top-level dollar-prefixed key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {}, - "$a": 1 - } - ] - } - ] - }, - { - "description": "Updating document to set top-level dotted key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {}, - "a.b": 1 - } - ] - } - ] - }, - { - "description": "Updating document to set dollar-prefixed key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": { - "$a": 1 - } - } - ] - } - ] - }, - { - "description": "Updating document to set dotted key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": { - "a.b": 1 - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateMany-hint-clientError.json b/driver-core/src/test/resources/unified-test-format/crud/updateMany-hint-clientError.json deleted file mode 100644 index 5da878e293c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateMany-hint-clientError.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "description": "updateMany-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.3.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_updatemany_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "UpdateMany with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "UpdateMany with hint document unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateMany-hint-serverError.json b/driver-core/src/test/resources/unified-test-format/crud/updateMany-hint-serverError.json deleted file mode 100644 index c81f36b13cd..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateMany-hint-serverError.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "description": "updateMany-hint-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.1.9" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_updatemany_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "UpdateMany with hint string unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_updatemany_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "hint": "_id_", - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "UpdateMany with hint document unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_updatemany_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "hint": { - "_id": 1 - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateMany-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/updateMany-hint-unacknowledged.json deleted file mode 100644 index e83838aac23..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateMany-hint-unacknowledged.json +++ /dev/null @@ -1,281 +0,0 @@ -{ - "description": "updateMany-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged updateMany with hint string fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged updateMany with hint document fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged updateMany with hint string on 4.2+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "$$type": [ - "string", - "object" - ] - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged updateMany with hint document on 4.2+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "$$type": [ - "string", - "object" - ] - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateMany-hint.json b/driver-core/src/test/resources/unified-test-format/crud/updateMany-hint.json deleted file mode 100644 index 929be529946..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateMany-hint.json +++ /dev/null @@ -1,219 +0,0 @@ -{ - "description": "updateMany-hint", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_updatemany_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "UpdateMany with hint string", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_updatemany_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "hint": "_id_", - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 34 - } - ] - } - ] - }, - { - "description": "UpdateMany with hint document", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_updatemany_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "hint": { - "_id": 1 - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_updatemany_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 34 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateMany-let.json b/driver-core/src/test/resources/unified-test-format/crud/updateMany-let.json deleted file mode 100644 index cff3bd4c795..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateMany-let.json +++ /dev/null @@ -1,249 +0,0 @@ -{ - "description": "updateMany-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2, - "name": "name" - }, - { - "_id": 3, - "name": "name" - } - ] - } - ], - "tests": [ - { - "description": "updateMany with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$name", - "$$name" - ] - } - }, - "update": [ - { - "$set": { - "x": "$$x", - "y": "$$y" - } - } - ], - "let": { - "name": "name", - "x": "foo", - "y": { - "$literal": "bar" - } - } - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "$expr": { - "$eq": [ - "$name", - "$$name" - ] - } - }, - "u": [ - { - "$set": { - "x": "$$x", - "y": "$$y" - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "let": { - "name": "name", - "x": "foo", - "y": { - "$literal": "bar" - } - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2, - "name": "name", - "x": "foo", - "y": "bar" - }, - { - "_id": 3, - "name": "name", - "x": "foo", - "y": "bar" - } - ] - } - ] - }, - { - "description": "updateMany with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "x": "$$x" - } - } - ], - "let": { - "x": "foo" - } - }, - "expectError": { - "errorContains": "'update.let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$set": { - "x": "$$x" - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "let": { - "x": "foo" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2, - "name": "name" - }, - { - "_id": 3, - "name": "name" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateMany-validation.json b/driver-core/src/test/resources/unified-test-format/crud/updateMany-validation.json deleted file mode 100644 index e3e46a1384c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateMany-validation.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "description": "updateMany-validation", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "UpdateMany requires atomic modifiers", - "operations": [ - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "x": 44 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateMany.json b/driver-core/src/test/resources/unified-test-format/crud/updateMany.json deleted file mode 100644 index 19b890592ba..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateMany.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "description": "updateMany", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "2.6" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "UpdateMany when many documents match", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 34 - } - ] - } - ] - }, - { - "description": "UpdateMany when one document matches", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "UpdateMany when no documents match", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "UpdateMany with upsert when no documents match", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne-arrayFilters.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne-arrayFilters.json deleted file mode 100644 index be5d05b01ee..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne-arrayFilters.json +++ /dev/null @@ -1,453 +0,0 @@ -{ - "description": "updateOne-arrayFilters", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.5.6" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - }, - { - "_id": 3, - "y": [ - { - "b": 5, - "c": [ - { - "d": 2 - }, - { - "d": 1 - } - ] - } - ] - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne when no document matches arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 4 - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 0, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - }, - { - "_id": 3, - "y": [ - { - "b": 5, - "c": [ - { - "d": 2 - }, - { - "d": 1 - } - ] - } - ] - } - ] - } - ] - }, - { - "description": "UpdateOne when one document matches arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 3 - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 2 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - }, - { - "_id": 3, - "y": [ - { - "b": 5, - "c": [ - { - "d": 2 - }, - { - "d": 1 - } - ] - } - ] - } - ] - } - ] - }, - { - "description": "UpdateOne when multiple documents match arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": {}, - "update": { - "$set": { - "y.$[i].b": 2 - } - }, - "arrayFilters": [ - { - "i.b": 1 - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 2 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - }, - { - "_id": 3, - "y": [ - { - "b": 5, - "c": [ - { - "d": 2 - }, - { - "d": 1 - } - ] - } - ] - } - ] - } - ] - }, - { - "description": "UpdateOne when no documents match multiple arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 3 - }, - "update": { - "$set": { - "y.$[i].c.$[j].d": 0 - } - }, - "arrayFilters": [ - { - "i.b": 5 - }, - { - "j.d": 3 - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 0, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - }, - { - "_id": 3, - "y": [ - { - "b": 5, - "c": [ - { - "d": 2 - }, - { - "d": 1 - } - ] - } - ] - } - ] - } - ] - }, - { - "description": "UpdateOne when one document matches multiple arrayFilters", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 3 - }, - "update": { - "$set": { - "y.$[i].c.$[j].d": 0 - } - }, - "arrayFilters": [ - { - "i.b": 5 - }, - { - "j.d": 1 - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "y": [ - { - "b": 3 - }, - { - "b": 1 - } - ] - }, - { - "_id": 2, - "y": [ - { - "b": 0 - }, - { - "b": 1 - } - ] - }, - { - "_id": 3, - "y": [ - { - "b": 5, - "c": [ - { - "d": 2 - }, - { - "d": 0 - } - ] - } - ] - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne-collation.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne-collation.json deleted file mode 100644 index a39be46054b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne-collation.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "description": "updateOne-collation", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "ping" - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne when one document matches with collation", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "x": "PING" - }, - "update": { - "$set": { - "x": "pong" - } - }, - "collation": { - "locale": "en_US", - "strength": 2 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": "pong" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne-comment.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne-comment.json deleted file mode 100644 index f4ee74db38b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne-comment.json +++ /dev/null @@ -1,260 +0,0 @@ -{ - "description": "updateOne-comment", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne with string comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 22 - } - }, - "comment": "comment" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 22 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne with document comment", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 22 - } - }, - "comment": { - "key": "value" - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 22 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "comment": { - "key": "value" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne with comment - pre 4.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 22 - } - }, - "comment": "comment" - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 22 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "comment": "comment" - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne-dots_and_dollars.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne-dots_and_dollars.json deleted file mode 100644 index 798d522cba3..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne-dots_and_dollars.json +++ /dev/null @@ -1,412 +0,0 @@ -{ - "description": "updateOne-dots_and_dollars", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {} - } - ] - } - ], - "tests": [ - { - "description": "Updating document to set top-level dollar-prefixed key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {}, - "$a": 1 - } - ] - } - ] - }, - { - "description": "Updating document to set top-level dotted key on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$replaceWith": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$$ROOT" - } - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": {}, - "a.b": 1 - } - ] - } - ] - }, - { - "description": "Updating document to set dollar-prefixed key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "$a" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": { - "$a": 1 - } - } - ] - } - ] - }, - { - "description": "Updating document to set dotted key in embedded doc on 5.0+ server", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$set": { - "foo": { - "$setField": { - "field": { - "$literal": "a.b" - }, - "value": 1, - "input": "$foo" - } - } - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "foo": { - "a.b": 1 - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne-errorResponse.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne-errorResponse.json deleted file mode 100644 index 0ceddbc4fcd..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne-errorResponse.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "description": "updateOne-errorResponse", - "schemaVersion": "1.12", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "tests": [ - { - "description": "update operations support errorResponse assertions", - "runOnRequirements": [ - { - "minServerVersion": "4.0.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.2.0", - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 8 - } - } - } - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - }, - "expectError": { - "errorCode": 8, - "errorResponse": { - "code": 8 - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne-hint-clientError.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne-hint-clientError.json deleted file mode 100644 index d4f1a53430a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne-hint-clientError.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "updateOne-hint-clientError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "maxServerVersion": "3.3.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_updateone_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne with hint string unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne with hint document unsupported (client-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne-hint-serverError.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne-hint-serverError.json deleted file mode 100644 index 05fb0333190..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne-hint-serverError.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "description": "updateOne-hint-serverError", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.4.0", - "maxServerVersion": "4.1.9" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_updateone_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne with hint string unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_updateone_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_", - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne with hint document unsupported (server-side error)", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_updateone_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne-hint-unacknowledged.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne-hint-unacknowledged.json deleted file mode 100644 index 859b0f92f93..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne-hint-unacknowledged.json +++ /dev/null @@ -1,281 +0,0 @@ -{ - "description": "updateOne-hint-unacknowledged", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "db0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "db0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Unacknowledged updateOne with hint string fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged updateOne with hint document fails with client-side error on pre-4.2 server", - "runOnRequirements": [ - { - "maxServerVersion": "4.0.99" - } - ], - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Unacknowledged updateOne with hint string on 4.2+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "$$type": [ - "string", - "object" - ] - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - }, - { - "description": "Unacknowledged updateOne with hint document on 4.2+ server", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "acknowledged": { - "$$unsetOrMatches": false - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - }, - "hint": { - "$$type": [ - "string", - "object" - ] - } - } - ], - "writeConcern": { - "w": 0 - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne-hint.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne-hint.json deleted file mode 100644 index 484e00757dc..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne-hint.json +++ /dev/null @@ -1,211 +0,0 @@ -{ - "description": "updateOne-hint", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v2" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test_updateone_hint" - } - } - ], - "initialData": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne with hint string", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_" - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_updateone_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "hint": "_id_", - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - } - ] - } - ] - }, - { - "description": "UpdateOne with hint document", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test_updateone_hint", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "hint": { - "_id": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test_updateone_hint", - "databaseName": "crud-v2", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 23 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne-let.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne-let.json deleted file mode 100644 index e43b979358e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne-let.json +++ /dev/null @@ -1,227 +0,0 @@ -{ - "description": "updateOne-let", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne with let option", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "update": [ - { - "$set": { - "x": "$$x" - } - } - ], - "let": { - "id": 1, - "x": "foo" - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "$expr": { - "$eq": [ - "$_id", - "$$id" - ] - } - }, - "u": [ - { - "$set": { - "x": "$$x" - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "let": { - "id": 1, - "x": "foo" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": "foo" - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "UpdateOne with let option unsupported (server-side error)", - "runOnRequirements": [ - { - "minServerVersion": "4.2.0", - "maxServerVersion": "4.4.99" - } - ], - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$set": { - "x": "$$x" - } - } - ], - "let": { - "x": "foo" - } - }, - "expectError": { - "errorContains": "'update.let' is an unknown field", - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$set": { - "x": "$$x" - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "let": { - "x": "foo" - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne-sort.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne-sort.json deleted file mode 100644 index 8fe4f50b94f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne-sort.json +++ /dev/null @@ -1,240 +0,0 @@ -{ - "description": "updateOne-sort", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne with sort option", - "runOnRequirements": [ - { - "minServerVersion": "8.0" - } - ], - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "sort": { - "_id": -1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "sort": { - "_id": -1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "n": 1 - }, - "commandName": "update" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 34 - } - ] - } - ] - }, - { - "description": "updateOne with sort option unsupported (server-side error)", - "runOnRequirements": [ - { - "maxServerVersion": "7.99" - } - ], - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "sort": { - "_id": -1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll0", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "sort": { - "_id": -1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne-validation.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne-validation.json deleted file mode 100644 index 1464642c59c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne-validation.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "description": "updateOne-validation", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne requires atomic modifiers", - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "x": 22 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateOne.json b/driver-core/src/test/resources/unified-test-format/crud/updateOne.json deleted file mode 100644 index a3f559673e5..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateOne.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "description": "updateOne", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "2.6" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-v1" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne when many documents match", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ] - }, - { - "description": "UpdateOne when one document matches", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "UpdateOne when no documents match", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "UpdateOne with upsert when no documents match", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "crud-v1", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/crud/updateWithPipelines.json b/driver-core/src/test/resources/unified-test-format/crud/updateWithPipelines.json deleted file mode 100644 index 164f2f6a199..00000000000 --- a/driver-core/src/test/resources/unified-test-format/crud/updateWithPipelines.json +++ /dev/null @@ -1,494 +0,0 @@ -{ - "description": "updateWithPipelines", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.1.11" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 1, - "y": 1, - "t": { - "u": { - "v": 1 - } - } - }, - { - "_id": 2, - "x": 2, - "y": 1 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne using pipelines", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$replaceRoot": { - "newRoot": "$t" - } - }, - { - "$addFields": { - "foo": 1 - } - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$replaceRoot": { - "newRoot": "$t" - } - }, - { - "$addFields": { - "foo": 1 - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - }, - "commandName": "update", - "databaseName": "crud-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "u": { - "v": 1 - }, - "foo": 1 - }, - { - "_id": 2, - "x": 2, - "y": 1 - } - ] - } - ] - }, - { - "description": "UpdateMany using pipelines", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": {}, - "update": [ - { - "$project": { - "x": 1 - } - }, - { - "$addFields": { - "foo": 1 - } - } - ] - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": {}, - "u": [ - { - "$project": { - "x": 1 - } - }, - { - "$addFields": { - "foo": 1 - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - }, - "commandName": "update", - "databaseName": "crud-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 1, - "foo": 1 - }, - { - "_id": 2, - "x": 2, - "foo": 1 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate using pipelines", - "operations": [ - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$project": { - "x": 1 - } - }, - { - "$addFields": { - "foo": 1 - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "update": [ - { - "$project": { - "x": 1 - } - }, - { - "$addFields": { - "foo": 1 - } - } - ] - }, - "commandName": "findAndModify", - "databaseName": "crud-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 1, - "foo": 1 - }, - { - "_id": 2, - "x": 2, - "y": 1 - } - ] - } - ] - }, - { - "description": "UpdateOne in bulk write using pipelines", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": [ - { - "$replaceRoot": { - "newRoot": "$t" - } - }, - { - "$addFields": { - "foo": 1 - } - } - ] - } - } - ] - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": [ - { - "$replaceRoot": { - "newRoot": "$t" - } - }, - { - "$addFields": { - "foo": 1 - } - } - ], - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - }, - "commandName": "update", - "databaseName": "crud-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "u": { - "v": 1 - }, - "foo": 1 - }, - { - "_id": 2, - "x": 2, - "y": 1 - } - ] - } - ] - }, - { - "description": "UpdateMany in bulk write using pipelines", - "operations": [ - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": {}, - "update": [ - { - "$project": { - "x": 1 - } - }, - { - "$addFields": { - "foo": 1 - } - } - ] - } - } - ] - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": {}, - "u": [ - { - "$project": { - "x": 1 - } - }, - { - "$addFields": { - "foo": 1 - } - } - ], - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ] - }, - "commandName": "update", - "databaseName": "crud-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 1, - "foo": 1 - }, - { - "_id": 2, - "x": 2, - "foo": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/delete.json b/driver-core/src/test/resources/unified-test-format/gridfs/delete.json deleted file mode 100644 index 277b9ed7e17..00000000000 --- a/driver-core/src/test/resources/unified-test-format/gridfs/delete.json +++ /dev/null @@ -1,739 +0,0 @@ -{ - "description": "gridfs-delete", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "gridfs-tests" - } - }, - { - "bucket": { - "id": "bucket0", - "database": "database0" - } - }, - { - "collection": { - "id": "bucket0_files_collection", - "database": "database0", - "collectionName": "fs.files" - } - }, - { - "collection": { - "id": "bucket0_chunks_collection", - "database": "database0", - "collectionName": "fs.chunks" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-0", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-0-with-empty-chunk", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-2", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-8", - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "files_id": { - "$oid": "000000000000000000000002" - }, - "n": 0, - "data": { - "$binary": { - "base64": "", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000003" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" - } - } - } - ] - } - ], - "tests": [ - { - "description": "delete when length is 0", - "operations": [ - { - "name": "delete", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - } - } - ], - "outcome": [ - { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-0-with-empty-chunk", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-2", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-8", - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "files_id": { - "$oid": "000000000000000000000002" - }, - "n": 0, - "data": { - "$binary": { - "base64": "", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000003" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" - } - } - } - ] - } - ] - }, - { - "description": "delete when length is 0 and there is one extra empty chunk", - "operations": [ - { - "name": "delete", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000002" - } - } - } - ], - "outcome": [ - { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-0", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-2", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-8", - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000003" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" - } - } - } - ] - } - ] - }, - { - "description": "delete when length is 8", - "operations": [ - { - "name": "delete", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000004" - } - } - } - ], - "outcome": [ - { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-0", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-0-with-empty-chunk", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-2", - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "files_id": { - "$oid": "000000000000000000000002" - }, - "n": 0, - "data": { - "$binary": { - "base64": "", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000003" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" - } - } - } - ] - } - ] - }, - { - "description": "delete when files entry does not exist", - "operations": [ - { - "name": "delete", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000000" - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-0", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-0-with-empty-chunk", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-2", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-8", - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "files_id": { - "$oid": "000000000000000000000002" - }, - "n": 0, - "data": { - "$binary": { - "base64": "", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000003" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" - } - } - } - ] - } - ] - }, - { - "description": "delete when files entry does not exist and there are orphaned chunks", - "operations": [ - { - "name": "deleteOne", - "object": "bucket0_files_collection", - "arguments": { - "filter": { - "_id": { - "$oid": "000000000000000000000004" - } - } - }, - "expectResult": { - "deletedCount": 1 - } - }, - { - "name": "delete", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000004" - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-0", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-0-with-empty-chunk", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-2", - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "files_id": { - "$oid": "000000000000000000000002" - }, - "n": 0, - "data": { - "$binary": { - "base64": "", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000003" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/download.json b/driver-core/src/test/resources/unified-test-format/gridfs/download.json deleted file mode 100644 index f0cb8517088..00000000000 --- a/driver-core/src/test/resources/unified-test-format/gridfs/download.json +++ /dev/null @@ -1,540 +0,0 @@ -{ - "description": "gridfs-download", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "gridfs-tests" - } - }, - { - "bucket": { - "id": "bucket0", - "database": "database0" - } - }, - { - "collection": { - "id": "bucket0_files_collection", - "database": "database0", - "collectionName": "fs.files" - } - }, - { - "collection": { - "id": "bucket0_chunks_collection", - "database": "database0", - "collectionName": "fs.chunks" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-0", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-0-with-empty-chunk", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-2", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-8", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000005" - }, - "length": 10, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "length-10", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000006" - }, - "length": 2, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "files_id": { - "$oid": "000000000000000000000002" - }, - "n": 0, - "data": { - "$binary": { - "base64": "", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000003" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000005" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000006" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000007" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 2, - "data": { - "$binary": { - "base64": "mao=", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000008" - }, - "files_id": { - "$oid": "000000000000000000000006" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESI=", - "subType": "00" - } - } - } - ] - } - ], - "tests": [ - { - "description": "download when length is zero", - "operations": [ - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "" - } - } - ] - }, - { - "description": "download when length is zero and there is one empty chunk", - "operations": [ - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000002" - } - }, - "expectResult": { - "$$matchesHexBytes": "" - } - } - ] - }, - { - "description": "download when there is one chunk", - "operations": [ - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000003" - } - }, - "expectResult": { - "$$matchesHexBytes": "1122" - } - } - ] - }, - { - "description": "download when there are two chunks", - "operations": [ - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000004" - } - }, - "expectResult": { - "$$matchesHexBytes": "1122334455667788" - } - } - ] - }, - { - "description": "download when there are three chunks", - "operations": [ - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectResult": { - "$$matchesHexBytes": "112233445566778899aa" - } - } - ] - }, - { - "description": "download when files entry does not exist", - "operations": [ - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000000" - } - }, - "expectError": { - "isError": true - } - } - ] - }, - { - "description": "download when an intermediate chunk is missing", - "operations": [ - { - "name": "deleteOne", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": { - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - }, - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectError": { - "isError": true - } - } - ] - }, - { - "description": "download when final chunk is missing", - "operations": [ - { - "name": "deleteOne", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": { - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 2 - } - }, - "expectResult": { - "deletedCount": 1 - } - }, - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectError": { - "isError": true - } - } - ] - }, - { - "description": "download when an intermediate chunk is the wrong size", - "operations": [ - { - "name": "bulkWrite", - "object": "bucket0_chunks_collection", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 1 - }, - "update": { - "$set": { - "data": { - "$binary": { - "base64": "VWZ3", - "subType": "00" - } - } - } - } - } - }, - { - "updateOne": { - "filter": { - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 2 - }, - "update": { - "$set": { - "data": { - "$binary": { - "base64": "iJmq", - "subType": "00" - } - } - } - } - } - } - ] - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2 - } - }, - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectError": { - "isError": true - } - } - ] - }, - { - "description": "download when final chunk is the wrong size", - "operations": [ - { - "name": "updateOne", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": { - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 2 - }, - "update": { - "$set": { - "data": { - "$binary": { - "base64": "mQ==", - "subType": "00" - } - } - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1 - } - }, - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectError": { - "isError": true - } - } - ] - }, - { - "description": "download legacy file with no name", - "operations": [ - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000006" - } - }, - "expectResult": { - "$$matchesHexBytes": "1122" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/downloadByName.json b/driver-core/src/test/resources/unified-test-format/gridfs/downloadByName.json deleted file mode 100644 index 7b20933c163..00000000000 --- a/driver-core/src/test/resources/unified-test-format/gridfs/downloadByName.json +++ /dev/null @@ -1,315 +0,0 @@ -{ - "description": "gridfs-downloadByName", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "gridfs-tests" - } - }, - { - "bucket": { - "id": "bucket0", - "database": "database0" - } - }, - { - "collection": { - "id": "bucket0_files_collection", - "database": "database0", - "collectionName": "fs.files" - } - }, - { - "collection": { - "id": "bucket0_chunks_collection", - "database": "database0", - "collectionName": "fs.chunks" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-02T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-03T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-04T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - }, - { - "_id": { - "$oid": "000000000000000000000005" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-05T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "files_id": { - "$oid": "000000000000000000000001" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000002" - }, - "n": 0, - "data": { - "$binary": { - "base64": "Ig==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000003" - }, - "files_id": { - "$oid": "000000000000000000000003" - }, - "n": 0, - "data": { - "$binary": { - "base64": "Mw==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000004" - }, - "files_id": { - "$oid": "000000000000000000000004" - }, - "n": 0, - "data": { - "$binary": { - "base64": "RA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000005" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 0, - "data": { - "$binary": { - "base64": "VQ==", - "subType": "00" - } - } - } - ] - } - ], - "tests": [ - { - "description": "downloadByName defaults to latest revision (-1)", - "operations": [ - { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "55" - } - } - ] - }, - { - "description": "downloadByName when revision is 0", - "operations": [ - { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc", - "revision": 0 - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ] - }, - { - "description": "downloadByName when revision is 1", - "operations": [ - { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc", - "revision": 1 - }, - "expectResult": { - "$$matchesHexBytes": "22" - } - } - ] - }, - { - "description": "downloadByName when revision is 2", - "operations": [ - { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc", - "revision": 2 - }, - "expectResult": { - "$$matchesHexBytes": "33" - } - } - ] - }, - { - "description": "downloadByName when revision is -2", - "operations": [ - { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc", - "revision": -2 - }, - "expectResult": { - "$$matchesHexBytes": "44" - } - } - ] - }, - { - "description": "downloadByName when revision is -1", - "operations": [ - { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc", - "revision": -1 - }, - "expectResult": { - "$$matchesHexBytes": "55" - } - } - ] - }, - { - "description": "downloadByName when files entry does not exist", - "operations": [ - { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "xyz" - }, - "expectError": { - "isError": true - } - } - ] - }, - { - "description": "downloadByName when revision does not exist", - "operations": [ - { - "name": "downloadByName", - "object": "bucket0", - "arguments": { - "filename": "abc", - "revision": 999 - }, - "expectError": { - "isError": true - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/upload-disableMD5.json b/driver-core/src/test/resources/unified-test-format/gridfs/upload-disableMD5.json deleted file mode 100644 index d5a9d6f4ab0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/gridfs/upload-disableMD5.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "description": "gridfs-upload-disableMD5", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "gridfs-tests" - } - }, - { - "bucket": { - "id": "bucket0", - "database": "database0" - } - }, - { - "collection": { - "id": "bucket0_files_collection", - "database": "database0", - "collectionName": "fs.files" - } - }, - { - "collection": { - "id": "bucket0_chunks_collection", - "database": "database0", - "collectionName": "fs.chunks" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [] - }, - { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "upload when length is 0 sans MD5", - "operations": [ - { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "" - }, - "chunkSizeBytes": 4, - "disableMD5": true - }, - "expectResult": { - "$$type": "objectId" - }, - "saveResultAsEntity": "uploadedObjectId" - }, - { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" - }, - "md5": { - "$$exists": false - }, - "filename": "filename" - } - ] - }, - { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} - }, - "expectResult": [] - } - ] - }, - { - "description": "upload when length is 1 sans MD5", - "operations": [ - { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "11" - }, - "chunkSizeBytes": 4, - "disableMD5": true - }, - "expectResult": { - "$$type": "objectId" - }, - "saveResultAsEntity": "uploadedObjectId" - }, - { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" - }, - "md5": { - "$$exists": false - }, - "filename": "filename" - } - ] - }, - { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$type": "objectId" - }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/gridfs/upload.json b/driver-core/src/test/resources/unified-test-format/gridfs/upload.json deleted file mode 100644 index 3c1644653a5..00000000000 --- a/driver-core/src/test/resources/unified-test-format/gridfs/upload.json +++ /dev/null @@ -1,547 +0,0 @@ -{ - "description": "gridfs-upload", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "gridfs-tests" - } - }, - { - "bucket": { - "id": "bucket0", - "database": "database0" - } - }, - { - "collection": { - "id": "bucket0_files_collection", - "database": "database0", - "collectionName": "fs.files" - } - }, - { - "collection": { - "id": "bucket0_chunks_collection", - "database": "database0", - "collectionName": "fs.chunks" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [] - }, - { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "upload when length is 0", - "operations": [ - { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "" - }, - "chunkSizeBytes": 4 - }, - "expectResult": { - "$$type": "objectId" - }, - "saveResultAsEntity": "uploadedObjectId" - }, - { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "length": 0, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" - }, - "md5": { - "$$unsetOrMatches": "d41d8cd98f00b204e9800998ecf8427e" - }, - "filename": "filename" - } - ] - }, - { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} - }, - "expectResult": [] - } - ] - }, - { - "description": "upload when length is 1", - "operations": [ - { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "11" - }, - "chunkSizeBytes": 4 - }, - "expectResult": { - "$$type": "objectId" - }, - "saveResultAsEntity": "uploadedObjectId" - }, - { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" - }, - "md5": { - "$$unsetOrMatches": "47ed733b8d10be225eceba344d533586" - }, - "filename": "filename" - } - ] - }, - { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$type": "objectId" - }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - } - ] - } - ] - }, - { - "description": "upload when length is 3", - "operations": [ - { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "112233" - }, - "chunkSizeBytes": 4 - }, - "expectResult": { - "$$type": "objectId" - }, - "saveResultAsEntity": "uploadedObjectId" - }, - { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "length": 3, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" - }, - "md5": { - "$$unsetOrMatches": "bafae3a174ab91fc70db7a6aa50f4f52" - }, - "filename": "filename" - } - ] - }, - { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$type": "objectId" - }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIz", - "subType": "00" - } - } - } - ] - } - ] - }, - { - "description": "upload when length is 4", - "operations": [ - { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "11223344" - }, - "chunkSizeBytes": 4 - }, - "expectResult": { - "$$type": "objectId" - }, - "saveResultAsEntity": "uploadedObjectId" - }, - { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "length": 4, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" - }, - "md5": { - "$$unsetOrMatches": "7e7c77cff5705d1f7574a25ef6662117" - }, - "filename": "filename" - } - ] - }, - { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$type": "objectId" - }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - } - ] - } - ] - }, - { - "description": "upload when length is 5", - "operations": [ - { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455" - }, - "chunkSizeBytes": 4 - }, - "expectResult": { - "$$type": "objectId" - }, - "saveResultAsEntity": "uploadedObjectId" - }, - { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "length": 5, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" - }, - "md5": { - "$$unsetOrMatches": "283d4fea5dded59cf837d3047328f5af" - }, - "filename": "filename" - } - ] - }, - { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {}, - "sort": { - "n": 1 - } - }, - "expectResult": [ - { - "_id": { - "$$type": "objectId" - }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$$type": "objectId" - }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "n": 1, - "data": { - "$binary": { - "base64": "VQ==", - "subType": "00" - } - } - } - ] - } - ] - }, - { - "description": "upload when length is 8", - "operations": [ - { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455667788" - }, - "chunkSizeBytes": 4 - }, - "expectResult": { - "$$type": "objectId" - }, - "saveResultAsEntity": "uploadedObjectId" - }, - { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "length": 8, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" - }, - "md5": { - "$$unsetOrMatches": "dd254cdc958e53abaa67da9f797125f5" - }, - "filename": "filename" - } - ] - }, - { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {}, - "sort": { - "n": 1 - } - }, - "expectResult": [ - { - "_id": { - "$$type": "objectId" - }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$$type": "objectId" - }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" - } - } - } - ] - } - ] - }, - { - "description": "upload when metadata is provided", - "operations": [ - { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "11" - }, - "chunkSizeBytes": 4, - "metadata": { - "x": 1 - } - }, - "expectResult": { - "$$type": "objectId" - }, - "saveResultAsEntity": "uploadedObjectId" - }, - { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" - }, - "md5": { - "$$unsetOrMatches": "47ed733b8d10be225eceba344d533586" - }, - "filename": "filename", - "metadata": { - "x": 1 - } - } - ] - }, - { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": { - "$$type": "objectId" - }, - "files_id": { - "$$matchesEntity": "uploadedObjectId" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/index-management/createSearchIndex.json b/driver-core/src/test/resources/unified-test-format/index-management/createSearchIndex.json deleted file mode 100644 index f4f2a6c6612..00000000000 --- a/driver-core/src/test/resources/unified-test-format/index-management/createSearchIndex.json +++ /dev/null @@ -1,210 +0,0 @@ -{ - "description": "createSearchIndex", - "schemaVersion": "1.4", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - } - ], - "runOnRequirements": [ - { - "minServerVersion": "7.0.5", - "maxServerVersion": "7.0.99", - "topologies": [ - "replicaset", - "load-balanced", - "sharded" - ], - "serverless": "forbid" - }, - { - "minServerVersion": "7.2.0", - "topologies": [ - "replicaset", - "load-balanced", - "sharded" - ], - "serverless": "forbid" - } - ], - "tests": [ - { - "description": "no name provided for an index definition", - "operations": [ - { - "name": "createSearchIndex", - "object": "collection0", - "arguments": { - "model": { - "definition": { - "mappings": { - "dynamic": true - } - }, - "type": "search" - } - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "createSearchIndexes": "collection0", - "indexes": [ - { - "definition": { - "mappings": { - "dynamic": true - } - }, - "type": "search" - } - ], - "$db": "database0" - } - } - } - ] - } - ] - }, - { - "description": "name provided for an index definition", - "operations": [ - { - "name": "createSearchIndex", - "object": "collection0", - "arguments": { - "model": { - "definition": { - "mappings": { - "dynamic": true - } - }, - "name": "test index", - "type": "search" - } - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "createSearchIndexes": "collection0", - "indexes": [ - { - "definition": { - "mappings": { - "dynamic": true - } - }, - "name": "test index", - "type": "search" - } - ], - "$db": "database0" - } - } - } - ] - } - ] - }, - { - "description": "create a vector search index", - "operations": [ - { - "name": "createSearchIndex", - "object": "collection0", - "arguments": { - "model": { - "definition": { - "fields": [ - { - "type": "vector", - "path": "plot_embedding", - "numDimensions": 1536, - "similarity": "euclidean" - } - ] - }, - "name": "test index", - "type": "vectorSearch" - } - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "createSearchIndexes": "collection0", - "indexes": [ - { - "definition": { - "fields": [ - { - "type": "vector", - "path": "plot_embedding", - "numDimensions": 1536, - "similarity": "euclidean" - } - ] - }, - "name": "test index", - "type": "vectorSearch" - } - ], - "$db": "database0" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/index-management/createSearchIndexes.json b/driver-core/src/test/resources/unified-test-format/index-management/createSearchIndexes.json deleted file mode 100644 index 01300b1b7f4..00000000000 --- a/driver-core/src/test/resources/unified-test-format/index-management/createSearchIndexes.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "description": "createSearchIndexes", - "schemaVersion": "1.4", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - } - ], - "runOnRequirements": [ - { - "minServerVersion": "7.0.5", - "maxServerVersion": "7.0.99", - "topologies": [ - "replicaset", - "load-balanced", - "sharded" - ], - "serverless": "forbid" - }, - { - "minServerVersion": "7.2.0", - "topologies": [ - "replicaset", - "load-balanced", - "sharded" - ], - "serverless": "forbid" - } - ], - "tests": [ - { - "description": "empty index definition array", - "operations": [ - { - "name": "createSearchIndexes", - "object": "collection0", - "arguments": { - "models": [] - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "createSearchIndexes": "collection0", - "indexes": [], - "$db": "database0" - } - } - } - ] - } - ] - }, - { - "description": "no name provided for an index definition", - "operations": [ - { - "name": "createSearchIndexes", - "object": "collection0", - "arguments": { - "models": [ - { - "definition": { - "mappings": { - "dynamic": true - } - }, - "type": "search" - } - ] - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "createSearchIndexes": "collection0", - "indexes": [ - { - "definition": { - "mappings": { - "dynamic": true - } - }, - "type": "search" - } - ], - "$db": "database0" - } - } - } - ] - } - ] - }, - { - "description": "name provided for an index definition", - "operations": [ - { - "name": "createSearchIndexes", - "object": "collection0", - "arguments": { - "models": [ - { - "definition": { - "mappings": { - "dynamic": true - } - }, - "name": "test index", - "type": "search" - } - ] - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "createSearchIndexes": "collection0", - "indexes": [ - { - "definition": { - "mappings": { - "dynamic": true - } - }, - "name": "test index", - "type": "search" - } - ], - "$db": "database0" - } - } - } - ] - } - ] - }, - { - "description": "create a vector search index", - "operations": [ - { - "name": "createSearchIndexes", - "object": "collection0", - "arguments": { - "models": [ - { - "definition": { - "fields": [ - { - "type": "vector", - "path": "plot_embedding", - "numDimensions": 1536, - "similarity": "euclidean" - } - ] - }, - "name": "test index", - "type": "vectorSearch" - } - ] - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "createSearchIndexes": "collection0", - "indexes": [ - { - "definition": { - "fields": [ - { - "type": "vector", - "path": "plot_embedding", - "numDimensions": 1536, - "similarity": "euclidean" - } - ] - }, - "name": "test index", - "type": "vectorSearch" - } - ], - "$db": "database0" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/index-management/dropSearchIndex.json b/driver-core/src/test/resources/unified-test-format/index-management/dropSearchIndex.json deleted file mode 100644 index d8957a22270..00000000000 --- a/driver-core/src/test/resources/unified-test-format/index-management/dropSearchIndex.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "description": "dropSearchIndex", - "schemaVersion": "1.4", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - } - ], - "runOnRequirements": [ - { - "minServerVersion": "7.0.0", - "topologies": [ - "replicaset", - "load-balanced", - "sharded" - ], - "serverless": "forbid" - } - ], - "tests": [ - { - "description": "sends the correct command", - "operations": [ - { - "name": "dropSearchIndex", - "object": "collection0", - "arguments": { - "name": "test index" - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "dropSearchIndex": "collection0", - "name": "test index", - "$db": "database0" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/index-management/listSearchIndexes.json b/driver-core/src/test/resources/unified-test-format/index-management/listSearchIndexes.json deleted file mode 100644 index a8cef42f7a4..00000000000 --- a/driver-core/src/test/resources/unified-test-format/index-management/listSearchIndexes.json +++ /dev/null @@ -1,156 +0,0 @@ -{ - "description": "listSearchIndexes", - "schemaVersion": "1.4", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - } - ], - "runOnRequirements": [ - { - "minServerVersion": "7.0.0", - "topologies": [ - "replicaset", - "load-balanced", - "sharded" - ], - "serverless": "forbid" - } - ], - "tests": [ - { - "description": "when no name is provided, it does not populate the filter", - "operations": [ - { - "name": "listSearchIndexes", - "object": "collection0", - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "pipeline": [ - { - "$listSearchIndexes": {} - } - ] - } - } - } - ] - } - ] - }, - { - "description": "when a name is provided, it is present in the filter", - "operations": [ - { - "name": "listSearchIndexes", - "object": "collection0", - "arguments": { - "name": "test index" - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "pipeline": [ - { - "$listSearchIndexes": { - "name": "test index" - } - } - ], - "$db": "database0" - } - } - } - ] - } - ] - }, - { - "description": "aggregation cursor options are supported", - "operations": [ - { - "name": "listSearchIndexes", - "object": "collection0", - "arguments": { - "name": "test index", - "aggregationOptions": { - "batchSize": 10 - } - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "cursor": { - "batchSize": 10 - }, - "pipeline": [ - { - "$listSearchIndexes": { - "name": "test index" - } - } - ], - "$db": "database0" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/index-management/searchIndexIgnoresReadWriteConcern.json b/driver-core/src/test/resources/unified-test-format/index-management/searchIndexIgnoresReadWriteConcern.json deleted file mode 100644 index edf71b7b7e4..00000000000 --- a/driver-core/src/test/resources/unified-test-format/index-management/searchIndexIgnoresReadWriteConcern.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "description": "search index operations ignore read and write concern", - "schemaVersion": "1.4", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "uriOptions": { - "readConcernLevel": "local", - "w": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - } - ], - "runOnRequirements": [ - { - "minServerVersion": "7.0.0", - "topologies": [ - "replicaset", - "load-balanced", - "sharded" - ], - "serverless": "forbid" - } - ], - "tests": [ - { - "description": "createSearchIndex ignores read and write concern", - "operations": [ - { - "name": "createSearchIndex", - "object": "collection0", - "arguments": { - "model": { - "definition": { - "mappings": { - "dynamic": true - } - } - } - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "createSearchIndexes": "collection0", - "indexes": [ - { - "definition": { - "mappings": { - "dynamic": true - } - } - } - ], - "$db": "database0", - "writeConcern": { - "$$exists": false - }, - "readConcern": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "createSearchIndexes ignores read and write concern", - "operations": [ - { - "name": "createSearchIndexes", - "object": "collection0", - "arguments": { - "models": [] - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "createSearchIndexes": "collection0", - "indexes": [], - "$db": "database0", - "writeConcern": { - "$$exists": false - }, - "readConcern": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "dropSearchIndex ignores read and write concern", - "operations": [ - { - "name": "dropSearchIndex", - "object": "collection0", - "arguments": { - "name": "test index" - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "dropSearchIndex": "collection0", - "name": "test index", - "$db": "database0", - "writeConcern": { - "$$exists": false - }, - "readConcern": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "listSearchIndexes ignores read and write concern", - "operations": [ - { - "name": "listSearchIndexes", - "object": "collection0", - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "pipeline": [ - { - "$listSearchIndexes": {} - } - ], - "writeConcern": { - "$$exists": false - }, - "readConcern": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "updateSearchIndex ignores the read and write concern", - "operations": [ - { - "name": "updateSearchIndex", - "object": "collection0", - "arguments": { - "name": "test index", - "definition": {} - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "updateSearchIndex": "collection0", - "name": "test index", - "definition": {}, - "$db": "database0", - "writeConcern": { - "$$exists": false - }, - "readConcern": { - "$$exists": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/index-management/updateSearchIndex.json b/driver-core/src/test/resources/unified-test-format/index-management/updateSearchIndex.json deleted file mode 100644 index 76a59621468..00000000000 --- a/driver-core/src/test/resources/unified-test-format/index-management/updateSearchIndex.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "description": "updateSearchIndex", - "schemaVersion": "1.4", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - } - ], - "runOnRequirements": [ - { - "minServerVersion": "7.0.0", - "topologies": [ - "replicaset", - "load-balanced", - "sharded" - ], - "serverless": "forbid" - } - ], - "tests": [ - { - "description": "sends the correct command", - "operations": [ - { - "name": "updateSearchIndex", - "object": "collection0", - "arguments": { - "name": "test index", - "definition": {} - }, - "expectError": { - "isError": true, - "errorContains": "Atlas" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "updateSearchIndex": "collection0", - "name": "test index", - "definition": {}, - "$db": "database0" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/load-balancers/README.md b/driver-core/src/test/resources/unified-test-format/load-balancers/README.md deleted file mode 100644 index 45f185caa61..00000000000 --- a/driver-core/src/test/resources/unified-test-format/load-balancers/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# Load Balancer Support Tests - -______________________________________________________________________ - -## Introduction - -This document describes how drivers should create load balanced clusters for testing and how tests should be executed -for such clusters. - -## Testing Requirements - -For each server version that supports load balanced clusters, drivers MUST add two Evergreen tasks: one with a sharded -cluster with both authentication and TLS enabled and one with a sharded cluster with authentication and TLS disabled. In -each task, the sharded cluster MUST be configured with two mongos nodes running on localhost ports 27017 and 27018. The -shard and config servers may run on any free ports. Each task MUST also start up two TCP load balancers operating in -round-robin mode: one fronting both mongos servers and one fronting a single mongos. - -### Load Balancer Configuration - -Drivers MUST use the `run-load-balancer.sh` script in `drivers-evergreen-tools` to start the TCP load balancers for -Evergreen tasks. This script MUST be run after the backing sharded cluster has already been started. The script writes -the URIs of the load balancers to a YAML expansions file, which can be read by drivers via the `expansions.update` -Evergreen command. This will store the URIs into the `SINGLE_MONGOS_LB_URI` and `MULTI_MONGOS_LB_URI` environment -variables. - -### Test Runner Configuration - -If the backing sharded cluster is configured with TLS enabled, drivers MUST add the relevant TLS options to both -`SINGLE_MONGOS_LB_URI` and `MULTI_MONGOS_LB_URI` to ensure that test clients can connect to the cluster. Drivers MUST -use the final URI stored in `SINGLE_MONGOS_LB_URI` (with additional TLS options if required) to configure internal -clients for test runners (e.g. the internal MongoClient described by the -[Unified Test Format spec](../../unified-test-format/unified-test-format.md)). - -In addition to modifying load balancer URIs, drivers MUST also mock server support for returning a `serviceId` field in -`hello` or legacy `hello` command responses when running tests against a load-balanced cluster. This can be done by -using the value of `topologyVersion.processId` to set `serviceId`. This MUST be done for all connections established by -the test runner, including those made by any internal clients. - -## Tests - -The YAML and JSON files in this directory contain platform-independent tests written in the -[Unified Test Format](../../unified-test-format/unified-test-format.md). Drivers MUST run the following test suites -against a load balanced cluster: - -1. All test suites written in the Unified Test Format -2. Retryable Reads -3. Retryable Writes -4. Change Streams -5. Initial DNS Seedlist Discovery diff --git a/driver-core/src/test/resources/unified-test-format/load-balancers/cursors.json b/driver-core/src/test/resources/unified-test-format/load-balancers/cursors.json deleted file mode 100644 index b11bf2c6fae..00000000000 --- a/driver-core/src/test/resources/unified-test-format/load-balancers/cursors.json +++ /dev/null @@ -1,1271 +0,0 @@ -{ - "description": "cursors are correctly pinned to connections for load-balanced clusters", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "topologies": [ - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent", - "connectionReadyEvent", - "connectionClosedEvent", - "connectionCheckedOutEvent", - "connectionCheckedInEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - }, - { - "collection": { - "id": "collection1", - "database": "database0", - "collectionName": "coll1" - } - }, - { - "collection": { - "id": "collection2", - "database": "database0", - "collectionName": "coll2" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0Name", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - }, - { - "collectionName": "coll1", - "databaseName": "database0Name", - "documents": [] - }, - { - "collectionName": "coll2", - "databaseName": "database0Name", - "documents": [] - } - ], - "tests": [ - { - "description": "no connection is pinned if all documents are returned in the initial batch", - "operations": [ - { - "name": "createFindCursor", - "object": "collection0", - "arguments": { - "filter": {} - }, - "saveResultAsEntity": "cursor0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": {} - }, - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursor": { - "id": 0, - "firstBatch": { - "$$type": "array" - }, - "ns": { - "$$type": "string" - } - } - }, - "commandName": "find" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connections are returned when the cursor is drained", - "operations": [ - { - "name": "createFindCursor", - "object": "collection0", - "arguments": { - "filter": {}, - "batchSize": 2 - }, - "saveResultAsEntity": "cursor0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectResult": { - "_id": 1 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectResult": { - "_id": 2 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectResult": { - "_id": 3 - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - }, - { - "name": "close", - "object": "cursor0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": {}, - "batchSize": 2 - }, - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursor": { - "id": { - "$$type": [ - "int", - "long" - ] - }, - "firstBatch": { - "$$type": "array" - }, - "ns": { - "$$type": "string" - } - } - }, - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0" - }, - "commandName": "getMore" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursor": { - "id": 0, - "ns": { - "$$type": "string" - }, - "nextBatch": { - "$$type": "array" - } - } - }, - "commandName": "getMore" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connections are returned to the pool when the cursor is closed", - "operations": [ - { - "name": "createFindCursor", - "object": "collection0", - "arguments": { - "filter": {}, - "batchSize": 2 - }, - "saveResultAsEntity": "cursor0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "close", - "object": "cursor0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": {}, - "batchSize": 2 - }, - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursor": { - "id": { - "$$type": [ - "int", - "long" - ] - }, - "firstBatch": { - "$$type": "array" - }, - "ns": { - "$$type": "string" - } - } - }, - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "killCursors" - } - }, - { - "commandSucceededEvent": { - "commandName": "killCursors" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connections are not returned after an network error during getMore", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "closeConnection": true - } - } - } - }, - { - "name": "createFindCursor", - "object": "collection0", - "arguments": { - "filter": {}, - "batchSize": 2 - }, - "saveResultAsEntity": "cursor0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectResult": { - "_id": 1 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectResult": { - "_id": 2 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectError": { - "isClientError": true - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "close", - "object": "cursor0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": {}, - "batchSize": 2 - }, - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursor": { - "id": { - "$$type": [ - "int", - "long" - ] - }, - "firstBatch": { - "$$type": "array" - }, - "ns": { - "$$type": "string" - } - } - }, - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0" - }, - "commandName": "getMore" - } - }, - { - "commandFailedEvent": { - "commandName": "getMore" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionClosedEvent": { - "reason": "error" - } - } - ] - } - ] - }, - { - "description": "pinned connections are returned after a network error during a killCursors request", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "killCursors" - ], - "closeConnection": true - } - } - } - }, - { - "name": "createFindCursor", - "object": "collection0", - "arguments": { - "filter": {}, - "batchSize": 2 - }, - "saveResultAsEntity": "cursor0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "close", - "object": "cursor0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": {}, - "batchSize": 2 - }, - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursor": { - "id": { - "$$type": [ - "int", - "long" - ] - }, - "firstBatch": { - "$$type": "array" - }, - "ns": { - "$$type": "string" - } - } - }, - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "killCursors" - } - }, - { - "commandFailedEvent": { - "commandName": "killCursors" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionClosedEvent": { - "reason": "error" - } - } - ] - } - ] - }, - { - "description": "pinned connections are not returned to the pool after a non-network error on getMore", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "getMore" - ], - "errorCode": 7 - } - } - } - }, - { - "name": "createFindCursor", - "object": "collection0", - "arguments": { - "filter": {}, - "batchSize": 2 - }, - "saveResultAsEntity": "cursor0" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectResult": { - "_id": 1 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectResult": { - "_id": 2 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectError": { - "errorCode": 7 - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "close", - "object": "cursor0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": {}, - "batchSize": 2 - }, - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursor": { - "id": { - "$$type": [ - "int", - "long" - ] - }, - "firstBatch": { - "$$type": "array" - }, - "ns": { - "$$type": "string" - } - } - }, - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0" - }, - "commandName": "getMore" - } - }, - { - "commandFailedEvent": { - "commandName": "getMore" - } - }, - { - "commandStartedEvent": { - "commandName": "killCursors" - } - }, - { - "commandSucceededEvent": { - "commandName": "killCursors" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "aggregate pins the cursor to a connection", - "operations": [ - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [], - "batchSize": 2 - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll0", - "cursor": { - "batchSize": 2 - } - }, - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0" - }, - "commandName": "getMore" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursor": { - "id": 0, - "ns": { - "$$type": "string" - }, - "nextBatch": { - "$$type": "array" - } - } - }, - "commandName": "getMore" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "listCollections pins the cursor to a connection", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "listCollections", - "object": "database0", - "arguments": { - "filter": {}, - "batchSize": 2 - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1, - "cursor": { - "batchSize": 2 - } - }, - "commandName": "listCollections", - "databaseName": "database0Name" - } - }, - { - "commandSucceededEvent": { - "commandName": "listCollections" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": { - "$$type": "string" - } - }, - "commandName": "getMore" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursor": { - "id": 0, - "ns": { - "$$type": "string" - }, - "nextBatch": { - "$$type": "array" - } - } - }, - "commandName": "getMore" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "listIndexes pins the cursor to a connection", - "operations": [ - { - "name": "createIndex", - "object": "collection0", - "arguments": { - "keys": { - "x": 1 - }, - "name": "x_1" - } - }, - { - "name": "createIndex", - "object": "collection0", - "arguments": { - "keys": { - "y": 1 - }, - "name": "y_1" - } - }, - { - "name": "listIndexes", - "object": "collection0", - "arguments": { - "batchSize": 2 - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "createIndexes": "coll0", - "indexes": [ - { - "name": "x_1", - "key": { - "x": 1 - } - } - ] - }, - "commandName": "createIndexes" - } - }, - { - "commandSucceededEvent": { - "commandName": "createIndexes" - } - }, - { - "commandStartedEvent": { - "command": { - "createIndexes": "coll0", - "indexes": [ - { - "name": "y_1", - "key": { - "y": 1 - } - } - ] - }, - "commandName": "createIndexes" - } - }, - { - "commandSucceededEvent": { - "commandName": "createIndexes" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll0", - "cursor": { - "batchSize": 2 - } - }, - "commandName": "listIndexes", - "databaseName": "database0Name" - } - }, - { - "commandSucceededEvent": { - "commandName": "listIndexes" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0" - }, - "commandName": "getMore" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursor": { - "id": 0, - "ns": { - "$$type": "string" - }, - "nextBatch": { - "$$type": "array" - } - } - }, - "commandName": "getMore" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "change streams pin to a connection", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "close", - "object": "changeStream0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - }, - { - "commandStartedEvent": { - "commandName": "killCursors" - } - }, - { - "commandSucceededEvent": { - "commandName": "killCursors" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/load-balancers/event-monitoring.json b/driver-core/src/test/resources/unified-test-format/load-balancers/event-monitoring.json deleted file mode 100644 index 938c70bf388..00000000000 --- a/driver-core/src/test/resources/unified-test-format/load-balancers/event-monitoring.json +++ /dev/null @@ -1,184 +0,0 @@ -{ - "description": "monitoring events include correct fields", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "topologies": [ - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent", - "poolClearedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "databaseName": "database0", - "collectionName": "coll0", - "documents": [] - } - ], - "tests": [ - { - "description": "command started and succeeded events include serviceId", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert", - "hasServiceId": true - } - }, - { - "commandSucceededEvent": { - "commandName": "insert", - "hasServiceId": true - } - } - ] - } - ] - }, - { - "description": "command failed events include serviceId", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "hasServiceId": true - } - }, - { - "commandFailedEvent": { - "commandName": "find", - "hasServiceId": true - } - } - ] - } - ] - }, - { - "description": "poolClearedEvent events include serviceId", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {} - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "find", - "hasServiceId": true - } - }, - { - "commandFailedEvent": { - "commandName": "find", - "hasServiceId": true - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "poolClearedEvent": { - "hasServiceId": true - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/load-balancers/lb-connection-establishment.json b/driver-core/src/test/resources/unified-test-format/load-balancers/lb-connection-establishment.json deleted file mode 100644 index 0eaadf30c20..00000000000 --- a/driver-core/src/test/resources/unified-test-format/load-balancers/lb-connection-establishment.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "description": "connection establishment for load-balanced clusters", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "topologies": [ - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "uriOptions": { - "loadBalanced": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - } - ], - "tests": [ - { - "description": "operations against load balancers fail if URI contains loadBalanced=false", - "skipReason": "servers have not implemented LB support yet so they will not fail the connection handshake in this case", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/load-balancers/non-lb-connection-establishment.json b/driver-core/src/test/resources/unified-test-format/load-balancers/non-lb-connection-establishment.json deleted file mode 100644 index f4fed13cc23..00000000000 --- a/driver-core/src/test/resources/unified-test-format/load-balancers/non-lb-connection-establishment.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "description": "connection establishment if loadBalanced is specified for non-load balanced clusters", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "topologies": [ - "single", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "lbTrueClient", - "useMultipleMongoses": false, - "uriOptions": { - "loadBalanced": true - } - } - }, - { - "database": { - "id": "lbTrueDatabase", - "client": "lbTrueClient", - "databaseName": "lbTrueDb" - } - }, - { - "client": { - "id": "lbFalseClient", - "uriOptions": { - "loadBalanced": false - } - } - }, - { - "database": { - "id": "lbFalseDatabase", - "client": "lbFalseClient", - "databaseName": "lbFalseDb" - } - } - ], - "_yamlAnchors": { - "runCommandArguments": [ - { - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - } - } - ] - }, - "tests": [ - { - "description": "operations against non-load balanced clusters fail if URI contains loadBalanced=true", - "runOnRequirements": [ - { - "maxServerVersion": "8.0.99", - "topologies": [ - "single" - ] - }, - { - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "runCommand", - "object": "lbTrueDatabase", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "errorContains": "Driver attempted to initialize in load balancing mode, but the server does not support this mode" - } - } - ] - }, - { - "description": "operations against non-load balanced clusters succeed if URI contains loadBalanced=false", - "operations": [ - { - "name": "runCommand", - "object": "lbFalseDatabase", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/load-balancers/sdam-error-handling.json b/driver-core/src/test/resources/unified-test-format/load-balancers/sdam-error-handling.json deleted file mode 100644 index 47323fae4f3..00000000000 --- a/driver-core/src/test/resources/unified-test-format/load-balancers/sdam-error-handling.json +++ /dev/null @@ -1,514 +0,0 @@ -{ - "description": "state change errors are correctly handled", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "topologies": [ - "load-balanced" - ] - } - ], - "_yamlAnchors": { - "observedEvents": [ - "connectionCreatedEvent", - "connectionReadyEvent", - "connectionCheckedOutEvent", - "connectionCheckOutFailedEvent", - "connectionCheckedInEvent", - "connectionClosedEvent", - "poolClearedEvent" - ] - }, - "createEntities": [ - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "singleClient", - "useMultipleMongoses": false, - "uriOptions": { - "appname": "lbSDAMErrorTestClient", - "retryWrites": false - }, - "observeEvents": [ - "connectionCreatedEvent", - "connectionReadyEvent", - "connectionCheckedOutEvent", - "connectionCheckOutFailedEvent", - "connectionCheckedInEvent", - "connectionClosedEvent", - "poolClearedEvent" - ] - } - }, - { - "database": { - "id": "singleDB", - "client": "singleClient", - "databaseName": "singleDB" - } - }, - { - "collection": { - "id": "singleColl", - "database": "singleDB", - "collectionName": "singleColl" - } - }, - { - "client": { - "id": "multiClient", - "useMultipleMongoses": true, - "uriOptions": { - "retryWrites": false - }, - "observeEvents": [ - "connectionCreatedEvent", - "connectionReadyEvent", - "connectionCheckedOutEvent", - "connectionCheckOutFailedEvent", - "connectionCheckedInEvent", - "connectionClosedEvent", - "poolClearedEvent" - ] - } - }, - { - "database": { - "id": "multiDB", - "client": "multiClient", - "databaseName": "multiDB" - } - }, - { - "collection": { - "id": "multiColl", - "database": "multiDB", - "collectionName": "multiColl" - } - } - ], - "initialData": [ - { - "collectionName": "singleColl", - "databaseName": "singleDB", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - }, - { - "collectionName": "multiColl", - "databaseName": "multiDB", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ], - "tests": [ - { - "description": "only connections for a specific serviceId are closed when pools are cleared", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "createFindCursor", - "object": "multiColl", - "arguments": { - "filter": {}, - "batchSize": 2 - }, - "saveResultAsEntity": "cursor0" - }, - { - "name": "createFindCursor", - "object": "multiColl", - "arguments": { - "filter": {}, - "batchSize": 2 - }, - "saveResultAsEntity": "cursor1" - }, - { - "name": "close", - "object": "cursor0" - }, - { - "name": "close", - "object": "cursor1" - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "multiClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11600 - } - } - } - }, - { - "name": "insertOne", - "object": "multiColl", - "arguments": { - "document": { - "x": 1 - } - }, - "expectError": { - "errorCode": 11600 - } - }, - { - "name": "insertOne", - "object": "multiColl", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "multiClient", - "eventType": "cmap", - "events": [ - { - "connectionCreatedEvent": {} - }, - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCreatedEvent": {} - }, - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "poolClearedEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionClosedEvent": { - "reason": "stale" - } - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "errors during the initial connection hello are ignored", - "runOnRequirements": [ - { - "minServerVersion": "4.4.7" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "isMaster", - "hello" - ], - "closeConnection": true, - "appName": "lbSDAMErrorTestClient" - } - } - } - }, - { - "name": "insertOne", - "object": "singleColl", - "arguments": { - "document": { - "x": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "singleClient", - "eventType": "cmap", - "events": [ - { - "connectionCreatedEvent": {} - }, - { - "connectionClosedEvent": { - "reason": "error" - } - }, - { - "connectionCheckOutFailedEvent": { - "reason": "connectionError" - } - } - ] - } - ] - }, - { - "description": "errors during authentication are processed", - "runOnRequirements": [ - { - "auth": true - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "saslContinue" - ], - "closeConnection": true, - "appName": "lbSDAMErrorTestClient" - } - } - } - }, - { - "name": "insertOne", - "object": "singleColl", - "arguments": { - "document": { - "x": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "singleClient", - "eventType": "cmap", - "events": [ - { - "connectionCreatedEvent": {} - }, - { - "poolClearedEvent": {} - }, - { - "connectionClosedEvent": { - "reason": "error" - } - }, - { - "connectionCheckOutFailedEvent": { - "reason": "connectionError" - } - } - ] - } - ] - }, - { - "description": "stale errors are ignored", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "getMore" - ], - "closeConnection": true - } - } - } - }, - { - "name": "createFindCursor", - "object": "singleColl", - "arguments": { - "filter": {}, - "batchSize": 2 - }, - "saveResultAsEntity": "cursor0" - }, - { - "name": "createFindCursor", - "object": "singleColl", - "arguments": { - "filter": {}, - "batchSize": 2 - }, - "saveResultAsEntity": "cursor1" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectError": { - "isClientError": true - } - }, - { - "name": "close", - "object": "cursor0" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor1" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor1" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor1", - "expectError": { - "isClientError": true - } - }, - { - "name": "close", - "object": "cursor1" - } - ], - "expectEvents": [ - { - "client": "singleClient", - "eventType": "cmap", - "events": [ - { - "connectionCreatedEvent": {} - }, - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCreatedEvent": {} - }, - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "poolClearedEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionClosedEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionClosedEvent": {} - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/load-balancers/server-selection.json b/driver-core/src/test/resources/unified-test-format/load-balancers/server-selection.json deleted file mode 100644 index 00c7e4c95b4..00000000000 --- a/driver-core/src/test/resources/unified-test-format/load-balancers/server-selection.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "description": "server selection for load-balanced clusters", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "topologies": [ - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0", - "collectionOptions": { - "readPreference": { - "mode": "secondaryPreferred" - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0Name", - "documents": [] - } - ], - "tests": [ - { - "description": "$readPreference is sent for load-balanced clusters", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": {}, - "$readPreference": { - "mode": "secondaryPreferred" - } - }, - "commandName": "find", - "databaseName": "database0Name" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/load-balancers/transactions.json b/driver-core/src/test/resources/unified-test-format/load-balancers/transactions.json deleted file mode 100644 index 0dd04ee8540..00000000000 --- a/driver-core/src/test/resources/unified-test-format/load-balancers/transactions.json +++ /dev/null @@ -1,1621 +0,0 @@ -{ - "description": "transactions are correctly pinned to connections for load-balanced clusters", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "topologies": [ - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent", - "connectionReadyEvent", - "connectionClosedEvent", - "connectionCheckedOutEvent", - "connectionCheckedInEvent" - ] - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0Name", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ], - "_yamlAnchors": { - "documents": [ - { - "_id": 4 - } - ] - }, - "tests": [ - { - "description": "sessions are reused in LB mode", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "assertSameLsidOnLastTwoCommands", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ] - }, - { - "description": "all operations go to the same mongos", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "commitTransaction", - "object": "session0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - } - ] - } - ] - }, - { - "description": "transaction can be committed multiple times", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connection is not released after a non-transient CRUD error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 51 - } - } - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - }, - "expectError": { - "errorCode": 51, - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connection is not released after a non-transient commit error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 51 - } - } - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "commitTransaction", - "object": "session0", - "expectError": { - "errorCode": 51, - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connection is released after a non-transient abort error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 51 - } - } - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "abortTransaction", - "object": "session0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connection is released after a transient non-network CRUD error", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 24 - } - } - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - }, - "expectError": { - "errorCode": 24, - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - }, - { - "name": "abortTransaction", - "object": "session0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connection is released after a transient network CRUD error", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - }, - "expectError": { - "isClientError": true, - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - }, - { - "name": "abortTransaction", - "object": "session0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionClosedEvent": { - "reason": "error" - } - }, - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connection is released after a transient non-network commit error", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 24 - } - } - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "commitTransaction", - "object": "session0", - "expectError": { - "errorCode": 24, - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connection is released after a transient network commit error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "closeConnection": true - } - } - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "commitTransaction", - "object": "session0", - "ignoreResultAndError": true - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionClosedEvent": { - "reason": "error" - } - }, - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connection is released after a transient non-network abort error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 24 - } - } - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "abortTransaction", - "object": "session0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connection is released after a transient network abort error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "closeConnection": true - } - } - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "abortTransaction", - "object": "session0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionClosedEvent": { - "reason": "error" - } - }, - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connection is released on successful abort", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "abortTransaction", - "object": "session0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connection is returned when a new transaction is started", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "commitTransaction", - "object": "session0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - } - ] - } - ] - }, - { - "description": "pinned connection is returned when a non-transaction operation uses the session", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - }, - { - "description": "a connection can be shared by a transaction and a cursor", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "createFindCursor", - "object": "collection0", - "arguments": { - "filter": {}, - "batchSize": 2, - "session": "session0" - }, - "saveResultAsEntity": "cursor0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "close", - "object": "cursor0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - }, - { - "name": "abortTransaction", - "object": "session0" - }, - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "killCursors" - } - }, - { - "commandStartedEvent": { - "commandName": "abortTransaction" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/load-balancers/wait-queue-timeouts.json b/driver-core/src/test/resources/unified-test-format/load-balancers/wait-queue-timeouts.json deleted file mode 100644 index 3dc6e46cffe..00000000000 --- a/driver-core/src/test/resources/unified-test-format/load-balancers/wait-queue-timeouts.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "description": "wait queue timeout errors include details about checked out connections", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "topologies": [ - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "uriOptions": { - "maxPoolSize": 1, - "waitQueueTimeoutMS": 50 - }, - "observeEvents": [ - "connectionCheckedOutEvent", - "connectionCheckOutFailedEvent" - ] - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0Name", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ], - "tests": [ - { - "description": "wait queue timeout errors include cursor statistics", - "operations": [ - { - "name": "createFindCursor", - "object": "collection0", - "arguments": { - "filter": {}, - "batchSize": 2 - }, - "saveResultAsEntity": "cursor0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - } - }, - "expectError": { - "isClientError": true, - "errorContains": "maxPoolSize: 1, connections in use by cursors: 1, connections in use by transactions: 0, connections in use by other operations: 0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckOutFailedEvent": {} - } - ] - } - ] - }, - { - "description": "wait queue timeout errors include transaction statistics", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - } - }, - "expectError": { - "isClientError": true, - "errorContains": "maxPoolSize: 1, connections in use by cursors: 0, connections in use by transactions: 1, connections in use by other operations: 0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckOutFailedEvent": {} - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/aggregate-merge.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/aggregate-merge.json deleted file mode 100644 index 96bbd0fc386..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/aggregate-merge.json +++ /dev/null @@ -1,143 +0,0 @@ -{ - "description": "aggregate-merge", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.1.11" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Aggregate with $merge does not retry", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$merge": { - "into": "output-collection" - } - } - ] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$merge": { - "into": "output-collection" - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/aggregate-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/aggregate-serverErrors.json deleted file mode 100644 index d39835a5d36..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/aggregate-serverErrors.json +++ /dev/null @@ -1,1430 +0,0 @@ -{ - "description": "aggregate-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Aggregate succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection1", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/aggregate.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/aggregate.json deleted file mode 100644 index 2b504c8d49f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/aggregate.json +++ /dev/null @@ -1,527 +0,0 @@ -{ - "description": "aggregate", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Aggregate succeeds on first attempt", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Aggregate with $out does not retry", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$out": "output-collection" - } - ] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - }, - { - "$out": "output-collection" - } - ] - }, - "commandName": "aggregate", - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-client.watch-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-client.watch-serverErrors.json deleted file mode 100644 index 47375974d29..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-client.watch-serverErrors.json +++ /dev/null @@ -1,959 +0,0 @@ -{ - "description": "changeStreams-client.watch-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "serverless": "forbid", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - } - ], - "tests": [ - { - "description": "client.watch succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "client1", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-client.watch.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-client.watch.json deleted file mode 100644 index 95ddaf921d6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-client.watch.json +++ /dev/null @@ -1,294 +0,0 @@ -{ - "description": "changeStreams-client.watch", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "serverless": "forbid", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - } - ], - "tests": [ - { - "description": "client.watch succeeds on first attempt", - "operations": [ - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client1", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "client.watch fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true - } - } - ] - }, - "databaseName": "admin" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-db.coll.watch-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-db.coll.watch-serverErrors.json deleted file mode 100644 index 589d0a3c37a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-db.coll.watch-serverErrors.json +++ /dev/null @@ -1,944 +0,0 @@ -{ - "description": "changeStreams-db.coll.watch-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "serverless": "forbid", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "db.coll.watch succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection1", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-db.coll.watch.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-db.coll.watch.json deleted file mode 100644 index bbea2ffe4fe..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-db.coll.watch.json +++ /dev/null @@ -1,314 +0,0 @@ -{ - "description": "changeStreams-db.coll.watch", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "serverless": "forbid", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "db.coll.watch succeeds on first attempt", - "operations": [ - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.coll.watch fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-db.watch-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-db.watch-serverErrors.json deleted file mode 100644 index 6c12d7ddd86..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-db.watch-serverErrors.json +++ /dev/null @@ -1,930 +0,0 @@ -{ - "description": "changeStreams-db.watch-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "serverless": "forbid", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "db.watch succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "database1", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-db.watch.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-db.watch.json deleted file mode 100644 index 1b6d911c76e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/changeStreams-db.watch.json +++ /dev/null @@ -1,303 +0,0 @@ -{ - "description": "changeStreams-db.watch", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "serverless": "forbid", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "db.watch succeeds on first attempt", - "operations": [ - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "killCursors" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "database1", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "db.watch fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "database0", - "name": "createChangeStream", - "arguments": { - "pipeline": [] - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": {} - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/count-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/count-serverErrors.json deleted file mode 100644 index c52edfdb988..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/count-serverErrors.json +++ /dev/null @@ -1,808 +0,0 @@ -{ - "description": "count-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Count succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection1", - "name": "count", - "arguments": { - "filter": {} - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/count.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/count.json deleted file mode 100644 index d5c9a343a9a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/count.json +++ /dev/null @@ -1,286 +0,0 @@ -{ - "description": "count", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Count succeeds on first attempt", - "operations": [ - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "count", - "arguments": { - "filter": {} - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Count fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "filter": {} - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/countDocuments-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/countDocuments-serverErrors.json deleted file mode 100644 index fd028b114c1..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/countDocuments-serverErrors.json +++ /dev/null @@ -1,1133 +0,0 @@ -{ - "description": "countDocuments-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "CountDocuments succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection1", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/countDocuments.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/countDocuments.json deleted file mode 100644 index e06e89c1ad6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/countDocuments.json +++ /dev/null @@ -1,364 +0,0 @@ -{ - "description": "countDocuments", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "CountDocuments succeeds on first attempt", - "operations": [ - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "CountDocuments fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": {} - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/distinct-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/distinct-serverErrors.json deleted file mode 100644 index 79d2d5fc31c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/distinct-serverErrors.json +++ /dev/null @@ -1,1060 +0,0 @@ -{ - "description": "distinct-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Distinct succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection1", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/distinct.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/distinct.json deleted file mode 100644 index 81f1f66e917..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/distinct.json +++ /dev/null @@ -1,352 +0,0 @@ -{ - "description": "distinct", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Distinct succeeds on first attempt", - "operations": [ - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectResult": [ - 22, - 33 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Distinct fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "distinct" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "x", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "coll", - "key": "x", - "query": { - "_id": { - "$gt": 1 - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/estimatedDocumentCount-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/estimatedDocumentCount-serverErrors.json deleted file mode 100644 index ba983c6cdf0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/estimatedDocumentCount-serverErrors.json +++ /dev/null @@ -1,768 +0,0 @@ -{ - "description": "estimatedDocumentCount-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "EstimatedDocumentCount succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection1", - "name": "estimatedDocumentCount", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/estimatedDocumentCount.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/estimatedDocumentCount.json deleted file mode 100644 index 75a676b9b61..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/estimatedDocumentCount.json +++ /dev/null @@ -1,273 +0,0 @@ -{ - "description": "estimatedDocumentCount", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "EstimatedDocumentCount succeeds on first attempt", - "operations": [ - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "estimatedDocumentCount", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "EstimatedDocumentCount fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "count" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "estimatedDocumentCount", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "count": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/exceededTimeLimit.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/exceededTimeLimit.json deleted file mode 100644 index 8d090bbe3f6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/exceededTimeLimit.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "ExceededTimeLimit is a retryable read", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "exceededtimelimit-test" - } - } - ], - "initialData": [ - { - "collectionName": "exceededtimelimit-test", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Find succeeds on second attempt after ExceededTimeLimit", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 262 - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "object": "collection0", - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "exceededtimelimit-test", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "commandName": "find", - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "exceededtimelimit-test", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "commandName": "find", - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/find-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/find-serverErrors.json deleted file mode 100644 index ab3dbe45f4f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/find-serverErrors.json +++ /dev/null @@ -1,1184 +0,0 @@ -{ - "description": "find-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "tests": [ - { - "description": "Find succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection1", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/find.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/find.json deleted file mode 100644 index 30c4c5e4787..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/find.json +++ /dev/null @@ -1,498 +0,0 @@ -{ - "description": "find", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "tests": [ - { - "description": "Find succeeds on first attempt", - "operations": [ - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds on second attempt with explicit clientOptions", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": true - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 4 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/findOne-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/findOne-serverErrors.json deleted file mode 100644 index 7adda1e32b6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/findOne-serverErrors.json +++ /dev/null @@ -1,954 +0,0 @@ -{ - "description": "findOne-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "tests": [ - { - "description": "FindOne succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection1", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/findOne.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/findOne.json deleted file mode 100644 index 4314a19e46f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/findOne.json +++ /dev/null @@ -1,330 +0,0 @@ -{ - "description": "findOne", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "tests": [ - { - "description": "FindOne succeeds on first attempt", - "operations": [ - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "FindOne fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "findOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": { - "_id": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/gridfs-download-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/gridfs-download-serverErrors.json deleted file mode 100644 index 5bb7eee0b23..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/gridfs-download-serverErrors.json +++ /dev/null @@ -1,1092 +0,0 @@ -{ - "description": "gridfs-download-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "bucket": { - "id": "bucket0", - "database": "database0" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000001" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - } - ] - } - ], - "tests": [ - { - "description": "Download succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "bucket": { - "id": "bucket1", - "database": "database1" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "bucket1", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/gridfs-download.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/gridfs-download.json deleted file mode 100644 index 69fe8ff7c85..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/gridfs-download.json +++ /dev/null @@ -1,367 +0,0 @@ -{ - "description": "gridfs-download", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "bucket": { - "id": "bucket0", - "database": "database0" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000001" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - } - ] - } - ], - "tests": [ - { - "description": "Download succeeds on first attempt", - "operations": [ - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "bucket": { - "id": "bucket1", - "database": "database1" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "bucket1", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Download fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "bucket0", - "name": "download", - "arguments": { - "id": { - "$oid": "000000000000000000000001" - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "_id": { - "$oid": "000000000000000000000001" - } - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/gridfs-downloadByName-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/gridfs-downloadByName-serverErrors.json deleted file mode 100644 index 35f7e1e563f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/gridfs-downloadByName-serverErrors.json +++ /dev/null @@ -1,1016 +0,0 @@ -{ - "description": "gridfs-downloadByName-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "bucket": { - "id": "bucket0", - "database": "database0" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000001" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - } - ] - } - ], - "tests": [ - { - "description": "DownloadByName succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "bucket": { - "id": "bucket1", - "database": "database1" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "bucket1", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/gridfs-downloadByName.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/gridfs-downloadByName.json deleted file mode 100644 index c3fa873396f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/gridfs-downloadByName.json +++ /dev/null @@ -1,347 +0,0 @@ -{ - "description": "gridfs-downloadByName", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "bucket": { - "id": "bucket0", - "database": "database0" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000001" - }, - "length": 1, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "filename": "abc", - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000002" - }, - "files_id": { - "$oid": "000000000000000000000001" - }, - "n": 0, - "data": { - "$binary": { - "base64": "EQ==", - "subType": "00" - } - } - } - ] - } - ], - "tests": [ - { - "description": "DownloadByName succeeds on first attempt", - "operations": [ - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectResult": { - "$$matchesHexBytes": "11" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.chunks" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "bucket": { - "id": "bucket1", - "database": "database1" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "bucket1", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "DownloadByName fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "object": "bucket0", - "name": "downloadByName", - "arguments": { - "filename": "abc" - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "fs.files", - "filter": { - "filename": "abc" - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/handshakeError.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/handshakeError.json deleted file mode 100644 index 2921d8a9540..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/handshakeError.json +++ /dev/null @@ -1,3079 +0,0 @@ -{ - "description": "retryable reads handshake failures", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ], - "auth": true - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "connectionCheckOutStartedEvent", - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-handshake-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "client.listDatabases succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandSucceededEvent": { - "commandName": "listDatabases" - } - } - ] - } - ] - }, - { - "description": "client.listDatabases succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "listDatabases", - "object": "client", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandSucceededEvent": { - "commandName": "listDatabases" - } - } - ] - } - ] - }, - { - "description": "client.listDatabaseNames succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandSucceededEvent": { - "commandName": "listDatabases" - } - } - ] - } - ] - }, - { - "description": "client.listDatabaseNames succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "listDatabaseNames", - "object": "client" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "listDatabases" - } - }, - { - "commandSucceededEvent": { - "commandName": "listDatabases" - } - } - ] - } - ] - }, - { - "description": "client.createChangeStream succeeds after retryable handshake network error", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "client.createChangeStream succeeds after retryable handshake server error (ShutdownInProgress)", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "createChangeStream", - "object": "client", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "database.aggregate succeeds after retryable handshake network error", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "database.aggregate succeeds after retryable handshake server error (ShutdownInProgress)", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "aggregate", - "object": "database", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "database.listCollections succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections" - } - }, - { - "commandSucceededEvent": { - "commandName": "listCollections" - } - } - ] - } - ] - }, - { - "description": "database.listCollections succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "listCollections", - "object": "database", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections" - } - }, - { - "commandSucceededEvent": { - "commandName": "listCollections" - } - } - ] - } - ] - }, - { - "description": "database.listCollectionNames succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections" - } - }, - { - "commandSucceededEvent": { - "commandName": "listCollections" - } - } - ] - } - ] - }, - { - "description": "database.listCollectionNames succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "listCollectionNames", - "object": "database", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "listCollections" - } - }, - { - "commandSucceededEvent": { - "commandName": "listCollections" - } - } - ] - } - ] - }, - { - "description": "database.createChangeStream succeeds after retryable handshake network error", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "database.createChangeStream succeeds after retryable handshake server error (ShutdownInProgress)", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "createChangeStream", - "object": "database", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "collection.aggregate succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "collection.aggregate succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "collection.countDocuments succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "collection.countDocuments succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "collection.estimatedDocumentCount succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "count" - } - }, - { - "commandSucceededEvent": { - "commandName": "count" - } - } - ] - } - ] - }, - { - "description": "collection.estimatedDocumentCount succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "estimatedDocumentCount", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "count" - } - }, - { - "commandSucceededEvent": { - "commandName": "count" - } - } - ] - } - ] - }, - { - "description": "collection.distinct succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "distinct" - } - }, - { - "commandSucceededEvent": { - "commandName": "distinct" - } - } - ] - } - ] - }, - { - "description": "collection.distinct succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "distinct" - } - }, - { - "commandSucceededEvent": { - "commandName": "distinct" - } - } - ] - } - ] - }, - { - "description": "collection.find succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "commandName": "find" - } - } - ] - } - ] - }, - { - "description": "collection.find succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "commandName": "find" - } - } - ] - } - ] - }, - { - "description": "collection.findOne succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "commandName": "find" - } - } - ] - } - ] - }, - { - "description": "collection.findOne succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "commandName": "find" - } - } - ] - } - ] - }, - { - "description": "collection.listIndexes succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandSucceededEvent": { - "commandName": "listIndexes" - } - } - ] - } - ] - }, - { - "description": "collection.listIndexes succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "listIndexes", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandSucceededEvent": { - "commandName": "listIndexes" - } - } - ] - } - ] - }, - { - "description": "collection.listIndexNames succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandSucceededEvent": { - "commandName": "listIndexes" - } - } - ] - } - ] - }, - { - "description": "collection.listIndexNames succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "listIndexNames", - "object": "collection" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "listIndexes" - } - }, - { - "commandSucceededEvent": { - "commandName": "listIndexes" - } - } - ] - } - ] - }, - { - "description": "collection.createChangeStream succeeds after retryable handshake network error", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "collection.createChangeStream succeeds after retryable handshake server error (ShutdownInProgress)", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "createChangeStream", - "object": "collection", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-reads-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "aggregate" - } - }, - { - "commandSucceededEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollectionNames-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollectionNames-serverErrors.json deleted file mode 100644 index 162dd4cee08..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollectionNames-serverErrors.json +++ /dev/null @@ -1,710 +0,0 @@ -{ - "description": "listCollectionNames-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListCollectionNames succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "database1", - "name": "listCollectionNames", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollectionNames.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollectionNames.json deleted file mode 100644 index 0fe575f7a6d..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollectionNames.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "description": "listCollectionNames", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListCollectionNames succeeds on first attempt", - "operations": [ - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - } - } - }, - { - "object": "database1", - "name": "listCollectionNames", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionNames fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - } - } - }, - { - "object": "database0", - "name": "listCollectionNames", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollectionObjects-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollectionObjects-serverErrors.json deleted file mode 100644 index 8b9d582c102..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollectionObjects-serverErrors.json +++ /dev/null @@ -1,710 +0,0 @@ -{ - "description": "listCollectionObjects-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListCollectionObjects succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "database1", - "name": "listCollectionObjects", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollectionObjects.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollectionObjects.json deleted file mode 100644 index 9cdbb692763..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollectionObjects.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "description": "listCollectionObjects", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListCollectionObjects succeeds on first attempt", - "operations": [ - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - } - } - }, - { - "object": "database1", - "name": "listCollectionObjects", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollectionObjects fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - } - } - }, - { - "object": "database0", - "name": "listCollectionObjects", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollections-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollections-serverErrors.json deleted file mode 100644 index 171fe7457f0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollections-serverErrors.json +++ /dev/null @@ -1,710 +0,0 @@ -{ - "description": "listCollections-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListCollections succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "database0", - "name": "listCollections", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "database1", - "name": "listCollections", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollections.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollections.json deleted file mode 100644 index b6152f9ce53..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listCollections.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "description": "listCollections", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListCollections succeeds on first attempt", - "operations": [ - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - } - } - }, - { - "object": "database0", - "name": "listCollections" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - } - } - }, - { - "object": "database1", - "name": "listCollections", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListCollections fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listCollections" - ], - "closeConnection": true - } - } - } - }, - { - "object": "database0", - "name": "listCollections", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listCollections": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabaseNames-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabaseNames-serverErrors.json deleted file mode 100644 index 489ff0ad512..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabaseNames-serverErrors.json +++ /dev/null @@ -1,696 +0,0 @@ -{ - "description": "listDatabaseNames-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListDatabaseNames succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "client1", - "name": "listDatabaseNames", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabaseNames.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabaseNames.json deleted file mode 100644 index 5590f39a51e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabaseNames.json +++ /dev/null @@ -1,229 +0,0 @@ -{ - "description": "listDatabaseNames", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListDatabaseNames succeeds on first attempt", - "operations": [ - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client1", - "name": "listDatabaseNames", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseNames fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseNames", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabaseObjects-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabaseObjects-serverErrors.json deleted file mode 100644 index 56f9f362363..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabaseObjects-serverErrors.json +++ /dev/null @@ -1,696 +0,0 @@ -{ - "description": "listDatabaseObjects-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListDatabaseObjects succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "client1", - "name": "listDatabaseObjects", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabaseObjects.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabaseObjects.json deleted file mode 100644 index 46b1511d46c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabaseObjects.json +++ /dev/null @@ -1,229 +0,0 @@ -{ - "description": "listDatabaseObjects", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListDatabaseObjects succeeds on first attempt", - "operations": [ - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client1", - "name": "listDatabaseObjects", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabaseObjects fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client0", - "name": "listDatabaseObjects", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabases-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabases-serverErrors.json deleted file mode 100644 index 09b935a59f4..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabases-serverErrors.json +++ /dev/null @@ -1,696 +0,0 @@ -{ - "description": "listDatabases-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListDatabases succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "client0", - "name": "listDatabases", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "client1", - "name": "listDatabases", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabases.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabases.json deleted file mode 100644 index 4cf5eccc7bd..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listDatabases.json +++ /dev/null @@ -1,229 +0,0 @@ -{ - "description": "listDatabases", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListDatabases succeeds on first attempt", - "operations": [ - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client0", - "name": "listDatabases" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client1", - "name": "listDatabases", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - }, - { - "description": "ListDatabases fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client0", - "name": "listDatabases", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listIndexNames-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listIndexNames-serverErrors.json deleted file mode 100644 index 7b98111480c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listIndexNames-serverErrors.json +++ /dev/null @@ -1,749 +0,0 @@ -{ - "description": "listIndexNames-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListIndexNames succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection1", - "name": "listIndexNames", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listIndexNames.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listIndexNames.json deleted file mode 100644 index c5fe967ff57..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listIndexNames.json +++ /dev/null @@ -1,263 +0,0 @@ -{ - "description": "listIndexNames", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListIndexNames succeeds on first attempt", - "operations": [ - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "listIndexNames", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexNames fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "listIndexNames", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listIndexes-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listIndexes-serverErrors.json deleted file mode 100644 index 0110a0acd0b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listIndexes-serverErrors.json +++ /dev/null @@ -1,749 +0,0 @@ -{ - "description": "listIndexes-serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListIndexes succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 11600 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 11602 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 13435 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 13436 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 189 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 91 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 7 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 6 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 89 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 9001 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes fails after two NotWritablePrimary errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes fails after NotWritablePrimary when retryReads is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "collection1", - "name": "listIndexes", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/listIndexes.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/listIndexes.json deleted file mode 100644 index 2560e4961cc..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/listIndexes.json +++ /dev/null @@ -1,263 +0,0 @@ -{ - "description": "listIndexes", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "ListIndexes succeeds on first attempt", - "operations": [ - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes succeeds on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes fails on first attempt", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "listIndexes", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListIndexes fails on second attempt", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "listIndexes" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "listIndexes", - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "listIndexes": "coll" - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/mapReduce.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/mapReduce.json deleted file mode 100644 index 745c0ef001a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/mapReduce.json +++ /dev/null @@ -1,284 +0,0 @@ -{ - "description": "mapReduce", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "serverless": "forbid", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 0 - }, - { - "_id": 2, - "x": 1 - }, - { - "_id": 3, - "x": 2 - } - ] - } - ], - "tests": [ - { - "description": "MapReduce succeeds with retry on", - "operations": [ - { - "object": "collection0", - "name": "mapReduce", - "arguments": { - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "expectResult": [ - { - "_id": 0, - "value": 6 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "mapReduce": "coll", - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "MapReduce fails with retry on", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "mapReduce" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "mapReduce", - "arguments": { - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "mapReduce": "coll", - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "MapReduce fails with retry off", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryReads": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "mapReduce" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "mapReduce", - "arguments": { - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "mapReduce": "coll", - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-reads/readConcernMajorityNotAvailableYet.json b/driver-core/src/test/resources/unified-test-format/retryable-reads/readConcernMajorityNotAvailableYet.json deleted file mode 100644 index 8aa6a6b5e5e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-reads/readConcernMajorityNotAvailableYet.json +++ /dev/null @@ -1,147 +0,0 @@ -{ - "description": "ReadConcernMajorityNotAvailableYet is a retryable read", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "readconcernmajoritynotavailableyet_test" - } - } - ], - "initialData": [ - { - "collectionName": "readconcernmajoritynotavailableyet_test", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Find succeeds on second attempt after ReadConcernMajorityNotAvailableYet", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 134 - } - } - } - }, - { - "name": "find", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "object": "collection0", - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "readconcernmajoritynotavailableyet_test", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "commandName": "find", - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "readconcernmajoritynotavailableyet_test", - "filter": { - "_id": { - "$gt": 1 - } - } - }, - "commandName": "find", - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/bulkWrite-errorLabels.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/bulkWrite-errorLabels.json deleted file mode 100644 index 13ba9bae757..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/bulkWrite-errorLabels.json +++ /dev/null @@ -1,416 +0,0 @@ -{ - "description": "bulkWrite-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "1": 3 - } - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "1": 3 - } - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "1": 3 - } - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/bulkWrite-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/bulkWrite-serverErrors.json deleted file mode 100644 index 0a063ab4d99..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/bulkWrite-serverErrors.json +++ /dev/null @@ -1,285 +0,0 @@ -{ - "description": "retryable-writes bulkWrite serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "BulkWrite succeeds after retryable writeConcernError in first batch", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 2 - } - } - } - ] - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": { - "0": 3 - } - }, - "upsertedIds": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "coll", - "deletes": [ - { - "q": { - "_id": 2 - }, - "limit": 1 - } - ] - }, - "commandName": "delete", - "databaseName": "retryable-writes-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "BulkWrite fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/bulkWrite.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/bulkWrite.json deleted file mode 100644 index 691321746b2..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/bulkWrite.json +++ /dev/null @@ -1,931 +0,0 @@ -{ - "description": "bulkWrite", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "First command is retried", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 2 - } - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 23 - } - ] - } - ] - }, - { - "description": "All commands are retried", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 7 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 4, - "x": 44 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - } - }, - { - "insertOne": { - "document": { - "_id": 5, - "x": 55 - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 3 - }, - "replacement": { - "_id": 3, - "x": 333 - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 3, - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "2": 3, - "4": 5 - } - }, - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 1, - "upsertedIds": { - "3": 4 - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 23 - }, - { - "_id": 3, - "x": 333 - }, - { - "_id": 4, - "x": 45 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ] - }, - { - "description": "Both commands are retried after their first statement fails", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 2 - } - }, - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 23 - } - ] - } - ] - }, - { - "description": "Second command is retried after its second statement fails", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "skip": 2 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 2 - } - }, - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 23 - } - ] - } - ] - }, - { - "description": "BulkWrite with unordered execution", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - } - ], - "ordered": false - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 2, - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "First insertOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "expectResult": { - "deletedCount": 0, - "insertedCount": 0, - "insertedIds": { - "$$unsetOrMatches": {} - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "Second updateOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "skip": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 2 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "Third updateOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "skip": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "1": 2 - } - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "Single-document write following deleteMany is retried", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "deleteMany": { - "filter": { - "x": 11 - } - } - }, - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 1, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "1": 2 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "Single-document write following updateMany is retried", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "updateMany": { - "filter": { - "x": 11 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "1": 2 - } - }, - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0, - "upsertedIds": {} - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/client-bulkWrite-clientErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/client-bulkWrite-clientErrors.json deleted file mode 100644 index d16e0c9c8d6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/client-bulkWrite-clientErrors.json +++ /dev/null @@ -1,351 +0,0 @@ -{ - "description": "client bulkWrite retryable writes with client errors", - "schemaVersion": "1.21", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "retryable-writes-tests.coll0" - }, - "tests": [ - { - "description": "client bulkWrite with one network error succeeds after retry", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-tests.coll0", - "document": { - "_id": 4, - "x": 44 - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 4 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "client bulkWrite with two network errors fails after retry", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "closeConnection": true - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-tests.coll0", - "document": { - "_id": 4, - "x": 44 - } - } - } - ], - "verboseResults": true - }, - "expectError": { - "isClientError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/client-bulkWrite-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/client-bulkWrite-serverErrors.json deleted file mode 100644 index f58c82bcc73..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/client-bulkWrite-serverErrors.json +++ /dev/null @@ -1,873 +0,0 @@ -{ - "description": "client bulkWrite retryable writes", - "schemaVersion": "1.21", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "useMultipleMongoses": false - } - }, - { - "client": { - "id": "clientRetryWritesFalse", - "uriOptions": { - "retryWrites": false - }, - "observeEvents": [ - "commandStartedEvent" - ], - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "_yamlAnchors": { - "namespace": "retryable-writes-tests.coll0" - }, - "tests": [ - { - "description": "client bulkWrite with no multi: true operations succeeds after retryable top-level error", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-tests.coll0", - "document": { - "_id": 4, - "x": 44 - } - } - }, - { - "updateOne": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "replaceOne": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 2 - }, - "replacement": { - "x": 222 - } - } - }, - { - "deleteOne": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 3 - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 2, - "modifiedCount": 2, - "deletedCount": 1, - "insertResults": { - "0": { - "insertedId": 4 - } - }, - "updateResults": { - "1": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - }, - "2": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - } - }, - "deleteResults": { - "3": { - "deletedCount": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - }, - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "update": 0, - "filter": { - "_id": 2 - }, - "updateMods": { - "x": 222 - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": 3 - }, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - }, - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "update": 0, - "filter": { - "_id": 2 - }, - "updateMods": { - "x": 222 - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": 3 - }, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 222 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "client bulkWrite with multi: true operations fails after retryable top-level error", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "updateMany": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteMany": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 3 - } - } - } - ] - }, - "expectError": { - "errorCode": 189, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": true, - "ordered": true, - "ops": [ - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": true - }, - { - "delete": 0, - "filter": { - "_id": 3 - }, - "multi": true - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ] - } - } - } - ] - } - ] - }, - { - "description": "client bulkWrite with no multi: true operations succeeds after retryable writeConcernError", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-tests.coll0", - "document": { - "_id": 4, - "x": 44 - } - } - }, - { - "updateOne": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "replaceOne": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 2 - }, - "replacement": { - "x": 222 - } - } - }, - { - "deleteOne": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 3 - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 2, - "modifiedCount": 2, - "deletedCount": 1, - "insertResults": { - "0": { - "insertedId": 4 - } - }, - "updateResults": { - "1": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - }, - "2": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - } - }, - "deleteResults": { - "3": { - "deletedCount": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - }, - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "update": 0, - "filter": { - "_id": 2 - }, - "updateMods": { - "x": 222 - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": 3 - }, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - }, - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "update": 0, - "filter": { - "_id": 2 - }, - "updateMods": { - "x": 222 - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": 3 - }, - "multi": false - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ], - "lsid": { - "$$exists": true - }, - "txnNumber": { - "$$exists": true - } - } - } - } - ] - } - ] - }, - { - "description": "client bulkWrite with multi: true operations fails after retryable writeConcernError", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "updateMany": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteMany": { - "namespace": "retryable-writes-tests.coll0", - "filter": { - "_id": 3 - } - } - } - ] - }, - "expectError": { - "writeConcernErrors": [ - { - "code": 91, - "message": "Replication is being shut down" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": true, - "ordered": true, - "ops": [ - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": true - }, - { - "delete": 0, - "filter": { - "_id": 3 - }, - "multi": true - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ] - } - } - } - ] - } - ] - }, - { - "description": "client bulkWrite with retryWrites: false does not retry", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "clientRetryWritesFalse", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "clientRetryWritesFalse", - "name": "clientBulkWrite", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-tests.coll0", - "document": { - "_id": 4, - "x": 44 - } - } - } - ] - }, - "expectError": { - "errorCode": 189, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "expectEvents": [ - { - "client": "clientRetryWritesFalse", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": true, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 4, - "x": 44 - } - } - ], - "nsInfo": [ - { - "ns": "retryable-writes-tests.coll0" - } - ] - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/deleteMany.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/deleteMany.json deleted file mode 100644 index 087576cc0f6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/deleteMany.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "description": "deleteMany", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteMany ignores retryWrites", - "operations": [ - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "filter": {} - }, - "expectResult": { - "deletedCount": 2 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/deleteOne-errorLabels.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/deleteOne-errorLabels.json deleted file mode 100644 index 88920862ec5..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/deleteOne-errorLabels.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "description": "deleteOne-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/deleteOne-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/deleteOne-serverErrors.json deleted file mode 100644 index 0808b7921de..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/deleteOne-serverErrors.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "description": "deleteOne-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne fails with RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "delete" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/deleteOne.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/deleteOne.json deleted file mode 100644 index c3aaf886555..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/deleteOne.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "description": "deleteOne", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "DeleteOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndDelete-errorLabels.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndDelete-errorLabels.json deleted file mode 100644 index 8639873fca0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndDelete-errorLabels.json +++ /dev/null @@ -1,289 +0,0 @@ -{ - "description": "findOneAndDelete-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndDelete succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndDelete-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndDelete-serverErrors.json deleted file mode 100644 index f6d8e9d69c7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndDelete-serverErrors.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "description": "findOneAndDelete-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndDelete fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndDelete.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndDelete.json deleted file mode 100644 index 89dbb9d6551..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndDelete.json +++ /dev/null @@ -1,205 +0,0 @@ -{ - "description": "findOneAndDelete", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndDelete is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndDelete is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "filter": { - "x": { - "$gte": 11 - } - }, - "sort": { - "x": 1 - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndReplace-errorLabels.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndReplace-errorLabels.json deleted file mode 100644 index 78db52e75da..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndReplace-errorLabels.json +++ /dev/null @@ -1,301 +0,0 @@ -{ - "description": "findOneAndReplace-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndReplace-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndReplace-serverErrors.json deleted file mode 100644 index 1c355c3ebfb..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndReplace-serverErrors.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "description": "findOneAndReplace-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndReplace.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndReplace.json deleted file mode 100644 index 6d1cc17974d..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndReplace.json +++ /dev/null @@ -1,213 +0,0 @@ -{ - "description": "findOneAndReplace", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndReplace is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndReplace is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "Before" - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndUpdate-errorLabels.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndUpdate-errorLabels.json deleted file mode 100644 index 38b3f7ba44f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndUpdate-errorLabels.json +++ /dev/null @@ -1,305 +0,0 @@ -{ - "description": "findOneAndUpdate-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndUpdate-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndUpdate-serverErrors.json deleted file mode 100644 index 150012ac724..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndUpdate-serverErrors.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "description": "findOneAndUpdate-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndUpdate.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndUpdate.json deleted file mode 100644 index eb88fbe9b39..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/findOneAndUpdate.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "description": "findOneAndUpdate", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/handshakeError.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/handshakeError.json deleted file mode 100644 index 93cb2e849ec..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/handshakeError.json +++ /dev/null @@ -1,2015 +0,0 @@ -{ - "description": "retryable writes handshake failures", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ], - "auth": true - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "connectionCheckOutStartedEvent", - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-handshake-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "client.clientBulkWrite succeeds after retryable handshake network error", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "clientBulkWrite", - "object": "client", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-handshake-tests.coll", - "document": { - "_id": 8, - "x": 88 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite" - } - }, - { - "commandSucceededEvent": { - "commandName": "bulkWrite" - } - } - ] - } - ] - }, - { - "description": "client.clientBulkWrite succeeds after retryable handshake server error (ShutdownInProgress)", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "clientBulkWrite", - "object": "client", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "retryable-writes-handshake-tests.coll", - "document": { - "_id": 8, - "x": 88 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "bulkWrite" - } - }, - { - "commandSucceededEvent": { - "commandName": "bulkWrite" - } - } - ] - } - ] - }, - { - "description": "collection.insertOne succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "collection.insertOne succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "collection.insertMany succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "collection.insertMany succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "collection.deleteOne succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "delete" - } - }, - { - "commandSucceededEvent": { - "commandName": "delete" - } - } - ] - } - ] - }, - { - "description": "collection.deleteOne succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "delete" - } - }, - { - "commandSucceededEvent": { - "commandName": "delete" - } - } - ] - } - ] - }, - { - "description": "collection.replaceOne succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandSucceededEvent": { - "commandName": "update" - } - } - ] - } - ] - }, - { - "description": "collection.replaceOne succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandSucceededEvent": { - "commandName": "update" - } - } - ] - } - ] - }, - { - "description": "collection.updateOne succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 22 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandSucceededEvent": { - "commandName": "update" - } - } - ] - } - ] - }, - { - "description": "collection.updateOne succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 22 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandSucceededEvent": { - "commandName": "update" - } - } - ] - } - ] - }, - { - "description": "collection.findOneAndDelete succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandSucceededEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "collection.findOneAndDelete succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandSucceededEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "collection.findOneAndReplace succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandSucceededEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "collection.findOneAndReplace succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": {}, - "replacement": { - "x": 22 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandSucceededEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "collection.findOneAndUpdate succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 22 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandSucceededEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "collection.findOneAndUpdate succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": {}, - "update": { - "$set": { - "x": 22 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "findAndModify" - } - }, - { - "commandSucceededEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "collection.bulkWrite succeeds after retryable handshake network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "collection.bulkWrite succeeds after retryable handshake server error (ShutdownInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "ping", - "saslContinue" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 2, - "x": 22 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-writes-handshake-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "ping" - } - }, - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertMany-errorLabels.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/insertMany-errorLabels.json deleted file mode 100644 index 5254ba7cb2b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertMany-errorLabels.json +++ /dev/null @@ -1,335 +0,0 @@ -{ - "description": "insertMany-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "InsertMany succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertMany fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertMany succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertMany succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertMany-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/insertMany-serverErrors.json deleted file mode 100644 index f5f513603c6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertMany-serverErrors.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "description": "insertMany-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "InsertMany fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertMany.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/insertMany.json deleted file mode 100644 index 47181d0a9ee..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertMany.json +++ /dev/null @@ -1,233 +0,0 @@ -{ - "description": "insertMany", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "InsertMany succeeds after one network error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": true - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertMany with unordered execution", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": false - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertMany fails after multiple network errors", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": "alwaysOn", - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ], - "ordered": true - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertOne-errorLabels.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/insertOne-errorLabels.json deleted file mode 100644 index 39f31a8aa66..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertOne-errorLabels.json +++ /dev/null @@ -1,1127 +0,0 @@ -{ - "description": "insertOne-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "InsertOne succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [] - } - ] - }, - { - "description": "InsertOne succeeds after NotWritablePrimary", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 10107, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 13436, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 13435, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11602, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after InterruptedAtShutdown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11600, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 91, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after HostNotFound", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after HostUnreachable", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 6, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after SocketException", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 9001, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after NetworkTimeout", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 89, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after ExceededTimeLimit", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 262, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after WriteConcernError InterruptedAtShutdown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 11600, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after WriteConcernError InterruptedDueToReplStateChange", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 11602, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after WriteConcernError PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 189, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "InsertOne fails after multiple retryable writeConcernErrors", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 1, - "x": 11 - } - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertOne-noWritesPerformedError.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/insertOne-noWritesPerformedError.json deleted file mode 100644 index 3194e91c5ca..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertOne-noWritesPerformedError.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "description": "retryable-writes insertOne noWritesPerformedErrors", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "6.0", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "no-writes-performed-collection" - } - } - ], - "tests": [ - { - "description": "InsertOne fails after NoWritesPerformed error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 64, - "errorLabels": [ - "NoWritesPerformed", - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - } - }, - "expectError": { - "errorCode": 64, - "errorLabelsContain": [ - "NoWritesPerformed", - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "no-writes-performed-collection", - "databaseName": "retryable-writes-tests", - "documents": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertOne-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/insertOne-serverErrors.json deleted file mode 100644 index f404adcaf42..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertOne-serverErrors.json +++ /dev/null @@ -1,865 +0,0 @@ -{ - "description": "retryable-writes insertOne serverErrors", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "InsertOne succeeds after retryable writeConcernError", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "RetryableWriteError label is added based on top-level code in pre-4.4 server response", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 189 - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "RetryableWriteError label is added based on writeConcernError in pre-4.4 mongod response", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99", - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "RetryableWriteError label is not added based on writeConcernError in pre-4.4 mongos response", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "maxServerVersion": "4.2.99", - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3, - "x": 33 - } - ] - }, - "commandName": "insert", - "databaseName": "retryable-writes-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertOne succeeds after connection failure", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertOne fails after connection failure when retryWrites option is false", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryWrites": false - } - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "InsertOne fails after Interrupted", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11601, - "closeConnection": false - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "InsertOne fails after WriteConcernError Interrupted", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "writeConcernError": { - "code": 11601, - "errmsg": "operation was interrupted" - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertOne fails after WriteConcernError WriteConcernFailed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "writeConcernError": { - "code": 64, - "codeName": "WriteConcernFailed", - "errmsg": "waiting for replication timed out", - "errInfo": { - "wtimeout": true - } - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertOne fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertOne.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/insertOne.json deleted file mode 100644 index 61957415ed6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/insertOne.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "description": "insertOne", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "InsertOne is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertOne is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "InsertOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/replaceOne-errorLabels.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/replaceOne-errorLabels.json deleted file mode 100644 index 22c4561ae7b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/replaceOne-errorLabels.json +++ /dev/null @@ -1,300 +0,0 @@ -{ - "description": "replaceOne-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "ReplaceOne fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "ReplaceOne succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "ReplaceOne succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/replaceOne-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/replaceOne-serverErrors.json deleted file mode 100644 index c957db7244a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/replaceOne-serverErrors.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "description": "replaceOne-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/replaceOne.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/replaceOne.json deleted file mode 100644 index e58625bb5e2..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/replaceOne.json +++ /dev/null @@ -1,212 +0,0 @@ -{ - "description": "replaceOne", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "ReplaceOne is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "ReplaceOne is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 111 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "ReplaceOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/updateMany.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/updateMany.json deleted file mode 100644 index 260b7ad1c66..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/updateMany.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "description": "updateMany", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateMany ignores retryWrites", - "operations": [ - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "filter": {}, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 23 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/updateOne-errorLabels.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/updateOne-errorLabels.json deleted file mode 100644 index e44cef45f64..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/updateOne-errorLabels.json +++ /dev/null @@ -1,304 +0,0 @@ -{ - "description": "updateOne-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne succeeds with RetryableWriteError from server", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne fails if server does not return RetryableWriteError", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "isError": true, - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne succeeds after PrimarySteppedDown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/updateOne-serverErrors.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/updateOne-serverErrors.json deleted file mode 100644 index 648834ada4f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/updateOne-serverErrors.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "description": "updateOne-serverErrors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne fails with a RetryableWriteError label after two connection failures", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "update" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/retryable-writes/updateOne.json b/driver-core/src/test/resources/unified-test-format/retryable-writes/updateOne.json deleted file mode 100644 index 7947cef3c09..00000000000 --- a/driver-core/src/test/resources/unified-test-format/retryable-writes/updateOne.json +++ /dev/null @@ -1,394 +0,0 @@ -{ - "description": "updateOne", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "UpdateOne is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "UpdateOne with upsert is committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 3, - "x": 33 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 3 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 34 - } - ] - } - ] - }, - { - "description": "UpdateOne with upsert is not committed on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 3, - "x": 33 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 3 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 34 - } - ] - } - ] - }, - { - "description": "UpdateOne with upsert is never committed", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "filter": { - "_id": 3, - "x": 33 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-error.json deleted file mode 100644 index 62d26494c7c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-error.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "description": "auth-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "auth": true, - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "auth-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "Reset server and pool after AuthenticationFailure error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "saslContinue" - ], - "appName": "authErrorTest", - "errorCode": 18 - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "appname": "authErrorTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "auth-error" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "expectError": { - "isError": true - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "auth-error", - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "auth-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-misc-command-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-misc-command-error.json deleted file mode 100644 index fd62fe604e9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-misc-command-error.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "description": "auth-misc-command-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "auth": true, - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "auth-misc-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "Reset server and pool after misc command error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "saslContinue" - ], - "appName": "authMiscErrorTest", - "errorCode": 1 - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "appname": "authMiscErrorTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "auth-misc-error" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "expectError": { - "isError": true - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "auth-misc-error", - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "auth-misc-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-network-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-network-error.json deleted file mode 100644 index 84763af32e4..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-network-error.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "description": "auth-network-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "auth": true, - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "auth-network-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "Reset server and pool after network error during authentication", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "saslContinue" - ], - "closeConnection": true, - "appName": "authNetworkErrorTest" - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "appname": "authNetworkErrorTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "auth-network-error" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "expectError": { - "isError": true - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "auth-network-error", - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "auth-network-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-network-timeout-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-network-timeout-error.json deleted file mode 100644 index 3cf9576eba9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-network-timeout-error.json +++ /dev/null @@ -1,233 +0,0 @@ -{ - "description": "auth-network-timeout-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "auth": true, - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "auth-network-timeout-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "Reset server and pool after network timeout error during authentication", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "saslContinue" - ], - "blockConnection": true, - "blockTimeMS": 500, - "appName": "authNetworkTimeoutErrorTest" - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "appname": "authNetworkTimeoutErrorTest", - "connectTimeoutMS": 250, - "socketTimeoutMS": 250 - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "auth-network-timeout-error" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "expectError": { - "isError": true - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "auth-network-timeout-error", - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "auth-network-timeout-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-shutdown-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-shutdown-error.json deleted file mode 100644 index b9e503af66e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/auth-shutdown-error.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "description": "auth-shutdown-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "auth": true, - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "auth-shutdown-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "Reset server and pool after shutdown error during authentication", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "saslContinue" - ], - "appName": "authShutdownErrorTest", - "errorCode": 91 - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "appname": "authShutdownErrorTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "auth-shutdown-error" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "expectError": { - "isError": true - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "auth-shutdown-error", - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "auth-shutdown-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/cancel-server-check.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/cancel-server-check.json deleted file mode 100644 index a60ccfcb414..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/cancel-server-check.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "description": "cancel-server-check", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ], - "serverless": "forbid" - }, - { - "minServerVersion": "4.2", - "topologies": [ - "sharded" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "cancel-server-check", - "databaseName": "sdam-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Cancel server check", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": true, - "heartbeatFrequencyMS": 10000, - "serverSelectionTimeoutMS": 5000, - "appname": "cancelServerCheckTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "cancel-server-check" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1 - } - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - }, - "client": "setupClient" - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 2 - } - }, - "expectResult": { - "insertedId": 2 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 3 - } - }, - "expectResult": { - "insertedId": 3 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - } - ], - "outcome": [ - { - "collectionName": "cancel-server-check", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/connectTimeoutMS.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/connectTimeoutMS.json deleted file mode 100644 index d3e860a9cb2..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/connectTimeoutMS.json +++ /dev/null @@ -1,221 +0,0 @@ -{ - "description": "connectTimeoutMS", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "connectTimeoutMS", - "databaseName": "sdam-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "connectTimeoutMS=0", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "connectTimeoutMS": 0, - "heartbeatFrequencyMS": 500, - "appname": "connectTimeoutMS=0" - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "connectTimeoutMS" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "connectTimeoutMS=0", - "blockConnection": true, - "blockTimeMS": 550 - } - }, - "client": "setupClient" - } - }, - { - "name": "wait", - "object": "testRunner", - "arguments": { - "ms": 750 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 0 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 0 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "connectTimeoutMS", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "connectTimeoutMS", - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "connectTimeoutMS", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/find-network-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/find-network-error.json deleted file mode 100644 index c1b6db40ca3..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/find-network-error.json +++ /dev/null @@ -1,234 +0,0 @@ -{ - "description": "find-network-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "find-network-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "Reset server and pool after network error on find", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true, - "appName": "findNetworkErrorTest" - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "retryReads": false, - "appname": "findNetworkErrorTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "find-network-error" - } - } - ] - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "find-network-error" - }, - "commandName": "find", - "databaseName": "sdam-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "find-network-error", - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "find-network-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/find-network-timeout-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/find-network-timeout-error.json deleted file mode 100644 index e5ac9f21aa7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/find-network-timeout-error.json +++ /dev/null @@ -1,199 +0,0 @@ -{ - "description": "find-network-timeout-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "find-network-timeout-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "Ignore network timeout error on find", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "blockConnection": true, - "blockTimeMS": 500, - "appName": "findNetworkTimeoutErrorTest" - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "retryReads": false, - "appname": "findNetworkTimeoutErrorTest", - "socketTimeoutMS": 250 - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "find-network-timeout-error" - } - } - ] - } - }, - { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 3 - } - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 0 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 0 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "find-network-timeout-error" - }, - "commandName": "find", - "databaseName": "sdam-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "find-network-timeout-error", - "documents": [ - { - "_id": 3 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "find-network-timeout-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/find-shutdown-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/find-shutdown-error.json deleted file mode 100644 index 6e5a2cac055..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/find-shutdown-error.json +++ /dev/null @@ -1,251 +0,0 @@ -{ - "description": "find-shutdown-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "find-shutdown-error", - "databaseName": "sdam-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Concurrent shutdown error on find", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "uriOptions": { - "retryWrites": false, - "retryReads": false, - "heartbeatFrequencyMS": 500, - "appname": "shutdownErrorFindTest" - }, - "observeEvents": [ - "serverDescriptionChangedEvent", - "poolClearedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "find-shutdown-error" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1 - } - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "appName": "shutdownErrorFindTest", - "errorCode": 91, - "blockConnection": true, - "blockTimeMS": 500 - } - }, - "client": "setupClient" - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "thread": { - "id": "thread0" - } - }, - { - "thread": { - "id": "thread1" - } - } - ] - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread0", - "operation": { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread1", - "operation": { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectError": { - "isError": true - } - } - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread0" - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread1" - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 4 - } - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - } - ], - "outcome": [ - { - "collectionName": "find-shutdown-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 4 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/hello-command-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/hello-command-error.json deleted file mode 100644 index 87958cb2c0b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/hello-command-error.json +++ /dev/null @@ -1,376 +0,0 @@ -{ - "description": "hello-command-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4.7", - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "hello-command-error", - "databaseName": "sdam-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Command error on Monitor handshake", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "commandErrorHandshakeTest", - "closeConnection": false, - "errorCode": 91 - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "serverDescriptionChangedEvent", - "poolClearedEvent", - "commandStartedEvent" - ], - "uriOptions": { - "retryWrites": false, - "connectTimeoutMS": 250, - "heartbeatFrequencyMS": 500, - "appname": "commandErrorHandshakeTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "hello-command-error" - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "hello-command-error", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "hello-command-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "Command error on Monitor check", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "connectTimeoutMS": 1000, - "heartbeatFrequencyMS": 500, - "appname": "commandErrorCheckTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "hello-command-error" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "commandErrorCheckTest", - "closeConnection": false, - "blockConnection": true, - "blockTimeMS": 750, - "errorCode": 91 - } - }, - "client": "setupClient" - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "hello-command-error", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "hello-command-error", - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "hello-command-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/hello-network-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/hello-network-error.json deleted file mode 100644 index 15ed2b605e2..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/hello-network-error.json +++ /dev/null @@ -1,346 +0,0 @@ -{ - "description": "hello-network-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4.7", - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "hello-network-error", - "databaseName": "sdam-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Network error on Monitor handshake", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "networkErrorHandshakeTest", - "closeConnection": true - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "connectTimeoutMS": 250, - "heartbeatFrequencyMS": 500, - "appname": "networkErrorHandshakeTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "hello-network-error" - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "hello-network-error", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "hello-network-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "Network error on Monitor check", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "connectTimeoutMS": 250, - "heartbeatFrequencyMS": 500, - "appname": "networkErrorCheckTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "hello-network-error" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "networkErrorCheckTest", - "closeConnection": true - } - }, - "client": "setupClient" - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "hello-network-error", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "hello-network-error", - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "hello-network-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/hello-timeout.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/hello-timeout.json deleted file mode 100644 index fe7cf4e78d1..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/hello-timeout.json +++ /dev/null @@ -1,514 +0,0 @@ -{ - "description": "hello-timeout", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "hello-timeout", - "databaseName": "sdam-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Network timeout on Monitor handshake", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "timeoutMonitorHandshakeTest", - "blockConnection": true, - "blockTimeMS": 1000 - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "connectTimeoutMS": 250, - "heartbeatFrequencyMS": 500, - "appname": "timeoutMonitorHandshakeTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "hello-timeout" - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "hello-timeout", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "hello-timeout", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "Network timeout on Monitor check", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "connectTimeoutMS": 750, - "heartbeatFrequencyMS": 500, - "appname": "timeoutMonitorCheckTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "hello-timeout" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "timeoutMonitorCheckTest", - "blockConnection": true, - "blockTimeMS": 1000 - } - }, - "client": "setupClient" - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "hello-timeout", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "hello-timeout", - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "hello-timeout", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "Driver extends timeout while streaming", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "connectTimeoutMS": 250, - "heartbeatFrequencyMS": 500, - "appname": "extendsTimeoutTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "hello-timeout" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - }, - { - "name": "wait", - "object": "testRunner", - "arguments": { - "ms": 2000 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 0 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 0 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "hello-timeout", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "hello-timeout", - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "hello-timeout", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/insert-network-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/insert-network-error.json deleted file mode 100644 index bfe41a4cb66..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/insert-network-error.json +++ /dev/null @@ -1,246 +0,0 @@ -{ - "description": "insert-network-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "insert-network-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "Reset server and pool after network error on insert", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true, - "appName": "insertNetworkErrorTest" - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent", - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": false, - "appname": "insertNetworkErrorTest" - }, - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "insert-network-error" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "expectError": { - "isError": true - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "insert-network-error", - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "insert-network-error", - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "insert-network-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/insert-shutdown-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/insert-shutdown-error.json deleted file mode 100644 index af7c6c987af..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/insert-shutdown-error.json +++ /dev/null @@ -1,250 +0,0 @@ -{ - "description": "insert-shutdown-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid", - "topologies": [ - "single", - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "insert-shutdown-error", - "databaseName": "sdam-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Concurrent shutdown error on insert", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "uriOptions": { - "retryWrites": false, - "heartbeatFrequencyMS": 500, - "appname": "shutdownErrorInsertTest" - }, - "observeEvents": [ - "serverDescriptionChangedEvent", - "poolClearedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "insert-shutdown-error" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1 - } - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "appName": "shutdownErrorInsertTest", - "errorCode": 91, - "blockConnection": true, - "blockTimeMS": 500 - } - }, - "client": "setupClient" - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "thread": { - "id": "thread0" - } - }, - { - "thread": { - "id": "thread1" - } - } - ] - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread0", - "operation": { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 2 - } - }, - "expectError": { - "isError": true - } - } - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread1", - "operation": { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 3 - } - }, - "expectError": { - "isError": true - } - } - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread0" - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread1" - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 4 - } - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - } - ], - "outcome": [ - { - "collectionName": "insert-shutdown-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 4 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/interruptInUse-pool-clear.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/interruptInUse-pool-clear.json deleted file mode 100644 index d9329646d4c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/interruptInUse-pool-clear.json +++ /dev/null @@ -1,591 +0,0 @@ -{ - "description": "interruptInUse", - "schemaVersion": "1.11", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "interruptInUse", - "databaseName": "sdam-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Connection pool clear uses interruptInUseConnections=true after monitor timeout", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "poolClearedEvent", - "connectionClosedEvent", - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent", - "connectionCheckedOutEvent", - "connectionCheckedInEvent" - ], - "uriOptions": { - "connectTimeoutMS": 500, - "heartbeatFrequencyMS": 500, - "appname": "interruptInUse", - "retryReads": false, - "minPoolSize": 0 - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "interruptInUse" - } - }, - { - "thread": { - "id": "thread1" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1 - } - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread1", - "operation": { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$where": "sleep(2000) || true" - } - }, - "expectError": { - "isError": true - } - } - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "blockConnection": true, - "blockTimeMS": 1500, - "appName": "interruptInUse" - } - } - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread1" - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandFailedEvent": { - "commandName": "find" - } - } - ] - }, - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "poolClearedEvent": { - "interruptInUseConnections": true - } - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionClosedEvent": {} - } - ] - } - ], - "outcome": [ - { - "collectionName": "interruptInUse", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "Error returned from connection pool clear with interruptInUseConnections=true is retryable", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "poolClearedEvent", - "connectionClosedEvent", - "commandStartedEvent", - "commandFailedEvent", - "commandSucceededEvent", - "connectionCheckedOutEvent", - "connectionCheckedInEvent" - ], - "uriOptions": { - "connectTimeoutMS": 500, - "heartbeatFrequencyMS": 500, - "appname": "interruptInUseRetryable", - "retryReads": true, - "minPoolSize": 0 - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "interruptInUse" - } - }, - { - "thread": { - "id": "thread1" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1 - } - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread1", - "operation": { - "name": "find", - "object": "collection", - "arguments": { - "filter": { - "$where": "sleep(2000) || true" - } - } - } - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "blockConnection": true, - "blockTimeMS": 1500, - "appName": "interruptInUseRetryable" - } - } - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread1" - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandFailedEvent": { - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "commandName": "find" - } - }, - { - "commandSucceededEvent": { - "commandName": "find" - } - } - ] - }, - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "poolClearedEvent": { - "interruptInUseConnections": true - } - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionClosedEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ], - "outcome": [ - { - "collectionName": "interruptInUse", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "Error returned from connection pool clear with interruptInUseConnections=true is retryable for write", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "poolClearedEvent", - "connectionClosedEvent", - "commandStartedEvent", - "commandFailedEvent", - "commandSucceededEvent", - "connectionCheckedOutEvent", - "connectionCheckedInEvent" - ], - "uriOptions": { - "connectTimeoutMS": 500, - "heartbeatFrequencyMS": 500, - "appname": "interruptInUseRetryableWrite", - "retryWrites": true, - "minPoolSize": 0 - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "interruptInUse" - } - }, - { - "thread": { - "id": "thread1" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1 - } - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread1", - "operation": { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": { - "$where": "sleep(2000) || true" - }, - "update": { - "$set": { - "a": "bar" - } - } - } - } - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "blockConnection": true, - "blockTimeMS": 1500, - "appName": "interruptInUseRetryableWrite" - } - } - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread1" - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "commandName": "insert" - } - }, - { - "commandSucceededEvent": { - "commandName": "insert" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandFailedEvent": { - "commandName": "update" - } - }, - { - "commandStartedEvent": { - "commandName": "update" - } - }, - { - "commandSucceededEvent": { - "commandName": "update" - } - } - ] - }, - { - "client": "client", - "eventType": "cmap", - "events": [ - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "poolClearedEvent": { - "interruptInUseConnections": true - } - }, - { - "connectionCheckedInEvent": {} - }, - { - "connectionClosedEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ], - "outcome": [ - { - "collectionName": "interruptInUse", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1, - "a": "bar" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/loadbalanced-emit-topology-changed-before-close.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/loadbalanced-emit-topology-changed-before-close.json deleted file mode 100644 index 30c0657630b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/loadbalanced-emit-topology-changed-before-close.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "description": "loadbalanced-emit-topology-description-changed-before-close", - "schemaVersion": "1.20", - "runOnRequirements": [ - { - "topologies": [ - "load-balanced" - ], - "minServerVersion": "4.4" - } - ], - "tests": [ - { - "description": "Topology lifecycle", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "topologyDescriptionChangedEvent", - "topologyOpeningEvent", - "topologyClosedEvent" - ] - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 2 - } - }, - { - "name": "close", - "object": "client" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "events": [ - { - "topologyOpeningEvent": {} - }, - { - "topologyDescriptionChangedEvent": { - "previousDescription": { - "type": "Unknown" - }, - "newDescription": {} - } - }, - { - "topologyDescriptionChangedEvent": { - "newDescription": { - "type": "LoadBalanced" - } - } - }, - { - "topologyDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - { - "topologyClosedEvent": {} - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/logging-loadbalanced.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/logging-loadbalanced.json deleted file mode 100644 index 0ad3b0ceaa5..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/logging-loadbalanced.json +++ /dev/null @@ -1,166 +0,0 @@ -{ - "description": "loadbalanced-logging", - "schemaVersion": "1.16", - "runOnRequirements": [ - { - "topologies": [ - "load-balanced" - ], - "minServerVersion": "4.4" - } - ], - "tests": [ - { - "description": "Topology lifecycle", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "topology": "debug" - }, - "observeEvents": [ - "topologyDescriptionChangedEvent" - ] - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 2 - } - }, - { - "name": "close", - "object": "client" - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting topology monitoring", - "topologyId": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting server monitoring", - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring", - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped topology monitoring", - "topologyId": { - "$$exists": true - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/logging-replicaset.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/logging-replicaset.json deleted file mode 100644 index e6738225cd0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/logging-replicaset.json +++ /dev/null @@ -1,606 +0,0 @@ -{ - "description": "replicaset-logging", - "schemaVersion": "1.16", - "runOnRequirements": [ - { - "topologies": [ - "replicaset" - ], - "minServerVersion": "4.4" - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient" - } - } - ], - "tests": [ - { - "description": "Topology lifecycle", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "topology": "debug" - }, - "observeEvents": [ - "topologyDescriptionChangedEvent" - ] - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 4 - } - }, - { - "name": "close", - "object": "client" - } - ], - "expectLogMessages": [ - { - "client": "client", - "ignoreMessages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat started" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat succeeded" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat failed" - } - } - ], - "messages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting topology monitoring", - "topologyId": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring", - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring", - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring", - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped topology monitoring", - "topologyId": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "Successful heartbeat", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "topology": "debug" - }, - "observeEvents": [ - "serverHeartbeatSucceededEvent" - ] - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatSucceededEvent": {} - }, - "count": 3 - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "ignoreExtraMessages": true, - "ignoreMessages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat started" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed" - } - } - ], - "messages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting topology monitoring", - "topologyId": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat succeeded", - "awaited": { - "$$exists": true - }, - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "driverConnectionId": { - "$$exists": true - }, - "serverConnectionId": { - "$$exists": true - }, - "durationMS": { - "$$type": [ - "int", - "long" - ] - }, - "reply": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "ok": 1 - } - } - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat succeeded", - "awaited": { - "$$exists": true - }, - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "driverConnectionId": { - "$$exists": true - }, - "serverConnectionId": { - "$$exists": true - }, - "durationMS": { - "$$type": [ - "int", - "long" - ] - }, - "reply": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "ok": 1 - } - } - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat succeeded", - "awaited": { - "$$exists": true - }, - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "driverConnectionId": { - "$$exists": true - }, - "serverConnectionId": { - "$$exists": true - }, - "durationMS": { - "$$type": [ - "int", - "long" - ] - }, - "reply": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "ok": 1 - } - } - } - } - } - ] - } - ] - }, - { - "description": "Failing heartbeat", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "topology": "debug" - }, - "observeEvents": [ - "serverHeartbeatFailedEvent" - ], - "uriOptions": { - "appname": "failingHeartbeatLoggingTest" - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "failingHeartbeatLoggingTest", - "closeConnection": true - } - }, - "client": "setupClient" - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatFailedEvent": {} - }, - "count": 1 - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "ignoreExtraMessages": true, - "ignoreMessages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat started" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat succeeded" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed" - } - } - ], - "messages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting topology monitoring", - "topologyId": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat failed", - "awaited": { - "$$exists": true - }, - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "driverConnectionId": { - "$$exists": true - }, - "durationMS": { - "$$type": [ - "int", - "long" - ] - }, - "failure": { - "$$exists": true - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/logging-sharded.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/logging-sharded.json deleted file mode 100644 index 61b27f5be0b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/logging-sharded.json +++ /dev/null @@ -1,492 +0,0 @@ -{ - "description": "sharded-logging", - "schemaVersion": "1.16", - "runOnRequirements": [ - { - "topologies": [ - "sharded" - ], - "minServerVersion": "4.4" - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "tests": [ - { - "description": "Topology lifecycle", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "topology": "debug" - }, - "observeEvents": [ - "topologyDescriptionChangedEvent" - ], - "useMultipleMongoses": true - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 3 - } - }, - { - "name": "close", - "object": "client" - } - ], - "expectLogMessages": [ - { - "client": "client", - "ignoreMessages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat started" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat succeeded" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat failed" - } - } - ], - "messages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting topology monitoring", - "topologyId": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring", - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring", - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped topology monitoring", - "topologyId": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "Successful heartbeat", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "topology": "debug" - }, - "observeEvents": [ - "serverHeartbeatSucceededEvent" - ] - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatSucceededEvent": {} - }, - "count": 1 - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "ignoreExtraMessages": true, - "ignoreMessages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat started" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed" - } - } - ], - "messages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting topology monitoring", - "topologyId": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat succeeded", - "awaited": { - "$$exists": true - }, - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "driverConnectionId": { - "$$exists": true - }, - "serverConnectionId": { - "$$exists": true - }, - "durationMS": { - "$$type": [ - "int", - "long" - ] - }, - "reply": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "ok": 1 - } - } - } - } - } - ] - } - ] - }, - { - "description": "Failing heartbeat", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "topology": "debug" - }, - "observeEvents": [ - "serverHeartbeatStartedEvent", - "serverHeartbeatFailedEvent" - ], - "uriOptions": { - "appname": "failingHeartbeatLoggingTest" - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "failingHeartbeatLoggingTest", - "closeConnection": true - } - }, - "client": "setupClient" - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatFailedEvent": {} - }, - "count": 1 - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "ignoreExtraMessages": true, - "ignoreMessages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat started" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat succeeded" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed" - } - } - ], - "messages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting topology monitoring", - "topologyId": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat failed", - "awaited": { - "$$exists": true - }, - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "driverConnectionId": { - "$$exists": true - }, - "durationMS": { - "$$type": [ - "int", - "long" - ] - }, - "failure": { - "$$exists": true - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/logging-standalone.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/logging-standalone.json deleted file mode 100644 index 1ee6dbe8995..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/logging-standalone.json +++ /dev/null @@ -1,517 +0,0 @@ -{ - "description": "standalone-logging", - "schemaVersion": "1.16", - "runOnRequirements": [ - { - "topologies": [ - "single" - ], - "minServerVersion": "4.4" - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient" - } - } - ], - "tests": [ - { - "description": "Topology lifecycle", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "topology": "debug" - }, - "observeEvents": [ - "topologyDescriptionChangedEvent" - ] - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 2 - } - }, - { - "name": "close", - "object": "client" - } - ], - "expectLogMessages": [ - { - "client": "client", - "ignoreMessages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat started" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat succeeded" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat failed" - } - } - ], - "messages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting topology monitoring", - "topologyId": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting server monitoring", - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring", - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed", - "topologyId": { - "$$exists": true - }, - "previousDescription": { - "$$exists": true - }, - "newDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped topology monitoring", - "topologyId": { - "$$exists": true - } - } - } - ] - } - ] - }, - { - "description": "Successful heartbeat", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "topology": "debug" - }, - "observeEvents": [ - "serverHeartbeatSucceededEvent" - ] - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatSucceededEvent": {} - }, - "count": 1 - } - }, - { - "name": "close", - "object": "client" - } - ], - "expectLogMessages": [ - { - "client": "client", - "ignoreExtraMessages": true, - "ignoreMessages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped topology monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting topology monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat failed" - } - } - ], - "messages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat started", - "awaited": { - "$$exists": true - }, - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "driverConnectionId": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat succeeded", - "awaited": { - "$$exists": true - }, - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "driverConnectionId": { - "$$exists": true - }, - "serverConnectionId": { - "$$exists": true - }, - "durationMS": { - "$$type": [ - "int", - "long" - ] - }, - "reply": { - "$$matchAsDocument": { - "$$matchAsRoot": { - "ok": 1 - } - } - } - } - } - ] - } - ] - }, - { - "description": "Failing heartbeat", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeLogMessages": { - "topology": "debug" - }, - "observeEvents": [ - "serverHeartbeatFailedEvent" - ], - "uriOptions": { - "appname": "failingHeartbeatLoggingTest" - } - } - } - ] - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "failingHeartbeatLoggingTest", - "closeConnection": true - } - } - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatFailedEvent": {} - }, - "count": 1 - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "ignoreExtraMessages": true, - "ignoreMessages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped topology monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Stopped server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Topology description changed" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting server monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Starting topology monitoring" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat started" - } - }, - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat succeeded" - } - } - ], - "messages": [ - { - "level": "debug", - "component": "topology", - "data": { - "message": "Server heartbeat failed", - "awaited": { - "$$exists": true - }, - "topologyId": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - }, - "driverConnectionId": { - "$$exists": true - }, - "durationMS": { - "$$type": [ - "int", - "long" - ] - }, - "failure": { - "$$exists": true - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/minPoolSize-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/minPoolSize-error.json deleted file mode 100644 index bd9e9fcdec7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/minPoolSize-error.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "description": "minPoolSize-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4.7", - "serverless": "forbid", - "topologies": [ - "single" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "sdam-minPoolSize-error", - "databaseName": "sdam-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Network error on minPoolSize background creation", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "setupClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "skip": 3 - }, - "data": { - "failCommands": [ - "hello", - "isMaster" - ], - "appName": "SDAMminPoolSizeError", - "closeConnection": true - } - } - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "serverDescriptionChangedEvent", - "poolClearedEvent", - "poolReadyEvent" - ], - "uriOptions": { - "heartbeatFrequencyMS": 10000, - "appname": "SDAMminPoolSizeError", - "minPoolSize": 10, - "serverSelectionTimeoutMS": 1000 - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "sdam-minPoolSize-error" - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolReadyEvent": {} - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "ping": {} - }, - "commandName": "ping" - }, - "expectError": { - "isError": true - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "off" - }, - "client": "setupClient" - } - }, - { - "name": "runCommand", - "object": "database", - "arguments": { - "command": { - "ping": 1 - }, - "commandName": "ping" - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolReadyEvent": {} - }, - "count": 2 - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/pool-cleared-error.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/pool-cleared-error.json deleted file mode 100644 index b7f6924f2ba..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/pool-cleared-error.json +++ /dev/null @@ -1,373 +0,0 @@ -{ - "description": "pool-cleared-error", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.9", - "serverless": "forbid", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient", - "useMultipleMongoses": false - } - } - ], - "initialData": [ - { - "collectionName": "pool-cleared-error", - "databaseName": "sdam-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "PoolClearedError does not mark server unknown", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "serverDescriptionChangedEvent", - "poolClearedEvent" - ], - "uriOptions": { - "retryWrites": true, - "maxPoolSize": 1, - "appname": "poolClearedErrorTest" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "pool-cleared-error" - } - } - ] - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 1 - } - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "blockConnection": true, - "blockTimeMS": 100, - "closeConnection": true, - "appName": "poolClearedErrorTest" - } - }, - "client": "setupClient" - } - }, - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "thread": { - "id": "thread0" - } - }, - { - "thread": { - "id": "thread1" - } - }, - { - "thread": { - "id": "thread2" - } - }, - { - "thread": { - "id": "thread3" - } - }, - { - "thread": { - "id": "thread4" - } - }, - { - "thread": { - "id": "thread5" - } - } - ] - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread0", - "operation": { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 2 - } - } - } - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread1", - "operation": { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 3 - } - } - } - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread2", - "operation": { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 4 - } - } - } - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread3", - "operation": { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 5 - } - } - } - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread4", - "operation": { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 6 - } - } - } - } - }, - { - "name": "runOnThread", - "object": "testRunner", - "arguments": { - "thread": "thread5", - "operation": { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 7 - } - } - } - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread0" - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread1" - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread2" - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread3" - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread4" - } - }, - { - "name": "waitForThread", - "object": "testRunner", - "arguments": { - "thread": "thread5" - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 8 - } - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 1 - } - } - ], - "outcome": [ - { - "collectionName": "pool-cleared-error", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - }, - { - "_id": 5 - }, - { - "_id": 6 - }, - { - "_id": 7 - }, - { - "_id": 8 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/rediscover-quickly-after-step-down.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/rediscover-quickly-after-step-down.json deleted file mode 100644 index 3147a07a1e6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/rediscover-quickly-after-step-down.json +++ /dev/null @@ -1,242 +0,0 @@ -{ - "description": "rediscover-quickly-after-step-down", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4", - "serverless": "forbid", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "setupClient" - } - }, - { - "database": { - "id": "adminDatabase", - "client": "setupClient", - "databaseName": "admin" - } - } - ], - "initialData": [ - { - "collectionName": "test-replSetStepDown", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "Rediscover quickly after replSetStepDown", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "poolClearedEvent", - "commandStartedEvent" - ], - "uriOptions": { - "appname": "replSetStepDownTest", - "heartbeatFrequencyMS": 60000, - "serverSelectionTimeoutMS": 5000, - "w": "majority" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "sdam-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test-replSetStepDown" - } - } - ] - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - }, - { - "name": "recordTopologyDescription", - "object": "testRunner", - "arguments": { - "client": "client", - "id": "topologyDescription" - } - }, - { - "name": "assertTopologyType", - "object": "testRunner", - "arguments": { - "topologyDescription": "topologyDescription", - "topologyType": "ReplicaSetWithPrimary" - } - }, - { - "name": "runCommand", - "object": "adminDatabase", - "arguments": { - "command": { - "replSetFreeze": 0 - }, - "readPreference": { - "mode": "secondary" - }, - "commandName": "replSetFreeze" - } - }, - { - "name": "runCommand", - "object": "adminDatabase", - "arguments": { - "command": { - "replSetStepDown": 30, - "secondaryCatchUpPeriodSecs": 30, - "force": false - }, - "commandName": "replSetStepDown" - } - }, - { - "name": "waitForPrimaryChange", - "object": "testRunner", - "arguments": { - "client": "client", - "priorTopologyDescription": "topologyDescription", - "timeoutMS": 15000 - } - }, - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "poolClearedEvent": {} - }, - "count": 0 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test-replSetStepDown", - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test-replSetStepDown", - "documents": [ - { - "_id": 5 - }, - { - "_id": 6 - } - ] - }, - "commandName": "insert", - "databaseName": "sdam-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test-replSetStepDown", - "databaseName": "sdam-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - }, - { - "_id": 5 - }, - { - "_id": 6 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/replicaset-emit-topology-changed-before-close.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/replicaset-emit-topology-changed-before-close.json deleted file mode 100644 index 066a4ffee5f..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/replicaset-emit-topology-changed-before-close.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "description": "replicaset-emit-topology-description-changed-before-close", - "schemaVersion": "1.20", - "runOnRequirements": [ - { - "topologies": [ - "replicaset" - ], - "minServerVersion": "4.4" - } - ], - "tests": [ - { - "description": "Topology lifecycle", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "topologyDescriptionChangedEvent", - "topologyOpeningEvent", - "topologyClosedEvent" - ] - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 4 - } - }, - { - "name": "close", - "object": "client" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "ignoreExtraEvents": false, - "events": [ - { - "topologyOpeningEvent": {} - }, - { - "topologyDescriptionChangedEvent": {} - }, - { - "topologyDescriptionChangedEvent": {} - }, - { - "topologyDescriptionChangedEvent": {} - }, - { - "topologyDescriptionChangedEvent": {} - }, - { - "topologyDescriptionChangedEvent": { - "previousDescription": { - "type": "ReplicaSetWithPrimary" - }, - "newDescription": { - "type": "Unknown" - } - } - }, - { - "topologyClosedEvent": {} - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/serverMonitoringMode-java-specific.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/serverMonitoringMode-java-specific.json deleted file mode 100644 index 2d50d211c8a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/serverMonitoringMode-java-specific.json +++ /dev/null @@ -1,190 +0,0 @@ -{ - "description": "serverMonitoringMode-Java-specific", - "schemaVersion": "1.17", - "runOnRequirements": [ - { - "topologies": [ - "single", - "sharded", - "sharded-replicaset" - ], - "serverless": "forbid" - } - ], - "tests": [ - { - "description": "connect with serverMonitoringMode=auto >=4.4 Java-specific", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "serverMonitoringMode": "auto" - }, - "useMultipleMongoses": false, - "observeEvents": [ - "serverHeartbeatStartedEvent", - "serverHeartbeatSucceededEvent", - "serverHeartbeatFailedEvent" - ] - } - }, - { - "database": { - "id": "db", - "client": "client", - "databaseName": "sdam-tests" - } - } - ] - } - }, - { - "name": "runCommand", - "object": "db", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectResult": { - "ok": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatStartedEvent": {} - }, - "count": 2 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "ignoreExtraEvents": true, - "events": [ - { - "serverHeartbeatStartedEvent": { - "awaited": true - } - }, - { - "serverHeartbeatSucceededEvent": { - "awaited": true - } - }, - { - "serverHeartbeatStartedEvent": { - "awaited": true - } - } - ] - } - ] - }, - { - "description": "connect with serverMonitoringMode=stream >=4.4 Java-specific", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "serverMonitoringMode": "stream" - }, - "useMultipleMongoses": false, - "observeEvents": [ - "serverHeartbeatStartedEvent", - "serverHeartbeatSucceededEvent", - "serverHeartbeatFailedEvent" - ] - } - }, - { - "database": { - "id": "db", - "client": "client", - "databaseName": "sdam-tests" - } - } - ] - } - }, - { - "name": "runCommand", - "object": "db", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectResult": { - "ok": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatStartedEvent": {} - }, - "count": 2 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "ignoreExtraEvents": true, - "events": [ - { - "serverHeartbeatStartedEvent": { - "awaited": true - } - }, - { - "serverHeartbeatSucceededEvent": { - "awaited": true - } - }, - { - "serverHeartbeatStartedEvent": { - "awaited": true - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/serverMonitoringMode.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/serverMonitoringMode.json deleted file mode 100644 index 4b492f7d853..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/serverMonitoringMode.json +++ /dev/null @@ -1,512 +0,0 @@ -{ - "description": "serverMonitoringMode", - "schemaVersion": "1.17", - "runOnRequirements": [ - { - "topologies": [ - "single", - "sharded", - "sharded-replicaset" - ], - "serverless": "forbid" - } - ], - "tests": [ - { - "description": "connect with serverMonitoringMode=auto >=4.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "serverMonitoringMode": "auto" - }, - "useMultipleMongoses": false, - "observeEvents": [ - "serverHeartbeatStartedEvent", - "serverHeartbeatSucceededEvent", - "serverHeartbeatFailedEvent" - ] - } - }, - { - "database": { - "id": "db", - "client": "client", - "databaseName": "sdam-tests" - } - } - ] - } - }, - { - "name": "runCommand", - "object": "db", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectResult": { - "ok": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatStartedEvent": {} - }, - "count": 2 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "ignoreExtraEvents": true, - "events": [ - { - "serverHeartbeatStartedEvent": { - "awaited": false - } - }, - { - "serverHeartbeatSucceededEvent": { - "awaited": false - } - }, - { - "serverHeartbeatStartedEvent": { - "awaited": true - } - } - ] - } - ] - }, - { - "description": "connect with serverMonitoringMode=auto <4.4", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "serverMonitoringMode": "auto", - "heartbeatFrequencyMS": 500 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "serverHeartbeatStartedEvent", - "serverHeartbeatSucceededEvent", - "serverHeartbeatFailedEvent" - ] - } - }, - { - "database": { - "id": "db", - "client": "client", - "databaseName": "sdam-tests" - } - } - ] - } - }, - { - "name": "runCommand", - "object": "db", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectResult": { - "ok": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatStartedEvent": {} - }, - "count": 2 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "ignoreExtraEvents": true, - "events": [ - { - "serverHeartbeatStartedEvent": { - "awaited": false - } - }, - { - "serverHeartbeatSucceededEvent": { - "awaited": false - } - }, - { - "serverHeartbeatStartedEvent": { - "awaited": false - } - } - ] - } - ] - }, - { - "description": "connect with serverMonitoringMode=stream >=4.4", - "runOnRequirements": [ - { - "minServerVersion": "4.4.0" - } - ], - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "serverMonitoringMode": "stream" - }, - "useMultipleMongoses": false, - "observeEvents": [ - "serverHeartbeatStartedEvent", - "serverHeartbeatSucceededEvent", - "serverHeartbeatFailedEvent" - ] - } - }, - { - "database": { - "id": "db", - "client": "client", - "databaseName": "sdam-tests" - } - } - ] - } - }, - { - "name": "runCommand", - "object": "db", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectResult": { - "ok": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatStartedEvent": {} - }, - "count": 2 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "ignoreExtraEvents": true, - "events": [ - { - "serverHeartbeatStartedEvent": { - "awaited": false - } - }, - { - "serverHeartbeatSucceededEvent": { - "awaited": false - } - }, - { - "serverHeartbeatStartedEvent": { - "awaited": true - } - } - ] - } - ] - }, - { - "description": "connect with serverMonitoringMode=stream <4.4", - "runOnRequirements": [ - { - "maxServerVersion": "4.2.99" - } - ], - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "serverMonitoringMode": "stream", - "heartbeatFrequencyMS": 500 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "serverHeartbeatStartedEvent", - "serverHeartbeatSucceededEvent", - "serverHeartbeatFailedEvent" - ] - } - }, - { - "database": { - "id": "db", - "client": "client", - "databaseName": "sdam-tests" - } - } - ] - } - }, - { - "name": "runCommand", - "object": "db", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectResult": { - "ok": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatStartedEvent": {} - }, - "count": 2 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "ignoreExtraEvents": true, - "events": [ - { - "serverHeartbeatStartedEvent": { - "awaited": false - } - }, - { - "serverHeartbeatSucceededEvent": { - "awaited": false - } - }, - { - "serverHeartbeatStartedEvent": { - "awaited": false - } - } - ] - } - ] - }, - { - "description": "connect with serverMonitoringMode=poll", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "serverMonitoringMode": "poll", - "heartbeatFrequencyMS": 500 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "serverHeartbeatStartedEvent", - "serverHeartbeatSucceededEvent", - "serverHeartbeatFailedEvent" - ] - } - }, - { - "database": { - "id": "db", - "client": "client", - "databaseName": "sdam-tests" - } - } - ] - } - }, - { - "name": "runCommand", - "object": "db", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - } - }, - "expectResult": { - "ok": 1 - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatStartedEvent": {} - }, - "count": 2 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "ignoreExtraEvents": true, - "events": [ - { - "serverHeartbeatStartedEvent": { - "awaited": false - } - }, - { - "serverHeartbeatSucceededEvent": { - "awaited": false - } - }, - { - "serverHeartbeatStartedEvent": { - "awaited": false - } - } - ] - } - ] - }, - { - "description": "poll waits after successful heartbeat", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "serverMonitoringMode": "poll", - "heartbeatFrequencyMS": 1000000 - }, - "useMultipleMongoses": false, - "observeEvents": [ - "serverHeartbeatStartedEvent", - "serverHeartbeatSucceededEvent" - ] - } - }, - { - "database": { - "id": "db", - "client": "client", - "databaseName": "sdam-tests" - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatSucceededEvent": {} - }, - "count": 1 - } - }, - { - "name": "wait", - "object": "testRunner", - "arguments": { - "ms": 500 - } - }, - { - "name": "assertEventCount", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverHeartbeatStartedEvent": {} - }, - "count": 1 - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/sharded-emit-topology-changed-before-close.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/sharded-emit-topology-changed-before-close.json deleted file mode 100644 index 98fb5855314..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/sharded-emit-topology-changed-before-close.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "description": "sharded-emit-topology-description-changed-before-close", - "schemaVersion": "1.20", - "runOnRequirements": [ - { - "topologies": [ - "sharded" - ], - "minServerVersion": "4.4" - } - ], - "tests": [ - { - "description": "Topology lifecycle", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "topologyDescriptionChangedEvent", - "topologyOpeningEvent", - "topologyClosedEvent" - ], - "useMultipleMongoses": true - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 3 - } - }, - { - "name": "close", - "object": "client" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "ignoreExtraEvents": false, - "events": [ - { - "topologyOpeningEvent": {} - }, - { - "topologyDescriptionChangedEvent": { - "previousDescription": { - "type": "Unknown" - }, - "newDescription": { - "type": "Unknown" - } - } - }, - { - "topologyDescriptionChangedEvent": { - "previousDescription": { - "type": "Unknown" - }, - "newDescription": { - "type": "Sharded" - } - } - }, - { - "topologyDescriptionChangedEvent": { - "previousDescription": { - "type": "Sharded" - }, - "newDescription": { - "type": "Sharded" - } - } - }, - { - "topologyDescriptionChangedEvent": { - "previousDescription": { - "type": "Sharded" - }, - "newDescription": { - "type": "Unknown" - } - } - }, - { - "topologyClosedEvent": {} - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/standalone-emit-topology-changed-before-close.json b/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/standalone-emit-topology-changed-before-close.json deleted file mode 100644 index 27b5444d541..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-discovery-and-monitoring/standalone-emit-topology-changed-before-close.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "description": "standalone-emit-topology-description-changed-before-close", - "schemaVersion": "1.20", - "runOnRequirements": [ - { - "topologies": [ - "single" - ], - "minServerVersion": "4.4" - } - ], - "tests": [ - { - "description": "Topology lifecycle", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "topologyDescriptionChangedEvent", - "topologyOpeningEvent", - "topologyClosedEvent" - ] - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 2 - } - }, - { - "name": "close", - "object": "client" - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "ignoreExtraEvents": false, - "events": [ - { - "topologyOpeningEvent": {} - }, - { - "topologyDescriptionChangedEvent": { - "previousDescription": { - "type": "Unknown" - }, - "newDescription": { - "type": "Unknown" - } - } - }, - { - "topologyDescriptionChangedEvent": { - "previousDescription": { - "type": "Unknown" - }, - "newDescription": { - "type": "Single" - } - } - }, - { - "topologyDescriptionChangedEvent": { - "previousDescription": { - "type": "Single" - }, - "newDescription": { - "type": "Unknown" - } - } - }, - { - "topologyClosedEvent": {} - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-selection/logging/load-balanced.json b/driver-core/src/test/resources/unified-test-format/server-selection/logging/load-balanced.json deleted file mode 100644 index 5855c4e991e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-selection/logging/load-balanced.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "description": "server-selection-logging", - "schemaVersion": "1.13", - "runOnRequirements": [ - { - "topologies": [ - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "uriOptions": { - "heartbeatFrequencyMS": 500 - }, - "observeLogMessages": { - "serverSelection": "debug" - }, - "observeEvents": [ - "serverDescriptionChangedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "server-selection" - } - } - ], - "tests": [ - { - "description": "A successful operation - load balanced cluster", - "operations": [ - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "LoadBalancer" - } - } - }, - "count": 1 - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection started", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection succeeded", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-selection/logging/operation-id.json b/driver-core/src/test/resources/unified-test-format/server-selection/logging/operation-id.json deleted file mode 100644 index 72ebff60d80..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-selection/logging/operation-id.json +++ /dev/null @@ -1,418 +0,0 @@ -{ - "description": "operation-id", - "schemaVersion": "1.14", - "runOnRequirements": [ - { - "topologies": [ - "single" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "uriOptions": { - "retryWrites": false, - "heartbeatFrequencyMS": 500, - "appName": "loggingClient", - "serverSelectionTimeoutMS": 2000 - }, - "observeLogMessages": { - "serverSelection": "debug" - }, - "observeEvents": [ - "serverDescriptionChangedEvent", - "topologyDescriptionChangedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "server-selection" - } - }, - { - "client": { - "id": "failPointClient" - } - } - ], - "_yamlAnchors": { - "namespace": "logging-tests.server-selection" - }, - "tests": [ - { - "description": "Successful bulkWrite operation: log messages have operationIds", - "operations": [ - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 2 - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "x": 1 - } - } - } - ] - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection started", - "operationId": { - "$$type": [ - "int", - "long" - ] - }, - "operation": "insert" - } - }, - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection succeeded", - "operationId": { - "$$type": [ - "int", - "long" - ] - }, - "operation": "insert" - } - } - ] - } - ] - }, - { - "description": "Failed bulkWrite operation: log messages have operationIds", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "hello", - "ismaster" - ], - "appName": "loggingClient", - "closeConnection": true - } - } - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "x": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection started", - "operationId": { - "$$type": [ - "int", - "long" - ] - }, - "operation": "insert" - } - }, - { - "level": "info", - "component": "serverSelection", - "data": { - "message": "Waiting for suitable server to become available", - "operationId": { - "$$type": [ - "int", - "long" - ] - }, - "operation": "insert" - } - }, - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection failed", - "operationId": { - "$$type": [ - "int", - "long" - ] - }, - "operation": "insert" - } - } - ] - } - ] - }, - { - "description": "Successful client bulkWrite operation: log messages have operationIds", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 2 - } - }, - { - "name": "clientBulkWrite", - "object": "client", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "logging-tests.server-selection", - "document": { - "x": 1 - } - } - } - ] - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection started", - "operationId": { - "$$type": [ - "int", - "long" - ] - }, - "operation": "bulkWrite" - } - }, - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection succeeded", - "operationId": { - "$$type": [ - "int", - "long" - ] - }, - "operation": "bulkWrite" - } - } - ] - } - ] - }, - { - "description": "Failed client bulkWrite operation: log messages have operationIds", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "hello", - "ismaster" - ], - "appName": "loggingClient", - "closeConnection": true - } - } - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "clientBulkWrite", - "object": "client", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "logging-tests.server-selection", - "document": { - "x": 1 - } - } - } - ] - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection started", - "operationId": { - "$$type": [ - "int", - "long" - ] - }, - "operation": "bulkWrite" - } - }, - { - "level": "info", - "component": "serverSelection", - "data": { - "message": "Waiting for suitable server to become available", - "operationId": { - "$$type": [ - "int", - "long" - ] - }, - "operation": "bulkWrite" - } - }, - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection failed", - "operationId": { - "$$type": [ - "int", - "long" - ] - }, - "operation": "bulkWrite" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-selection/logging/replica-set.json b/driver-core/src/test/resources/unified-test-format/server-selection/logging/replica-set.json deleted file mode 100644 index 5eba784bf2a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-selection/logging/replica-set.json +++ /dev/null @@ -1,228 +0,0 @@ -{ - "description": "replica-set-logging", - "schemaVersion": "1.14", - "runOnRequirements": [ - { - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "uriOptions": { - "retryWrites": false, - "heartbeatFrequencyMS": 500, - "serverSelectionTimeoutMS": 2000 - }, - "observeLogMessages": { - "serverSelection": "debug" - }, - "observeEvents": [ - "serverDescriptionChangedEvent", - "topologyDescriptionChangedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "server-selection" - } - }, - { - "client": { - "id": "failPointClient" - } - }, - { - "collection": { - "id": "unsatisfiableRPColl", - "database": "database", - "collectionName": "unsatisfiableRPColl", - "collectionOptions": { - "readPreference": { - "mode": "Secondary", - "tagSets": [ - { - "nonexistenttag": "a" - } - ] - } - } - } - } - ], - "tests": [ - { - "description": "A successful operation", - "operations": [ - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 4 - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection started", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection succeeded", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - }, - { - "description": "Server selection fails due to unsatisfiable read preference", - "runOnRequirements": [ - { - "minServerVersion": "4.0" - } - ], - "operations": [ - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 4 - } - }, - { - "name": "find", - "object": "unsatisfiableRPColl", - "arguments": { - "filter": { - "x": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection started", - "selector": { - "$$exists": true - }, - "operation": "find", - "topologyDescription": { - "$$exists": true - } - } - }, - { - "level": "info", - "component": "serverSelection", - "data": { - "message": "Waiting for suitable server to become available", - "selector": { - "$$exists": true - }, - "operation": "find", - "topologyDescription": { - "$$exists": true - }, - "remainingTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection failed", - "selector": { - "$$exists": true - }, - "operation": "find", - "topologyDescription": { - "$$exists": true - }, - "failure": { - "$$exists": true - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-selection/logging/sharded.json b/driver-core/src/test/resources/unified-test-format/server-selection/logging/sharded.json deleted file mode 100644 index d42fba91004..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-selection/logging/sharded.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "description": "server-selection-logging", - "schemaVersion": "1.14", - "runOnRequirements": [ - { - "topologies": [ - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "uriOptions": { - "retryWrites": false, - "heartbeatFrequencyMS": 500, - "appName": "loggingClient", - "serverSelectionTimeoutMS": 2000 - }, - "observeLogMessages": { - "serverSelection": "debug" - }, - "observeEvents": [ - "serverDescriptionChangedEvent", - "topologyDescriptionChangedEvent" - ], - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "server-selection" - } - }, - { - "client": { - "id": "failPointClient", - "useMultipleMongoses": false - } - } - ], - "tests": [ - { - "description": "A successful operation", - "operations": [ - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 2 - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection started", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection succeeded", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - }, - { - "description": "Failure due to unreachable server", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "hello", - "ismaster" - ], - "appName": "loggingClient", - "closeConnection": true - } - } - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection started", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - } - } - }, - { - "level": "info", - "component": "serverSelection", - "data": { - "message": "Waiting for suitable server to become available", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - }, - "remainingTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection failed", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - }, - "failure": { - "$$exists": true - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/server-selection/logging/standalone.json b/driver-core/src/test/resources/unified-test-format/server-selection/logging/standalone.json deleted file mode 100644 index 3b3eddd841e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/server-selection/logging/standalone.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "description": "standalone-logging", - "schemaVersion": "1.14", - "runOnRequirements": [ - { - "topologies": [ - "single" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "uriOptions": { - "retryWrites": false, - "heartbeatFrequencyMS": 500, - "appName": "loggingClient", - "serverSelectionTimeoutMS": 2000 - }, - "observeLogMessages": { - "serverSelection": "debug" - }, - "observeEvents": [ - "serverDescriptionChangedEvent", - "topologyDescriptionChangedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "logging-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "server-selection" - } - }, - { - "client": { - "id": "failPointClient" - } - } - ], - "tests": [ - { - "description": "A successful operation", - "operations": [ - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 2 - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection started", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - } - } - }, - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection succeeded", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - }, - "serverHost": { - "$$type": "string" - }, - "serverPort": { - "$$type": [ - "int", - "long" - ] - } - } - } - ] - } - ] - }, - { - "description": "Failure due to unreachable server", - "runOnRequirements": [ - { - "minServerVersion": "4.4" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "failPointClient", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": "alwaysOn", - "data": { - "failCommands": [ - "hello", - "ismaster" - ], - "appName": "loggingClient", - "closeConnection": true - } - } - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "serverDescriptionChangedEvent": { - "newDescription": { - "type": "Unknown" - } - } - }, - "count": 1 - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "x": 1 - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectLogMessages": [ - { - "client": "client", - "messages": [ - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection started", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - } - } - }, - { - "level": "info", - "component": "serverSelection", - "data": { - "message": "Waiting for suitable server to become available", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - }, - "remainingTimeMS": { - "$$type": [ - "int", - "long" - ] - } - } - }, - { - "level": "debug", - "component": "serverSelection", - "data": { - "message": "Server selection failed", - "selector": { - "$$exists": true - }, - "operation": "insert", - "topologyDescription": { - "$$exists": true - }, - "failure": { - "$$exists": true - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/sessions/driver-sessions-dirty-session-errors.json b/driver-core/src/test/resources/unified-test-format/sessions/driver-sessions-dirty-session-errors.json deleted file mode 100644 index 6aa1da1df5e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/sessions/driver-sessions-dirty-session-errors.json +++ /dev/null @@ -1,968 +0,0 @@ -{ - "description": "driver-sessions-dirty-session-errors", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "session-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ], - "tests": [ - { - "description": "Dirty explicit session is discarded (insert)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "name": "assertSessionNotDirty", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "name": "assertSessionDirty", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "assertSessionDirty", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "endSession", - "object": "session0" - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": -1 - } - }, - "expectResult": [] - }, - { - "name": "assertDifferentLsidOnLastTwoCommands", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1 - }, - "commandName": "insert", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1 - }, - "commandName": "insert", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 3 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 2 - }, - "commandName": "insert", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": -1 - }, - "lsid": { - "$$type": "object" - } - }, - "commandName": "find", - "databaseName": "session-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ] - }, - { - "description": "Dirty explicit session is discarded (findAndModify)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "closeConnection": true - } - } - } - }, - { - "name": "assertSessionNotDirty", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1 - } - }, - { - "name": "assertSessionDirty", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "endSession", - "object": "session0" - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": -1 - } - }, - "expectResult": [] - }, - { - "name": "assertDifferentLsidOnLastTwoCommands", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "new": false, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "new": false, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": -1 - }, - "lsid": { - "$$type": "object" - } - }, - "commandName": "find", - "databaseName": "session-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1, - "x": 1 - } - ] - } - ] - }, - { - "description": "Dirty implicit session is discarded (insert)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": -1 - } - }, - "expectResult": [] - }, - { - "name": "assertDifferentLsidOnLastTwoCommands", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$type": "object" - }, - "txnNumber": 1 - }, - "commandName": "insert", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$type": "object" - }, - "txnNumber": 1 - }, - "commandName": "insert", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": -1 - }, - "lsid": { - "$$type": "object" - } - }, - "commandName": "find", - "databaseName": "session-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "Dirty implicit session is discarded (findAndModify)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "closeConnection": true - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1 - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": -1 - } - }, - "expectResult": [] - }, - { - "name": "assertDifferentLsidOnLastTwoCommands", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "new": false, - "lsid": { - "$$type": "object" - }, - "txnNumber": 1, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "new": false, - "lsid": { - "$$type": "object" - }, - "txnNumber": 1, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": -1 - }, - "lsid": { - "$$type": "object" - } - }, - "commandName": "find", - "databaseName": "session-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1, - "x": 1 - } - ] - } - ] - }, - { - "description": "Dirty implicit session is discarded (read returning cursor)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 1 - } - ] - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": -1 - } - }, - "expectResult": [] - }, - { - "name": "assertDifferentLsidOnLastTwoCommands", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "lsid": { - "$$type": "object" - } - }, - "commandName": "aggregate", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "lsid": { - "$$type": "object" - } - }, - "commandName": "aggregate", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": -1 - }, - "lsid": { - "$$type": "object" - } - }, - "commandName": "find", - "databaseName": "session-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "Dirty implicit session is discarded (read not returning cursor)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "filter": {} - }, - "expectResult": 1 - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": -1 - } - }, - "expectResult": [] - }, - { - "name": "assertDifferentLsidOnLastTwoCommands", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ], - "lsid": { - "$$type": "object" - } - }, - "commandName": "aggregate", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$match": {} - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ], - "lsid": { - "$$type": "object" - } - }, - "commandName": "aggregate", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": -1 - }, - "lsid": { - "$$type": "object" - } - }, - "commandName": "find", - "databaseName": "session-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/sessions/driver-sessions-server-support.json b/driver-core/src/test/resources/unified-test-format/sessions/driver-sessions-server-support.json deleted file mode 100644 index 55312b32eb8..00000000000 --- a/driver-core/src/test/resources/unified-test-format/sessions/driver-sessions-server-support.json +++ /dev/null @@ -1,256 +0,0 @@ -{ - "description": "driver-sessions-server-support", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "session-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ], - "tests": [ - { - "description": "Server supports explicit sessions", - "operations": [ - { - "name": "assertSessionNotDirty", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "name": "assertSessionNotDirty", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "endSession", - "object": "session0" - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": -1 - } - }, - "expectResult": [] - }, - { - "name": "assertSameLsidOnLastTwoCommands", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - } - }, - "commandName": "insert", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": -1 - }, - "lsid": { - "$$sessionLsid": "session0" - } - }, - "commandName": "find", - "databaseName": "session-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "Server supports implicit sessions", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": -1 - } - }, - "expectResult": [] - }, - { - "name": "assertSameLsidOnLastTwoCommands", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$type": "object" - } - }, - "commandName": "insert", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": -1 - }, - "lsid": { - "$$type": "object" - } - }, - "commandName": "find", - "databaseName": "session-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/sessions/implicit-sessions-default-causal-consistency.json b/driver-core/src/test/resources/unified-test-format/sessions/implicit-sessions-default-causal-consistency.json deleted file mode 100644 index 517c8ebc63b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/sessions/implicit-sessions-default-causal-consistency.json +++ /dev/null @@ -1,318 +0,0 @@ -{ - "description": "implicit sessions default causal consistency", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "implicit-cc-tests" - } - }, - { - "collection": { - "id": "collectionDefault", - "database": "database0", - "collectionName": "coll-default" - } - }, - { - "collection": { - "id": "collectionSnapshot", - "database": "database0", - "collectionName": "coll-snapshot", - "collectionOptions": { - "readConcern": { - "level": "snapshot" - } - } - } - }, - { - "collection": { - "id": "collectionlinearizable", - "database": "database0", - "collectionName": "coll-linearizable", - "collectionOptions": { - "readConcern": { - "level": "linearizable" - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll-default", - "databaseName": "implicit-cc-tests", - "documents": [ - { - "_id": 1, - "x": "default" - } - ] - }, - { - "collectionName": "coll-snapshot", - "databaseName": "implicit-cc-tests", - "documents": [ - { - "_id": 1, - "x": "snapshot" - } - ] - }, - { - "collectionName": "coll-linearizable", - "databaseName": "implicit-cc-tests", - "documents": [ - { - "_id": 1, - "x": "linearizable" - } - ] - } - ], - "tests": [ - { - "description": "readConcern is not sent on retried read in implicit session when readConcern level is not specified", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11600 - } - } - } - }, - { - "name": "find", - "object": "collectionDefault", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": "default" - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll-default", - "filter": {}, - "readConcern": { - "$$exists": false - } - }, - "databaseName": "implicit-cc-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll-default", - "filter": {}, - "readConcern": { - "$$exists": false - } - }, - "databaseName": "implicit-cc-tests" - } - } - ] - } - ] - }, - { - "description": "afterClusterTime is not sent on retried read in implicit session when readConcern level is snapshot", - "runOnRequirements": [ - { - "minServerVersion": "5.0" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11600 - } - } - } - }, - { - "name": "find", - "object": "collectionSnapshot", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": "snapshot" - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll-snapshot", - "filter": {}, - "readConcern": { - "level": "snapshot", - "afterClusterTime": { - "$$exists": false - } - } - }, - "databaseName": "implicit-cc-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll-snapshot", - "filter": {}, - "readConcern": { - "level": "snapshot", - "afterClusterTime": { - "$$exists": false - } - } - }, - "databaseName": "implicit-cc-tests" - } - } - ] - } - ] - }, - { - "description": "afterClusterTime is not sent on retried read in implicit session when readConcern level is linearizable", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11600 - } - } - } - }, - { - "name": "find", - "object": "collectionlinearizable", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": "linearizable" - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll-linearizable", - "filter": {}, - "readConcern": { - "level": "linearizable", - "afterClusterTime": { - "$$exists": false - } - } - }, - "databaseName": "implicit-cc-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll-linearizable", - "filter": {}, - "readConcern": { - "level": "linearizable", - "afterClusterTime": { - "$$exists": false - } - } - }, - "databaseName": "implicit-cc-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/sessions/snapshot-sessions-not-supported-client-error.json b/driver-core/src/test/resources/unified-test-format/sessions/snapshot-sessions-not-supported-client-error.json deleted file mode 100644 index 208e4cfe63e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/sessions/snapshot-sessions-not-supported-client-error.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "description": "snapshot-sessions-not-supported-client-error", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "maxServerVersion": "4.4.99" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - }, - { - "session": { - "id": "session0", - "client": "client0", - "sessionOptions": { - "snapshot": true - } - } - } - ], - "initialData": [ - { - "collectionName": "collection0", - "databaseName": "database0", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "Client error on find with snapshot", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": {} - }, - "expectError": { - "isClientError": true, - "errorContains": "Snapshot reads require MongoDB 5.0 or later" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Client error on aggregate with snapshot", - "operations": [ - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "session": "session0", - "pipeline": [] - }, - "expectError": { - "isClientError": true, - "errorContains": "Snapshot reads require MongoDB 5.0 or later" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - }, - { - "description": "Client error on distinct with snapshot", - "operations": [ - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session0" - }, - "expectError": { - "isClientError": true, - "errorContains": "Snapshot reads require MongoDB 5.0 or later" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/sessions/snapshot-sessions-not-supported-server-error.json b/driver-core/src/test/resources/unified-test-format/sessions/snapshot-sessions-not-supported-server-error.json deleted file mode 100644 index 79213f314f7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/sessions/snapshot-sessions-not-supported-server-error.json +++ /dev/null @@ -1,187 +0,0 @@ -{ - "description": "snapshot-sessions-not-supported-server-error", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "5.0", - "topologies": [ - "single" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - }, - { - "session": { - "id": "session0", - "client": "client0", - "sessionOptions": { - "snapshot": true - } - } - } - ], - "initialData": [ - { - "collectionName": "collection0", - "databaseName": "database0", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "Server returns an error on find with snapshot", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": {} - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "find" - } - } - ] - } - ] - }, - { - "description": "Server returns an error on aggregate with snapshot", - "operations": [ - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "session": "session0", - "pipeline": [] - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "aggregate" - } - } - ] - } - ] - }, - { - "description": "Server returns an error on distinct with snapshot", - "operations": [ - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session0" - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "distinct" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/sessions/snapshot-sessions-unsupported-ops.json b/driver-core/src/test/resources/unified-test-format/sessions/snapshot-sessions-unsupported-ops.json deleted file mode 100644 index c41f74d3370..00000000000 --- a/driver-core/src/test/resources/unified-test-format/sessions/snapshot-sessions-unsupported-ops.json +++ /dev/null @@ -1,493 +0,0 @@ -{ - "description": "snapshot-sessions-unsupported-ops", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "5.0", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0" - } - }, - { - "session": { - "id": "session0", - "client": "client0", - "sessionOptions": { - "snapshot": true - } - } - } - ], - "initialData": [ - { - "collectionName": "collection0", - "databaseName": "database0", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "Server returns an error on insertOne with snapshot", - "runOnRequirements": [ - { - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 22, - "x": 22 - } - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "Server returns an error on insertMany with snapshot", - "runOnRequirements": [ - { - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "session": "session0", - "documents": [ - { - "_id": 22, - "x": 22 - }, - { - "_id": 33, - "x": 33 - } - ] - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "Server returns an error on deleteOne with snapshot", - "runOnRequirements": [ - { - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "deleteOne", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": {} - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "delete" - } - } - ] - } - ] - }, - { - "description": "Server returns an error on updateOne with snapshot", - "runOnRequirements": [ - { - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "update" - } - } - ] - } - ] - }, - { - "description": "Server returns an error on findOneAndUpdate with snapshot", - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "findAndModify" - } - } - ] - } - ] - }, - { - "description": "Server returns an error on listDatabases with snapshot", - "operations": [ - { - "name": "listDatabases", - "object": "client0", - "arguments": { - "session": "session0" - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1, - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "listDatabases" - } - } - ] - } - ] - }, - { - "description": "Server returns an error on listCollections with snapshot", - "operations": [ - { - "name": "listCollections", - "object": "database0", - "arguments": { - "session": "session0" - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1, - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "listCollections" - } - } - ] - } - ] - }, - { - "description": "Server returns an error on listIndexes with snapshot", - "operations": [ - { - "name": "listIndexes", - "object": "collection0", - "arguments": { - "session": "session0" - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listIndexes": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "listIndexes" - } - } - ] - } - ] - }, - { - "description": "Server returns an error on runCommand with snapshot", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "session": "session0", - "commandName": "listCollections", - "command": { - "listCollections": 1 - } - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listCollections": 1, - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandFailedEvent": { - "commandName": "listCollections" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/sessions/snapshot-sessions.json b/driver-core/src/test/resources/unified-test-format/sessions/snapshot-sessions.json deleted file mode 100644 index 260f8b6f489..00000000000 --- a/driver-core/src/test/resources/unified-test-format/sessions/snapshot-sessions.json +++ /dev/null @@ -1,993 +0,0 @@ -{ - "description": "snapshot-sessions", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "5.0", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "findAndModify", - "insert", - "update" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "collection0", - "collectionOptions": { - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "session": { - "id": "session0", - "client": "client0", - "sessionOptions": { - "snapshot": true - } - } - }, - { - "session": { - "id": "session1", - "client": "client0", - "sessionOptions": { - "snapshot": true - } - } - } - ], - "initialData": [ - { - "collectionName": "collection0", - "databaseName": "database0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "Find operation with snapshot", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 12 - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session1", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 13 - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 13 - } - ] - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session1", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "Distinct operation with snapshot", - "operations": [ - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 11 - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 2, - "x": 12 - } - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session1" - }, - "expectResult": [ - 11, - 12 - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 2, - "x": 13 - } - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {} - }, - "expectResult": [ - 11, - 13 - ] - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 11 - ] - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session1" - }, - "expectResult": [ - 11, - 12 - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "Aggregate operation with snapshot", - "operations": [ - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "session": "session0" - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 12 - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "session": "session1" - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 13 - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 1, - "x": 13 - } - ] - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "session": "session0" - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "session": "session1" - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "countDocuments operation with snapshot", - "operations": [ - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "filter": {}, - "session": "session0" - }, - "expectResult": 2 - }, - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "filter": {}, - "session": "session0" - }, - "expectResult": 2 - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "Mixed operation with snapshot", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "After" - }, - "expectResult": { - "_id": 1, - "x": 12 - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 12 - } - ] - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": 1 - } - } - ], - "session": "session0" - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "fieldName": "x", - "filter": {}, - "session": "session0" - }, - "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": { - "$$exists": true - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "Write commands with snapshot session do not affect snapshot reads", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {}, - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 22, - "x": 33 - } - } - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": true - } - } - } - } - } - ] - } - ] - }, - { - "description": "First snapshot read does not send atClusterTime", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {}, - "session": "session0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection0", - "readConcern": { - "level": "snapshot", - "atClusterTime": { - "$$exists": false - } - } - }, - "commandName": "find", - "databaseName": "database0" - } - } - ] - } - ] - }, - { - "description": "StartTransaction fails in snapshot session", - "operations": [ - { - "name": "startTransaction", - "object": "session0", - "expectError": { - "isError": true, - "isClientError": true, - "errorContains": "Transactions are not supported in snapshot sessions" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/callback-aborts.json b/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/callback-aborts.json deleted file mode 100644 index 206428715cd..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/callback-aborts.json +++ /dev/null @@ -1,344 +0,0 @@ -{ - "description": "callback-aborts", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "withTransaction succeeds if callback aborts", - "operations": [ - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "name": "abortTransaction", - "object": "session0" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ] - }, - { - "description": "withTransaction succeeds if callback aborts with no ops", - "operations": [ - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "abortTransaction", - "object": "session0" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ] - }, - { - "description": "withTransaction still succeeds if callback aborts and runs extra op", - "operations": [ - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "name": "abortTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "autocommit": { - "$$exists": false - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/callback-commits.json b/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/callback-commits.json deleted file mode 100644 index 06f791e9ae6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/callback-commits.json +++ /dev/null @@ -1,423 +0,0 @@ -{ - "description": "callback-commits", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "withTransaction succeeds if callback commits", - "operations": [ - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "name": "commitTransaction", - "object": "session0" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "withTransaction still succeeds if callback commits and runs extra op", - "operations": [ - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 3 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "autocommit": { - "$$exists": false - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/callback-retry.json b/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/callback-retry.json deleted file mode 100644 index 277dfa18ed6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/callback-retry.json +++ /dev/null @@ -1,472 +0,0 @@ -{ - "description": "callback-retry", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "client": { - "id": "client1", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "callback succeeds after multiple connection errors", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "ignoreResultAndError": true - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "3" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "3" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "callback is not retried after non-transient error (DuplicateKeyError)", - "operations": [ - { - "name": "withTransaction", - "object": "session1", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection1", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "name": "insertOne", - "object": "collection1", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError", - "UnknownTransactionCommitResult" - ] - } - } - ] - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError", - "UnknownTransactionCommitResult" - ], - "errorContains": "E11000" - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-retry-errorLabels.json b/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-retry-errorLabels.json deleted file mode 100644 index c6a4e44d620..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-retry-errorLabels.json +++ /dev/null @@ -1,231 +0,0 @@ -{ - "description": "commit-retry-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "commit is retried after commitTransaction UnknownTransactionCommitResult (NotWritablePrimary)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 10107, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-retry.json b/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-retry.json deleted file mode 100644 index 928f0167e47..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-retry.json +++ /dev/null @@ -1,552 +0,0 @@ -{ - "description": "commit-retry", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "commitTransaction succeeds after multiple connection errors", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "closeConnection": true - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction retry only overwrites write concern w option", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "closeConnection": true - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "writeConcern": { - "w": 2, - "journal": true, - "wtimeoutMS": 5000 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": 2, - "j": true, - "wtimeout": 5000 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "j": true, - "wtimeout": 5000 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "j": true, - "wtimeout": 5000 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commit is not retried after MaxTimeMSExpired error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 50 - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "maxCommitTimeMS": 60000 - }, - "expectError": { - "errorCodeName": "MaxTimeMSExpired", - "errorLabelsContain": [ - "UnknownTransactionCommitResult" - ], - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "maxTimeMS": 60000, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-transienttransactionerror-4.2.json b/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-transienttransactionerror-4.2.json deleted file mode 100644 index 0f5a782452c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-transienttransactionerror-4.2.json +++ /dev/null @@ -1,294 +0,0 @@ -{ - "description": "commit-transienttransactionerror-4.2", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.1.6", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "transaction is retried after commitTransaction TransientTransactionError (PreparedTransactionInProgress)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 267, - "closeConnection": false - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "3" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "3" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-transienttransactionerror.json b/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-transienttransactionerror.json deleted file mode 100644 index dd5158d8134..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-transienttransactionerror.json +++ /dev/null @@ -1,996 +0,0 @@ -{ - "description": "commit-transienttransactionerror", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "transaction is retried after commitTransaction TransientTransactionError (LockTimeout)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 24, - "closeConnection": false - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "3" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "3" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "transaction is retried after commitTransaction TransientTransactionError (WriteConflict)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 112, - "closeConnection": false - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "3" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "3" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "transaction is retried after commitTransaction TransientTransactionError (SnapshotUnavailable)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 246, - "closeConnection": false - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "3" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "3" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "transaction is retried after commitTransaction TransientTransactionError (NoSuchTransaction)", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 251, - "closeConnection": false - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "3" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "3" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-writeconcernerror.json b/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-writeconcernerror.json deleted file mode 100644 index a6f6e6bd7fa..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit-writeconcernerror.json +++ /dev/null @@ -1,814 +0,0 @@ -{ - "description": "commit-writeconcernerror", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "commitTransaction is retried after WriteConcernFailed timeout error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "writeConcernError": { - "code": 64, - "codeName": "WriteConcernFailed", - "errmsg": "waiting for replication timed out", - "errInfo": { - "wtimeout": true - } - } - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction is retried after WriteConcernFailed non-timeout error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "writeConcernError": { - "code": 64, - "codeName": "WriteConcernFailed", - "errmsg": "multiple errors reported" - } - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction is not retried after UnknownReplWriteConcern error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "writeConcernError": { - "code": 79, - "codeName": "UnknownReplWriteConcern", - "errmsg": "No write concern mode named 'foo' found in replica set configuration" - } - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - }, - "expectError": { - "errorCodeName": "UnknownReplWriteConcern", - "errorLabelsOmit": [ - "TransientTransactionError", - "UnknownTransactionCommitResult" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction is not retried after UnsatisfiableWriteConcern error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "writeConcernError": { - "code": 100, - "codeName": "UnsatisfiableWriteConcern", - "errmsg": "Not enough data-bearing nodes" - } - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - }, - "expectError": { - "errorCodeName": "UnsatisfiableWriteConcern", - "errorLabelsOmit": [ - "TransientTransactionError", - "UnknownTransactionCommitResult" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction is not retried after MaxTimeMSExpired error", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "writeConcernError": { - "code": 50, - "codeName": "MaxTimeMSExpired", - "errmsg": "operation exceeded time limit" - } - } - } - } - }, - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - }, - "expectError": { - "errorCodeName": "MaxTimeMSExpired", - "errorLabelsContain": [ - "UnknownTransactionCommitResult" - ], - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit.json b/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit.json deleted file mode 100644 index 5684d5ee891..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/commit.json +++ /dev/null @@ -1,398 +0,0 @@ -{ - "description": "commit", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "withTransaction commits after callback returns", - "operations": [ - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "withTransaction commits after callback returns (second transaction)", - "operations": [ - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/transaction-options.json b/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/transaction-options.json deleted file mode 100644 index b1a74c5fd14..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions-convenient-api/transaction-options.json +++ /dev/null @@ -1,819 +0,0 @@ -{ - "description": "transaction-options", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "withTransaction and no transaction options set", - "operations": [ - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "withTransaction inherits transaction options from client", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": true, - "uriOptions": { - "readConcernLevel": "local", - "w": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ] - } - }, - { - "name": "withTransaction", - "object": "session1", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection1", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "local" - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": 1 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "withTransaction inherits transaction options from defaultTransactionOptions", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "session": { - "id": "session1", - "client": "client0", - "sessionOptions": { - "defaultTransactionOptions": { - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "w": 1 - } - } - } - } - } - ] - } - }, - { - "name": "withTransaction", - "object": "session1", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": 1 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "withTransaction explicit transaction options", - "operations": [ - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "w": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": 1 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "withTransaction explicit transaction options override defaultTransactionOptions", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "session": { - "id": "session1", - "client": "client0", - "sessionOptions": { - "defaultTransactionOptions": { - "readConcern": { - "level": "snapshot" - }, - "writeConcern": { - "w": "majority" - } - } - } - } - } - ] - } - }, - { - "name": "withTransaction", - "object": "session1", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "w": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": 1 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "withTransaction explicit transaction options override client options", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": true, - "uriOptions": { - "readConcernLevel": "local", - "w": "majority" - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "withTransaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ] - } - }, - { - "name": "withTransaction", - "object": "session1", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection1", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "w": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "withTransaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "w": 1 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "withTransaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/abort.json b/driver-core/src/test/resources/unified-test-format/transactions/abort.json deleted file mode 100644 index c151a7d0c6c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/abort.json +++ /dev/null @@ -1,828 +0,0 @@ -{ - "description": "abort", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "abort", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "implicit abort", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "endSession" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "two aborts", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - }, - { - "object": "session0", - "name": "abortTransaction", - "expectError": { - "errorContains": "cannot call abortTransaction twice" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abort without start", - "operations": [ - { - "object": "session0", - "name": "abortTransaction", - "expectError": { - "errorContains": "no transaction started" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abort directly after no-op commit", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "abortTransaction", - "expectError": { - "errorContains": "Cannot call abortTransaction after calling commitTransaction" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abort directly after commit", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "abortTransaction", - "expectError": { - "errorContains": "Cannot call abortTransaction after calling commitTransaction" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "abort ignores TransactionAborted", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError", - "UnknownTransactionCommitResult" - ], - "errorContains": "E11000" - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectError": { - "errorCodeName": "NoSuchTransaction", - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abort does not apply writeConcern", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": 10 - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/bulk.json b/driver-core/src/test/resources/unified-test-format/transactions/bulk.json deleted file mode 100644 index ece162518fc..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/bulk.json +++ /dev/null @@ -1,652 +0,0 @@ -{ - "description": "bulk", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "bulk", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - }, - { - "object": "collection0", - "name": "bulkWrite", - "arguments": { - "session": "session0", - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$set": { - "x": 2 - } - }, - "upsert": true - } - }, - { - "insertOne": { - "document": { - "_id": 3 - } - } - }, - { - "insertOne": { - "document": { - "_id": 4 - } - } - }, - { - "insertOne": { - "document": { - "_id": 5 - } - } - }, - { - "insertOne": { - "document": { - "_id": 6 - } - } - }, - { - "insertOne": { - "document": { - "_id": 7 - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "y": 1 - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 2 - }, - "replacement": { - "y": 2 - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 3 - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 4 - } - } - }, - { - "updateMany": { - "filter": { - "_id": { - "$gte": 2 - } - }, - "update": { - "$set": { - "z": 1 - } - } - } - }, - { - "deleteMany": { - "filter": { - "_id": { - "$gte": 6 - } - } - } - } - ] - }, - "expectResult": { - "deletedCount": 4, - "insertedCount": 6, - "insertedIds": { - "$$unsetOrMatches": { - "0": 1, - "3": 3, - "4": 4, - "5": 5, - "6": 6, - "7": 7 - } - }, - "matchedCount": 7, - "modifiedCount": 7, - "upsertedCount": 1, - "upsertedIds": { - "2": 2 - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": 1 - }, - "limit": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "delete", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": 2 - }, - "u": { - "$set": { - "x": 2 - } - }, - "upsert": true, - "multi": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - }, - { - "_id": 5 - }, - { - "_id": 6 - }, - { - "_id": 7 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "y": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - }, - { - "q": { - "_id": 2 - }, - "u": { - "y": 2 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": 3 - }, - "limit": 1 - }, - { - "q": { - "_id": 4 - }, - "limit": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "delete", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": { - "$gte": 2 - } - }, - "u": { - "$set": { - "z": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": { - "$gte": 6 - } - }, - "limit": 0 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "delete", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1, - "y": 1 - }, - { - "_id": 2, - "y": 2, - "z": 1 - }, - { - "_id": 5, - "z": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/causal-consistency.json b/driver-core/src/test/resources/unified-test-format/transactions/causal-consistency.json deleted file mode 100644 index 52a6cb81802..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/causal-consistency.json +++ /dev/null @@ -1,426 +0,0 @@ -{ - "description": "causal-consistency", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "uriOptions": { - "retryWrites": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "session": { - "id": "session_no_cc", - "client": "client0", - "sessionOptions": { - "causalConsistency": false - } - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1, - "count": 0 - } - ] - } - ], - "tests": [ - { - "description": "causal consistency", - "operations": [ - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "count": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "count": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$inc": { - "count": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$inc": { - "count": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1, - "count": 2 - } - ] - } - ] - }, - { - "description": "causal consistency disabled", - "operations": [ - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session_no_cc", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "object": "session_no_cc", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "session": "session_no_cc", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "count": 1 - } - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "object": "session_no_cc", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session_no_cc" - }, - "txnNumber": { - "$$exists": false - }, - "autocommit": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$inc": { - "count": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session_no_cc" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session_no_cc" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1, - "count": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/client-bulkWrite.json b/driver-core/src/test/resources/unified-test-format/transactions/client-bulkWrite.json deleted file mode 100644 index 4a8d013f8d5..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/client-bulkWrite.json +++ /dev/null @@ -1,593 +0,0 @@ -{ - "description": "client bulkWrite transactions", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "client": { - "id": "client_with_wmajority", - "uriOptions": { - "w": "majority" - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "session": { - "id": "session_with_wmajority", - "client": "client_with_wmajority" - } - } - ], - "_yamlAnchors": { - "namespace": "transaction-tests.coll0" - }, - "initialData": [ - { - "databaseName": "transaction-tests", - "collectionName": "coll0", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - }, - { - "_id": 7, - "x": 77 - } - ] - } - ], - "tests": [ - { - "description": "client bulkWrite in a transaction", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "session": "session0", - "models": [ - { - "insertOne": { - "namespace": "transaction-tests.coll0", - "document": { - "_id": 8, - "x": 88 - } - } - }, - { - "updateOne": { - "namespace": "transaction-tests.coll0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "updateMany": { - "namespace": "transaction-tests.coll0", - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "update": { - "$inc": { - "x": 2 - } - } - } - }, - { - "replaceOne": { - "namespace": "transaction-tests.coll0", - "filter": { - "_id": 4 - }, - "replacement": { - "x": 44 - }, - "upsert": true - } - }, - { - "deleteOne": { - "namespace": "transaction-tests.coll0", - "filter": { - "_id": 5 - } - } - }, - { - "deleteMany": { - "namespace": "transaction-tests.coll0", - "filter": { - "$and": [ - { - "_id": { - "$gt": 5 - } - }, - { - "_id": { - "$lte": 7 - } - } - ] - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 1, - "matchedCount": 3, - "modifiedCount": 3, - "deletedCount": 3, - "insertResults": { - "0": { - "insertedId": 8 - } - }, - "updateResults": { - "1": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedId": { - "$$exists": false - } - }, - "2": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedId": { - "$$exists": false - } - }, - "3": { - "matchedCount": 1, - "modifiedCount": 0, - "upsertedId": 4 - } - }, - "deleteResults": { - "4": { - "deletedCount": 1 - }, - "5": { - "deletedCount": 2 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - }, - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 8, - "x": 88 - } - }, - { - "update": 0, - "filter": { - "_id": 1 - }, - "updateMods": { - "$inc": { - "x": 1 - } - }, - "multi": false - }, - { - "update": 0, - "filter": { - "$and": [ - { - "_id": { - "$gt": 1 - } - }, - { - "_id": { - "$lte": 3 - } - } - ] - }, - "updateMods": { - "$inc": { - "x": 2 - } - }, - "multi": true - }, - { - "update": 0, - "filter": { - "_id": 4 - }, - "updateMods": { - "x": 44 - }, - "upsert": true, - "multi": false - }, - { - "delete": 0, - "filter": { - "_id": 5 - }, - "multi": false - }, - { - "delete": 0, - "filter": { - "$and": [ - { - "_id": { - "$gt": 5 - } - }, - { - "_id": { - "$lte": 7 - } - } - ] - }, - "multi": true - } - ], - "nsInfo": [ - { - "ns": "transaction-tests.coll0" - } - ] - } - } - }, - { - "commandStartedEvent": { - "commandName": "commitTransaction", - "databaseName": "admin", - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 24 - }, - { - "_id": 3, - "x": 35 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 8, - "x": 88 - } - ] - } - ] - }, - { - "description": "client writeConcern ignored for client bulkWrite in transaction", - "operations": [ - { - "object": "session_with_wmajority", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": 1 - } - } - }, - { - "object": "client_with_wmajority", - "name": "clientBulkWrite", - "arguments": { - "session": "session_with_wmajority", - "models": [ - { - "insertOne": { - "namespace": "transaction-tests.coll0", - "document": { - "_id": 8, - "x": 88 - } - } - } - ] - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "$$unsetOrMatches": {} - }, - "updateResults": { - "$$unsetOrMatches": {} - }, - "deleteResults": { - "$$unsetOrMatches": {} - } - } - }, - { - "object": "session_with_wmajority", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client_with_wmajority", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "lsid": { - "$$sessionLsid": "session_with_wmajority" - }, - "txnNumber": 1, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - }, - "bulkWrite": 1, - "errorsOnly": true, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 8, - "x": 88 - } - } - ], - "nsInfo": [ - { - "ns": "transaction-tests.coll0" - } - ] - } - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session_with_wmajority" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": 1 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 5, - "x": 55 - }, - { - "_id": 6, - "x": 66 - }, - { - "_id": 7, - "x": 77 - }, - { - "_id": 8, - "x": 88 - } - ] - } - ] - }, - { - "description": "client bulkWrite with writeConcern in a transaction causes a transaction error", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "client0", - "name": "clientBulkWrite", - "arguments": { - "session": "session0", - "writeConcern": { - "w": 1 - }, - "models": [ - { - "insertOne": { - "namespace": "transaction-tests.coll0", - "document": { - "_id": 8, - "x": 88 - } - } - } - ] - }, - "expectError": { - "isClientError": true, - "errorContains": "Cannot set write concern after starting a transaction" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/commit.json b/driver-core/src/test/resources/unified-test-format/transactions/commit.json deleted file mode 100644 index ab778d8df27..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/commit.json +++ /dev/null @@ -1,1234 +0,0 @@ -{ - "description": "commit", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryWrites": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "commit", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "rerun commit after empty transaction", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "multiple commits in a row", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "write concern error on commit", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": 10 - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError", - "UnknownTransactionCommitResult" - ] - } - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commit without start", - "operations": [ - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorContains": "no transaction started" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "commit after no-op abort", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "session0", - "name": "abortTransaction" - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorContains": "Cannot call commitTransaction after calling abortTransaction" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "commit after abort", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorContains": "Cannot call commitTransaction after calling abortTransaction" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "multiple commits after empty transaction", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "3" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "3" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "reset session state commit", - "operations": [ - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction", - "expectError": { - "errorContains": "no transaction started" - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "reset session state abort", - "operations": [ - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "abortTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "object": "session1", - "name": "abortTransaction", - "expectError": { - "errorContains": "no transaction started" - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/count.json b/driver-core/src/test/resources/unified-test-format/transactions/count.json deleted file mode 100644 index 404b06beb64..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/count.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "description": "count", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0.2", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ], - "tests": [ - { - "description": "count", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "count", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorCodeName": "OperationNotSupportedInTransaction", - "errorLabelsOmit": [ - "TransientTransactionError", - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "test", - "query": { - "_id": 1 - }, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "count", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/create-collection.json b/driver-core/src/test/resources/unified-test-format/transactions/create-collection.json deleted file mode 100644 index e190088b3bd..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/create-collection.json +++ /dev/null @@ -1,282 +0,0 @@ -{ - "description": "create-collection", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.4", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "explicitly create collection using create command", - "operations": [ - { - "object": "database0", - "name": "dropCollection", - "arguments": { - "collection": "test" - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "database0", - "name": "createCollection", - "arguments": { - "session": "session0", - "collection": "test" - } - }, - { - "object": "testRunner", - "name": "assertCollectionNotExists", - "arguments": { - "databaseName": "transaction-tests", - "collectionName": "test" - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "testRunner", - "name": "assertCollectionExists", - "arguments": { - "databaseName": "transaction-tests", - "collectionName": "test" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test", - "writeConcern": { - "$$exists": false - } - }, - "commandName": "drop", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "create": "test", - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "create", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "implicitly create collection using insert", - "operations": [ - { - "object": "database0", - "name": "dropCollection", - "arguments": { - "collection": "test" - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "testRunner", - "name": "assertCollectionNotExists", - "arguments": { - "databaseName": "transaction-tests", - "collectionName": "test" - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "testRunner", - "name": "assertCollectionExists", - "arguments": { - "databaseName": "transaction-tests", - "collectionName": "test" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test", - "writeConcern": { - "$$exists": false - } - }, - "commandName": "drop", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/create-index.json b/driver-core/src/test/resources/unified-test-format/transactions/create-index.json deleted file mode 100644 index 98d6e115475..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/create-index.json +++ /dev/null @@ -1,313 +0,0 @@ -{ - "description": "create-index", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.4", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "create index on a non-existing collection", - "operations": [ - { - "object": "database0", - "name": "dropCollection", - "arguments": { - "collection": "test" - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "createIndex", - "arguments": { - "session": "session0", - "name": "t_1", - "keys": { - "x": 1 - } - } - }, - { - "object": "testRunner", - "name": "assertIndexNotExists", - "arguments": { - "databaseName": "transaction-tests", - "collectionName": "test", - "indexName": "t_1" - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "testRunner", - "name": "assertIndexExists", - "arguments": { - "databaseName": "transaction-tests", - "collectionName": "test", - "indexName": "t_1" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test", - "writeConcern": { - "$$exists": false - } - }, - "commandName": "drop", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "createIndexes": "test", - "indexes": [ - { - "name": "t_1", - "key": { - "x": 1 - } - } - ], - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "createIndexes", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "create index on a collection created within the same transaction", - "operations": [ - { - "object": "database0", - "name": "dropCollection", - "arguments": { - "collection": "test" - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "database0", - "name": "createCollection", - "arguments": { - "session": "session0", - "collection": "test" - } - }, - { - "object": "collection0", - "name": "createIndex", - "arguments": { - "session": "session0", - "name": "t_1", - "keys": { - "x": 1 - } - } - }, - { - "object": "testRunner", - "name": "assertIndexNotExists", - "arguments": { - "databaseName": "transaction-tests", - "collectionName": "test", - "indexName": "t_1" - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "testRunner", - "name": "assertIndexExists", - "arguments": { - "databaseName": "transaction-tests", - "collectionName": "test", - "indexName": "t_1" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test", - "writeConcern": { - "$$exists": false - } - }, - "commandName": "drop", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "create": "test", - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "create", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "createIndexes": "test", - "indexes": [ - { - "name": "t_1", - "key": { - "x": 1 - } - } - ], - "lsid": { - "$$sessionLsid": "session0" - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "createIndexes", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/delete.json b/driver-core/src/test/resources/unified-test-format/transactions/delete.json deleted file mode 100644 index 4c1cae0a4e1..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/delete.json +++ /dev/null @@ -1,425 +0,0 @@ -{ - "description": "delete", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - }, - { - "_id": 5 - } - ] - } - ], - "tests": [ - { - "description": "delete", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - }, - { - "object": "collection0", - "name": "deleteMany", - "arguments": { - "session": "session0", - "filter": { - "_id": { - "$lte": 3 - } - } - }, - "expectResult": { - "deletedCount": 2 - } - }, - { - "object": "collection0", - "name": "deleteOne", - "arguments": { - "session": "session0", - "filter": { - "_id": 4 - } - }, - "expectResult": { - "deletedCount": 1 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": 1 - }, - "limit": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "delete", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": { - "$lte": 3 - } - }, - "limit": 0 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "delete", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": 4 - }, - "limit": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "delete", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 5 - } - ] - } - ] - }, - { - "description": "collection writeConcern ignored for delete", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection_wc_majority", - "database": "database0", - "collectionName": "test", - "collectionOptions": { - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection_wc_majority", - "name": "deleteOne", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - }, - { - "object": "collection_wc_majority", - "name": "deleteMany", - "arguments": { - "session": "session0", - "filter": { - "_id": { - "$lte": 3 - } - } - }, - "expectResult": { - "deletedCount": 2 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": 1 - }, - "limit": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "delete", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": { - "$lte": 3 - } - }, - "limit": 0 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "delete", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/do-not-retry-read-in-transaction.json b/driver-core/src/test/resources/unified-test-format/transactions/do-not-retry-read-in-transaction.json deleted file mode 100644 index 6d9dc704b81..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/do-not-retry-read-in-transaction.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "description": "do not retry read in a transaction", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.0.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.2.0", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "uriOptions": { - "retryReads": true - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-read-in-transaction-test" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "tests": [ - { - "description": "find does not retry in a transaction", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {}, - "session": "session0" - }, - "expectError": { - "isError": true, - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "startTransaction": true - }, - "commandName": "find", - "databaseName": "retryable-read-in-transaction-test" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/error-labels-blockConnection.json b/driver-core/src/test/resources/unified-test-format/transactions/error-labels-blockConnection.json deleted file mode 100644 index 8da04d1005c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/error-labels-blockConnection.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "description": "error-labels-blockConnection", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "uriOptions": { - "socketTimeoutMS": 100 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "add RetryableWriteError and UnknownTransactionCommitResult labels to connection errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "blockConnection": true, - "blockTimeMS": 150 - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ], - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/error-labels-errorLabels.json b/driver-core/src/test/resources/unified-test-format/transactions/error-labels-errorLabels.json deleted file mode 100644 index 1f95ad34193..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/error-labels-errorLabels.json +++ /dev/null @@ -1,423 +0,0 @@ -{ - "description": "error-labels-errorLabels", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "serverless": "forbid", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "add RetryableWriteError and UnknownTransactionCommitResult labels to retryable commit errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 11602, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ], - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "add RetryableWriteError and UnknownTransactionCommitResult labels to writeConcernError ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ], - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/error-labels.json b/driver-core/src/test/resources/unified-test-format/transactions/error-labels.json deleted file mode 100644 index be8df10ed34..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/error-labels.json +++ /dev/null @@ -1,2264 +0,0 @@ -{ - "description": "error-labels", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "serverless": "forbid", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "DuplicateKey errors do not contain transient label", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "session": "session0", - "documents": [ - { - "_id": 1 - }, - { - "_id": 1 - } - ] - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError", - "UnknownTransactionCommitResult" - ], - "errorContains": "E11000" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - }, - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "NotWritablePrimary errors contain transient label", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 10107 - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "WriteConflict errors contain transient label", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 112 - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "NoSuchTransaction errors contain transient label", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 251 - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "NoSuchTransaction errors on commit contain transient label", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 251 - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "add TransientTransactionError label to connection errors, but do not add RetryableWriteError label", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 4 - }, - "data": { - "failCommands": [ - "insert", - "find", - "aggregate", - "distinct" - ], - "closeConnection": true - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": {}, - "session": "session0" - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "session": "session0" - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "find", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "cursor": {}, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "aggregate", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "test", - "key": "_id", - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "distinct", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "add RetryableWriteError and UnknownTransactionCommitResult labels to connection errors", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "closeConnection": true - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ], - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "do not add RetryableWriteError label to writeConcernError ShutdownInProgress that occurs within transaction", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsOmit": [ - "RetryableWriteError", - "TransientTransactionError", - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "writeConcernError": { - "code": 64, - "errmsg": "multiple errors reported" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "UnknownTransactionCommitResult" - ], - "errorLabelsOmit": [ - "RetryableWriteError", - "TransientTransactionError" - ] - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "add UnknownTransactionCommitResult label to writeConcernError WriteConcernFailed with wtimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "writeConcernError": { - "code": 64, - "codeName": "WriteConcernFailed", - "errmsg": "waiting for replication timed out", - "errInfo": { - "wtimeout": true - } - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "UnknownTransactionCommitResult" - ], - "errorLabelsOmit": [ - "RetryableWriteError", - "TransientTransactionError" - ] - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "omit UnknownTransactionCommitResult label from writeConcernError UnsatisfiableWriteConcern", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "writeConcernError": { - "code": 100, - "errmsg": "Not enough data-bearing nodes" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsOmit": [ - "RetryableWriteError", - "TransientTransactionError", - "UnknownTransactionCommitResult" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "omit UnknownTransactionCommitResult label from writeConcernError UnknownReplWriteConcern", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "writeConcernError": { - "code": 79, - "errmsg": "No write concern mode named 'blah' found in replica set configuration" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsOmit": [ - "RetryableWriteConcern", - "TransientTransactionError", - "UnknownTransactionCommitResult" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "do not add UnknownTransactionCommitResult label to MaxTimeMSExpired inside transactions", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 50 - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "maxTimeMS": 60000, - "session": "session0" - }, - "expectError": { - "errorLabelsOmit": [ - "RetryableWriteError", - "UnknownTransactionCommitResult", - "TransientTransactionError" - ] - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "cursor": {}, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "maxTimeMS": 60000 - }, - "commandName": "aggregate", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "add UnknownTransactionCommitResult label to MaxTimeMSExpired", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 50 - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - }, - "maxCommitTimeMS": 60000 - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "UnknownTransactionCommitResult" - ], - "errorLabelsOmit": [ - "RetryableWriteError", - "TransientTransactionError" - ] - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - }, - "maxTimeMS": 60000 - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "maxTimeMS": 60000 - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "add UnknownTransactionCommitResult label to writeConcernError MaxTimeMSExpired", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "writeConcernError": { - "code": 50, - "errmsg": "operation exceeded time limit" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - }, - "maxCommitTimeMS": 60000 - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "UnknownTransactionCommitResult" - ], - "errorLabelsOmit": [ - "RetryableWriteError", - "TransientTransactionError" - ] - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - }, - "maxTimeMS": 60000 - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "maxTimeMS": 60000 - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/errors-client.json b/driver-core/src/test/resources/unified-test-format/transactions/errors-client.json deleted file mode 100644 index 00f1497c2d6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/errors-client.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "description": "errors-client", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Client side error in command starting transaction", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "x": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "object": "testRunner", - "name": "assertSessionTransactionState", - "arguments": { - "session": "session0", - "state": "starting" - } - } - ] - }, - { - "description": "Client side error when transaction is in progress", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "x": 1 - } - }, - "expectError": { - "isError": true - } - }, - { - "object": "testRunner", - "name": "assertSessionTransactionState", - "arguments": { - "session": "session0", - "state": "in_progress" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/errors.json b/driver-core/src/test/resources/unified-test-format/transactions/errors.json deleted file mode 100644 index 94a9cac2072..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/errors.json +++ /dev/null @@ -1,285 +0,0 @@ -{ - "description": "errors", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "session": { - "id": "session1", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "start insert start", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "expectError": { - "isClientError": true, - "errorContains": "transaction already in progress" - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ] - }, - { - "description": "start twice", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "session0", - "name": "startTransaction", - "expectError": { - "isClientError": true, - "errorContains": "transaction already in progress" - } - } - ] - }, - { - "description": "commit and start twice", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "session0", - "name": "startTransaction", - "expectError": { - "isClientError": true, - "errorContains": "transaction already in progress" - } - } - ] - }, - { - "description": "write conflict commit", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectError": { - "errorCodeName": "WriteConflict", - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session1", - "name": "commitTransaction", - "expectError": { - "errorCodeName": "NoSuchTransaction", - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "UnknownTransactionCommitResult" - ] - } - } - ] - }, - { - "description": "write conflict abort", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectError": { - "errorCodeName": "WriteConflict", - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session1", - "name": "abortTransaction" - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/findOneAndDelete.json b/driver-core/src/test/resources/unified-test-format/transactions/findOneAndDelete.json deleted file mode 100644 index 7db9c872afe..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/findOneAndDelete.json +++ /dev/null @@ -1,317 +0,0 @@ -{ - "description": "findOneAndDelete", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ], - "tests": [ - { - "description": "findOneAndDelete", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "session": "session0", - "filter": { - "_id": 3 - } - }, - "expectResult": { - "_id": 3 - } - }, - { - "object": "collection0", - "name": "findOneAndDelete", - "arguments": { - "session": "session0", - "filter": { - "_id": 4 - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 3 - }, - "remove": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 4 - }, - "remove": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "collection writeConcern ignored for findOneAndDelete", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection_wc_majority", - "database": "database0", - "collectionName": "test", - "collectionOptions": { - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection_wc_majority", - "name": "findOneAndDelete", - "arguments": { - "session": "session0", - "filter": { - "_id": 3 - } - }, - "expectResult": { - "_id": 3 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 3 - }, - "remove": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/findOneAndReplace.json b/driver-core/src/test/resources/unified-test-format/transactions/findOneAndReplace.json deleted file mode 100644 index d9248244b3b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/findOneAndReplace.json +++ /dev/null @@ -1,352 +0,0 @@ -{ - "description": "findOneAndReplace", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ], - "tests": [ - { - "description": "findOneAndReplace", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "session": "session0", - "filter": { - "_id": 3 - }, - "replacement": { - "x": 1 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 3 - } - }, - { - "object": "collection0", - "name": "findOneAndReplace", - "arguments": { - "session": "session0", - "filter": { - "_id": 4 - }, - "replacement": { - "x": 1 - }, - "upsert": true, - "returnDocument": "After" - }, - "expectResult": { - "_id": 4, - "x": 1 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 3 - }, - "update": { - "x": 1 - }, - "new": false, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 4 - }, - "update": { - "x": 1 - }, - "new": true, - "upsert": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3, - "x": 1 - }, - { - "_id": 4, - "x": 1 - } - ] - } - ] - }, - { - "description": "collection writeConcern ignored for findOneAndReplace", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection_wc_majority", - "database": "database0", - "collectionName": "test", - "collectionOptions": { - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection_wc_majority", - "name": "findOneAndReplace", - "arguments": { - "session": "session0", - "filter": { - "_id": 3 - }, - "replacement": { - "x": 1 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 3 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 3 - }, - "update": { - "x": 1 - }, - "new": false, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/findOneAndUpdate.json b/driver-core/src/test/resources/unified-test-format/transactions/findOneAndUpdate.json deleted file mode 100644 index 34a40bb5708..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/findOneAndUpdate.json +++ /dev/null @@ -1,538 +0,0 @@ -{ - "description": "findOneAndUpdate", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ], - "tests": [ - { - "description": "findOneAndUpdate", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "session": "session0", - "filter": { - "_id": 3 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 3 - } - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "session": "session0", - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true, - "returnDocument": "After" - }, - "expectResult": { - "_id": 4, - "x": 1 - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "session": "session0", - "filter": { - "_id": 3 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 3, - "x": 1 - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "findOneAndUpdate", - "arguments": { - "session": "session0", - "filter": { - "_id": 3 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 3, - "x": 2 - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 3 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "new": false, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "new": true, - "upsert": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 3 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "new": false, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 3 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "new": false, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "3" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "3" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3, - "x": 2 - }, - { - "_id": 4, - "x": 1 - } - ] - } - ] - }, - { - "description": "collection writeConcern ignored for findOneAndUpdate", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection_wc_majority", - "database": "database0", - "collectionName": "test", - "collectionOptions": { - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection_wc_majority", - "name": "findOneAndUpdate", - "arguments": { - "session": "session0", - "filter": { - "_id": 3 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 3 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 3 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "new": false, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/insert.json b/driver-core/src/test/resources/unified-test-format/transactions/insert.json deleted file mode 100644 index 9a80d8bf4bb..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/insert.json +++ /dev/null @@ -1,895 +0,0 @@ -{ - "description": "insert", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "session": { - "id": "session1", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2 - }, - { - "_id": 3 - } - ], - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 4 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 4 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 5 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 5 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - }, - { - "_id": 3 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 4 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 5 - } - ], - "ordered": true, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - }, - { - "_id": 5 - } - ] - } - ] - }, - { - "description": "insert with session1", - "operations": [ - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2 - }, - { - "_id": 3 - } - ], - "session": "session1" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction" - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 4 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 4 - } - } - } - }, - { - "object": "session1", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - }, - { - "_id": 3 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 4 - } - ], - "ordered": true, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ] - }, - { - "description": "collection writeConcern without transaction", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryWrites": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection_wc_majority", - "database": "database1", - "collectionName": "test", - "collectionOptions": { - "writeConcern": { - "w": "majority" - } - } - } - }, - { - "session": { - "id": "session2", - "client": "client1" - } - } - ] - } - }, - { - "object": "collection_wc_majority", - "name": "insertOne", - "arguments": { - "session": "session2", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session2" - }, - "txnNumber": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": { - "$$exists": false - }, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "collection writeConcern ignored for insert", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection_wc_majority", - "database": "database0", - "collectionName": "test", - "collectionOptions": { - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection_wc_majority", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "collection_wc_majority", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 2 - }, - { - "_id": 3 - } - ], - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 2, - "1": 3 - } - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - }, - { - "_id": 3 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/isolation.json b/driver-core/src/test/resources/unified-test-format/transactions/isolation.json deleted file mode 100644 index 5d0a0139fb7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/isolation.json +++ /dev/null @@ -1,281 +0,0 @@ -{ - "description": "isolation", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "session": { - "id": "session1", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "one transaction", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1 - } - ] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "session": "session1", - "filter": { - "_id": 1 - } - }, - "expectResult": [] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": [] - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "session": "session1", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1 - } - ] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1 - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "two transactions", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1 - } - ] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "session": "session1", - "filter": { - "_id": 1 - } - }, - "expectResult": [] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": [] - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "session": "session1", - "filter": { - "_id": 1 - } - }, - "expectResult": [] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 1 - } - }, - "expectResult": [ - { - "_id": 1 - } - ] - }, - { - "object": "session1", - "name": "commitTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/mongos-pin-auto.json b/driver-core/src/test/resources/unified-test-format/transactions/mongos-pin-auto.json deleted file mode 100644 index 27db5204011..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/mongos-pin-auto.json +++ /dev/null @@ -1,5474 +0,0 @@ -{ - "description": "mongos-pin-auto", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded" - ], - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "remain pinned after non-transient Interrupted error on insertOne", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "object": "testRunner", - "name": "targetedFailPoint", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11601 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 4 - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError", - "UnknownTransactionCommitResult" - ], - "errorCodeName": "Interrupted" - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 3 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 4 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ] - }, - { - "description": "unpin after transient error within a transaction", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "object": "testRunner", - "name": "targetedFailPoint", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 4 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 3 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 4 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on insertOne insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 4 - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on insertMany insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "session": "session0", - "documents": [ - { - "_id": 4 - }, - { - "_id": 5 - } - ] - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on updateOne update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on replaceOne update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "replacement": { - "y": 1 - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on updateMany update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": { - "$gte": 1 - } - }, - "update": { - "$set": { - "z": 1 - } - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on deleteOne delete", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on deleteMany delete", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "deleteMany", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": { - "$gte": 1 - } - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on findOneAndDelete findAndModify", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on findOneAndUpdate findAndModify", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on findOneAndReplace findAndModify", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "replacement": { - "y": 1 - }, - "returnDocument": "Before" - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on bulkWrite insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "session": "session0", - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on bulkWrite update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "session": "session0", - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - } - ] - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on bulkWrite delete", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "session": "session0", - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on find find", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on countDocuments aggregate", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": {} - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on aggregate aggregate", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "session": "session0", - "pipeline": [] - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on distinct distinct", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "session": "session0", - "fieldName": "_id", - "filter": {} - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on runCommand insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "runCommand", - "object": "database0", - "arguments": { - "session": "session0", - "commandName": "insert", - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ] - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient Interrupted error on clientBulkWrite bulkWrite", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "clientBulkWrite", - "object": "client0", - "arguments": { - "session": "session0", - "models": [ - { - "insertOne": { - "namespace": "database0.collection0", - "document": { - "_id": 8, - "x": 88 - } - } - } - ] - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "runOnRequirements": [ - { - "minServerVersion": "8.0" - } - ] - }, - { - "description": "unpin after transient connection error on insertOne insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 4 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on insertOne insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 4 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on insertMany insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "session": "session0", - "documents": [ - { - "_id": 4 - }, - { - "_id": 5 - } - ] - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on insertMany insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "session": "session0", - "documents": [ - { - "_id": 4 - }, - { - "_id": 5 - } - ] - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on updateOne update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "closeConnection": true - } - } - } - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on updateOne update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on replaceOne update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "closeConnection": true - } - } - } - }, - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "replacement": { - "y": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on replaceOne update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "replacement": { - "y": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on updateMany update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "closeConnection": true - } - } - } - }, - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": { - "$gte": 1 - } - }, - "update": { - "$set": { - "z": 1 - } - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on updateMany update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": { - "$gte": 1 - } - }, - "update": { - "$set": { - "z": 1 - } - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on deleteOne delete", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "closeConnection": true - } - } - } - }, - { - "name": "deleteOne", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on deleteOne delete", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "deleteOne", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on deleteMany delete", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "closeConnection": true - } - } - } - }, - { - "name": "deleteMany", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": { - "$gte": 1 - } - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on deleteMany delete", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "deleteMany", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": { - "$gte": 1 - } - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on findOneAndDelete findAndModify", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "closeConnection": true - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on findOneAndDelete findAndModify", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on findOneAndUpdate findAndModify", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "closeConnection": true - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on findOneAndUpdate findAndModify", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on findOneAndReplace findAndModify", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "closeConnection": true - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "replacement": { - "y": 1 - }, - "returnDocument": "Before" - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on findOneAndReplace findAndModify", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "findAndModify" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "replacement": { - "y": 1 - }, - "returnDocument": "Before" - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on bulkWrite insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "session": "session0", - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on bulkWrite insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "session": "session0", - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on bulkWrite update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "closeConnection": true - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "session": "session0", - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - } - ] - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on bulkWrite update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "update" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "session": "session0", - "requests": [ - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - } - ] - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on bulkWrite delete", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "closeConnection": true - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "session": "session0", - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on bulkWrite delete", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "delete" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "session": "session0", - "requests": [ - { - "deleteOne": { - "filter": { - "_id": 1 - } - } - } - ] - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on find find", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on find find", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on countDocuments aggregate", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": {} - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on countDocuments aggregate", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "countDocuments", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": {} - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on aggregate aggregate", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "closeConnection": true - } - } - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "session": "session0", - "pipeline": [] - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on aggregate aggregate", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "session": "session0", - "pipeline": [] - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on distinct distinct", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "closeConnection": true - } - } - } - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "session": "session0", - "fieldName": "_id", - "filter": {} - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on distinct distinct", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "distinct" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "distinct", - "object": "collection0", - "arguments": { - "session": "session0", - "fieldName": "_id", - "filter": {} - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on runCommand insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database0", - "arguments": { - "session": "session0", - "commandName": "insert", - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ] - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on runCommand insert", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "runCommand", - "object": "database0", - "arguments": { - "session": "session0", - "commandName": "insert", - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ] - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient connection error on clientBulkWrite bulkWrite", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "closeConnection": true - } - } - } - }, - { - "name": "clientBulkWrite", - "object": "client0", - "arguments": { - "session": "session0", - "models": [ - { - "insertOne": { - "namespace": "database0.collection0", - "document": { - "_id": 8, - "x": 88 - } - } - } - ] - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "runOnRequirements": [ - { - "minServerVersion": "8.0" - } - ] - }, - { - "description": "unpin after transient ShutdownInProgress error on clientBulkWrite bulkWrite", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "bulkWrite" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "clientBulkWrite", - "object": "client0", - "arguments": { - "session": "session0", - "models": [ - { - "insertOne": { - "namespace": "database0.collection0", - "document": { - "_id": 8, - "x": 88 - } - } - } - ] - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "testRunner", - "name": "assertSessionUnpinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "runOnRequirements": [ - { - "minServerVersion": "8.0" - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/mongos-recovery-token-errorLabels.json b/driver-core/src/test/resources/unified-test-format/transactions/mongos-recovery-token-errorLabels.json deleted file mode 100644 index 13345c6a295..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/mongos-recovery-token-errorLabels.json +++ /dev/null @@ -1,211 +0,0 @@ -{ - "description": "mongos-recovery-token-errorLabels", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "serverless": "forbid", - "topologies": [ - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "commitTransaction retry succeeds on new mongos", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "testRunner", - "name": "targetedFailPoint", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/mongos-recovery-token.json b/driver-core/src/test/resources/unified-test-format/transactions/mongos-recovery-token.json deleted file mode 100644 index 00909c42183..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/mongos-recovery-token.json +++ /dev/null @@ -1,566 +0,0 @@ -{ - "description": "mongos-recovery-token", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.1.8", - "serverless": "forbid", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "commitTransaction explicit retries include recoveryToken", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction retry fails on new mongos", - "runOnRequirements": [ - { - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": true, - "uriOptions": { - "heartbeatFrequencyMS": 30000 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "testRunner", - "name": "targetedFailPoint", - "arguments": { - "session": "session1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 7 - }, - "data": { - "failCommands": [ - "commitTransaction", - "isMaster", - "hello" - ], - "closeConnection": true - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "UnknownTransactionCommitResult" - ], - "errorCodeName": "NoSuchTransaction" - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction sends recoveryToken", - "runOnRequirements": [ - { - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "testRunner", - "name": "targetedFailPoint", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "closeConnection": true - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/mongos-unpin.json b/driver-core/src/test/resources/unified-test-format/transactions/mongos-unpin.json deleted file mode 100644 index 4d1ebc87bc7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/mongos-unpin.json +++ /dev/null @@ -1,450 +0,0 @@ -{ - "description": "mongos-unpin", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "topologies": [ - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "mongos-unpin-db" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "mongos-unpin-db", - "documents": [] - } - ], - "_yamlAnchors": { - "anchors": 24 - }, - "tests": [ - { - "description": "unpin after TransientTransactionError error on commit", - "runOnRequirements": [ - { - "serverless": "forbid", - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 24 - } - } - } - }, - { - "name": "commitTransaction", - "object": "session0", - "expectError": { - "errorCode": 24, - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "UnknownTransactionCommitResult" - ] - } - }, - { - "name": "assertSessionUnpinned", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "abortTransaction", - "object": "session0" - } - ] - }, - { - "description": "unpin on successful abort", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "abortTransaction", - "object": "session0" - }, - { - "name": "assertSessionUnpinned", - "object": "testRunner", - "arguments": { - "session": "session0" - } - } - ] - }, - { - "description": "unpin after non-transient error on abort", - "runOnRequirements": [ - { - "serverless": "forbid", - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 24 - } - } - } - }, - { - "name": "abortTransaction", - "object": "session0" - }, - { - "name": "assertSessionUnpinned", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "abortTransaction", - "object": "session0" - } - ] - }, - { - "description": "unpin after TransientTransactionError error on abort", - "runOnRequirements": [ - { - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 91 - } - } - } - }, - { - "name": "abortTransaction", - "object": "session0" - }, - { - "name": "assertSessionUnpinned", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "abortTransaction", - "object": "session0" - } - ] - }, - { - "description": "unpin when a new transaction is started", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "assertSessionPinned", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "assertSessionUnpinned", - "object": "testRunner", - "arguments": { - "session": "session0" - } - } - ] - }, - { - "description": "unpin when a non-transaction write operation uses a session", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "assertSessionPinned", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "assertSessionUnpinned", - "object": "testRunner", - "arguments": { - "session": "session0" - } - } - ] - }, - { - "description": "unpin when a non-transaction read operation uses a session", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "assertSessionPinned", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "x": 1 - }, - "session": "session0" - } - }, - { - "name": "assertSessionUnpinned", - "object": "testRunner", - "arguments": { - "session": "session0" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/pin-mongos.json b/driver-core/src/test/resources/unified-test-format/transactions/pin-mongos.json deleted file mode 100644 index 5f2ecca5c15..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/pin-mongos.json +++ /dev/null @@ -1,1464 +0,0 @@ -{ - "description": "pin-mongos", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.1.8", - "serverless": "forbid", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "countDocuments", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "distinct", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2 - ] - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2 - ] - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2 - ] - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2 - ] - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2 - ] - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2 - ] - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2 - ] - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2 - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "find", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": [ - { - "_id": 2 - } - ] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": [ - { - "_id": 2 - } - ] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": [ - { - "_id": 2 - } - ] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": [ - { - "_id": 2 - } - ] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": [ - { - "_id": 2 - } - ] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": [ - { - "_id": 2 - } - ] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": [ - { - "_id": 2 - } - ] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "filter": { - "_id": 2 - }, - "session": "session0" - }, - "expectResult": [ - { - "_id": 2 - } - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "insertOne", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 4 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 4 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 5 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 5 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 6 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 6 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 7 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 7 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 8 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 8 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 9 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 9 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 10 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 10 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - }, - { - "_id": 5 - }, - { - "_id": 6 - }, - { - "_id": 7 - }, - { - "_id": 8 - }, - { - "_id": 9 - }, - { - "_id": 10 - } - ] - } - ] - }, - { - "description": "mixed read write operations", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 3 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 3 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 3 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 3 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 3 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "collection0", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": 3 - }, - "session": "session0" - }, - "expectResult": 1 - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 4 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 4 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 5 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 5 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 6 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 6 - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "document": { - "_id": 7 - }, - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 7 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - }, - { - "_id": 5 - }, - { - "_id": 6 - }, - { - "_id": 7 - } - ] - } - ] - }, - { - "description": "multiple commits", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ], - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 3, - "1": 4 - } - } - } - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "remain pinned after non-transient error on commit", - "runOnRequirements": [ - { - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 3 - }, - { - "_id": 4 - } - ], - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 3, - "1": 4 - } - } - } - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "testRunner", - "name": "targetedFailPoint", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 51 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError" - ], - "errorCode": 51 - } - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "testRunner", - "name": "assertSessionPinned", - "arguments": { - "session": "session0" - } - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "unpin after transient error within a transaction", - "runOnRequirements": [ - { - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "object": "testRunner", - "name": "targetedFailPoint", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 4 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 3 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 4 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unpin after transient error within a transaction and commit", - "runOnRequirements": [ - { - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": true, - "uriOptions": { - "heartbeatFrequencyMS": 30000 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "object": "testRunner", - "name": "targetedFailPoint", - "arguments": { - "session": "session1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 7 - }, - "data": { - "failCommands": [ - "insert", - "isMaster", - "hello" - ], - "closeConnection": true - } - } - } - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 4 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "UnknownTransactionCommitResult" - ] - } - }, - { - "object": "session1", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "UnknownTransactionCommitResult" - ], - "errorCodeName": "NoSuchTransaction" - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 3 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 4 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - }, - "recoveryToken": { - "$$exists": true - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/read-concern.json b/driver-core/src/test/resources/unified-test-format/transactions/read-concern.json deleted file mode 100644 index b3bd967c094..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/read-concern.json +++ /dev/null @@ -1,1924 +0,0 @@ -{ - "description": "read-concern", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "database": { - "id": "database_rc_majority", - "client": "client0", - "databaseName": "transaction-tests", - "databaseOptions": { - "readConcern": { - "level": "majority" - } - } - } - }, - { - "collection": { - "id": "collection_rc_majority", - "database": "database0", - "collectionName": "test", - "collectionOptions": { - "readConcern": { - "level": "majority" - } - } - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ], - "tests": [ - { - "description": "only first countDocuments includes readConcern", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "readConcern": { - "level": "majority" - } - } - }, - { - "object": "collection_rc_majority", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": { - "$gte": 2 - } - }, - "session": "session0" - }, - "expectResult": 3 - }, - { - "object": "collection_rc_majority", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": { - "$gte": 2 - } - }, - "session": "session0" - }, - "expectResult": 3 - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$match": { - "_id": { - "$gte": 2 - } - } - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ], - "cursor": {}, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "level": "majority" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false - }, - "commandName": "aggregate", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$match": { - "_id": { - "$gte": 2 - } - } - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ], - "cursor": {}, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "aggregate", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "only first find includes readConcern", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "readConcern": { - "level": "majority" - } - } - }, - { - "object": "collection_rc_majority", - "name": "find", - "arguments": { - "batchSize": 3, - "filter": {}, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "collection_rc_majority", - "name": "find", - "arguments": { - "batchSize": 3, - "filter": {}, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "level": "majority" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false - }, - "commandName": "find", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "getMore", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "find", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "getMore", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "only first aggregate includes readConcern", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "readConcern": { - "level": "majority" - } - } - }, - { - "object": "collection_rc_majority", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "batchSize": 3, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "collection_rc_majority", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "batchSize": 3, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "cursor": { - "batchSize": 3 - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "level": "majority" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false - }, - "commandName": "aggregate", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "getMore", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "cursor": { - "batchSize": 3 - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "aggregate", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "getMore", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "only first distinct includes readConcern", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "readConcern": { - "level": "majority" - } - } - }, - { - "object": "collection_rc_majority", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2, - 3, - 4 - ] - }, - { - "object": "collection_rc_majority", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2, - 3, - 4 - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "test", - "key": "_id", - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "level": "majority" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "distinct", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "test", - "key": "_id", - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "distinct", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "only first runCommand includes readConcern", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "readConcern": { - "level": "majority" - } - } - }, - { - "object": "database0", - "name": "runCommand", - "arguments": { - "session": "session0", - "command": { - "find": "test" - }, - "commandName": "find" - } - }, - { - "object": "database0", - "name": "runCommand", - "arguments": { - "session": "session0", - "command": { - "find": "test" - }, - "commandName": "find" - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "level": "majority" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "find", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "find", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "countDocuments ignores collection readConcern", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_rc_majority", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": { - "$gte": 2 - } - }, - "session": "session0" - }, - "expectResult": 3 - }, - { - "object": "collection_rc_majority", - "name": "countDocuments", - "arguments": { - "filter": { - "_id": { - "$gte": 2 - } - }, - "session": "session0" - }, - "expectResult": 3 - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$match": { - "_id": { - "$gte": 2 - } - } - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ], - "cursor": {}, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false - }, - "commandName": "aggregate", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$match": { - "_id": { - "$gte": 2 - } - } - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ], - "cursor": {}, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "aggregate", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "find ignores collection readConcern", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_rc_majority", - "name": "find", - "arguments": { - "batchSize": 3, - "filter": {}, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "collection_rc_majority", - "name": "find", - "arguments": { - "batchSize": 3, - "filter": {}, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false - }, - "commandName": "find", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "getMore", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "find", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "getMore", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "aggregate ignores collection readConcern", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_rc_majority", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "batchSize": 3, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "collection_rc_majority", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "batchSize": 3, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "cursor": { - "batchSize": 3 - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false - }, - "commandName": "aggregate", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "getMore", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "cursor": { - "batchSize": 3 - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "aggregate", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "getMore", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "distinct ignores collection readConcern", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_rc_majority", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2, - 3, - 4 - ] - }, - { - "object": "collection_rc_majority", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2, - 3, - 4 - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "test", - "key": "_id", - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "distinct", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "distinct": "test", - "key": "_id", - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "distinct", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "runCommand ignores database readConcern", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "database_rc_majority", - "name": "runCommand", - "arguments": { - "session": "session0", - "command": { - "find": "test" - }, - "commandName": "find" - } - }, - { - "object": "database0", - "name": "runCommand", - "arguments": { - "session": "session0", - "command": { - "find": "test" - }, - "commandName": "find" - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "find", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "find", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/read-pref.json b/driver-core/src/test/resources/unified-test-format/transactions/read-pref.json deleted file mode 100644 index eda00bd10d2..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/read-pref.json +++ /dev/null @@ -1,728 +0,0 @@ -{ - "description": "read-pref", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "collection": { - "id": "collection_rp_primary", - "database": "database0", - "collectionName": "test" - } - }, - { - "collection": { - "id": "collection_rp_secondary", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "default readPreference", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ], - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 1, - "1": 2, - "2": 3, - "3": 4 - } - } - } - } - }, - { - "object": "collection_rp_secondary", - "name": "aggregate", - "arguments": { - "session": "session0", - "pipeline": [ - { - "$match": { - "_id": 1 - } - }, - { - "$count": "count" - } - ] - }, - "expectResult": [ - { - "count": 1 - } - ] - }, - { - "object": "collection_rp_secondary", - "name": "find", - "arguments": { - "batchSize": 3, - "filter": {}, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "collection_rp_secondary", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "batchSize": 3, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "primary readPreference", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "readPreference": { - "mode": "primary" - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ], - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 1, - "1": 2, - "2": 3, - "3": 4 - } - } - } - } - }, - { - "object": "collection_rp_secondary", - "name": "aggregate", - "arguments": { - "session": "session0", - "pipeline": [ - { - "$match": { - "_id": 1 - } - }, - { - "$count": "count" - } - ] - }, - "expectResult": [ - { - "count": 1 - } - ] - }, - { - "object": "collection_rp_secondary", - "name": "find", - "arguments": { - "batchSize": 3, - "filter": {}, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "collection_rp_secondary", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "batchSize": 3, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "secondary readPreference", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "readPreference": { - "mode": "secondary" - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ], - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 1, - "1": 2, - "2": 3, - "3": 4 - } - } - } - } - }, - { - "object": "collection_rp_primary", - "name": "aggregate", - "arguments": { - "session": "session0", - "pipeline": [ - { - "$match": { - "_id": 1 - } - }, - { - "$count": "count" - } - ] - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - }, - { - "object": "collection_rp_primary", - "name": "find", - "arguments": { - "batchSize": 3, - "filter": {}, - "session": "session0" - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - }, - { - "object": "collection_rp_primary", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "batchSize": 3, - "session": "session0" - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "primaryPreferred readPreference", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "readPreference": { - "mode": "primaryPreferred" - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ], - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 1, - "1": 2, - "2": 3, - "3": 4 - } - } - } - } - }, - { - "object": "collection_rp_primary", - "name": "aggregate", - "arguments": { - "session": "session0", - "pipeline": [ - { - "$match": { - "_id": 1 - } - }, - { - "$count": "count" - } - ] - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - }, - { - "object": "collection_rp_primary", - "name": "find", - "arguments": { - "batchSize": 3, - "filter": {}, - "session": "session0" - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - }, - { - "object": "collection_rp_primary", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "batchSize": 3, - "session": "session0" - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "nearest readPreference", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "readPreference": { - "mode": "nearest" - } - } - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ], - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 1, - "1": 2, - "2": 3, - "3": 4 - } - } - } - } - }, - { - "object": "collection_rp_primary", - "name": "aggregate", - "arguments": { - "session": "session0", - "pipeline": [ - { - "$match": { - "_id": 1 - } - }, - { - "$count": "count" - } - ] - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - }, - { - "object": "collection_rp_primary", - "name": "find", - "arguments": { - "batchSize": 3, - "filter": {}, - "session": "session0" - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - }, - { - "object": "collection_rp_primary", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "batchSize": 3, - "session": "session0" - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "secondary write only", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "readPreference": { - "mode": "secondary" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/reads.json b/driver-core/src/test/resources/unified-test-format/transactions/reads.json deleted file mode 100644 index 52e84576341..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/reads.json +++ /dev/null @@ -1,706 +0,0 @@ -{ - "description": "reads", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ], - "tests": [ - { - "description": "collection readConcern without transaction", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection1", - "database": "database0", - "collectionName": "test", - "collectionOptions": { - "readConcern": { - "level": "majority" - } - } - } - } - ] - } - }, - { - "object": "collection1", - "name": "find", - "arguments": { - "filter": {}, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "readConcern": { - "level": "majority" - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": { - "$$exists": false - } - }, - "commandName": "find", - "databaseName": "transaction-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "find", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "batchSize": 3, - "filter": {}, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "collection0", - "name": "find", - "arguments": { - "batchSize": 3, - "filter": {}, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "batchSize": 3, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false - }, - "commandName": "find", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "getMore", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "find", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "getMore", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "aggregate", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "batchSize": 3, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "batchSize": 3, - "session": "session0" - }, - "expectResult": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "cursor": { - "batchSize": 3 - }, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false - }, - "commandName": "aggregate", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "getMore", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$project": { - "_id": 1 - } - } - ], - "cursor": { - "batchSize": 3 - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "aggregate", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false - }, - "commandName": "getMore", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - }, - { - "description": "distinct", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "distinct", - "arguments": { - "fieldName": "_id", - "filter": {}, - "session": "session0" - }, - "expectResult": [ - 1, - 2, - 3, - 4 - ] - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "test", - "key": "_id", - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "distinct", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "readConcern": { - "$$exists": false - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/retryable-abort-errorLabels.json b/driver-core/src/test/resources/unified-test-format/transactions/retryable-abort-errorLabels.json deleted file mode 100644 index 77a1b03eb0d..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/retryable-abort-errorLabels.json +++ /dev/null @@ -1,2436 +0,0 @@ -{ - "description": "retryable-abort-errorLabels", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "abortTransaction only retries once with RetryableWriteError from server", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction does not retry without RetryableWriteError label", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 10107, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 13436, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 13435, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 11602, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 11600, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 91, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 6, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 9001, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 89, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after WriteConcernError InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 11600, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after WriteConcernError InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 11602, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after WriteConcernError PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 189, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/retryable-abort-handshake.json b/driver-core/src/test/resources/unified-test-format/transactions/retryable-abort-handshake.json deleted file mode 100644 index 4ad56e2f2fb..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/retryable-abort-handshake.json +++ /dev/null @@ -1,204 +0,0 @@ -{ - "description": "retryable abortTransaction on handshake errors", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ], - "serverless": "forbid", - "auth": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "connectionCheckOutStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-handshake-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "session": { - "id": "session1", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-handshake-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "AbortTransaction succeeds after handshake network error", - "skipReason": "DRIVERS-2032: Pinned servers need to be checked if they are still selectable", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "session": "session1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "saslContinue", - "ping" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - }, - "session": "session1" - }, - "expectError": { - "isError": true - } - }, - { - "name": "abortTransaction", - "object": "session0" - } - ], - "expectEvents": [ - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "startTransaction": true - }, - "commandName": "insert", - "databaseName": "retryable-handshake-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-handshake-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-handshake-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/retryable-abort.json b/driver-core/src/test/resources/unified-test-format/transactions/retryable-abort.json deleted file mode 100644 index 381cfa91f81..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/retryable-abort.json +++ /dev/null @@ -1,600 +0,0 @@ -{ - "description": "retryable-abort", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryWrites": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "abortTransaction only performs a single retry", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "closeConnection": true - } - } - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction does not retry after Interrupted", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "errorCode": 11601, - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction does not retry after WriteConcernError Interrupted", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "writeConcernError": { - "code": 11601, - "errmsg": "operation was interrupted" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "abortTransaction succeeds after connection error", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "abortTransaction" - ], - "closeConnection": true - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/retryable-commit-errorLabels.json b/driver-core/src/test/resources/unified-test-format/transactions/retryable-commit-errorLabels.json deleted file mode 100644 index d3ce8b148ef..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/retryable-commit-errorLabels.json +++ /dev/null @@ -1,2564 +0,0 @@ -{ - "description": "retryable-commit-errorLabels", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryWrites": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "commitTransaction does not retry error without RetryableWriteError label", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 11600, - "errorLabels": [] - } - } - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction", - "expectError": { - "errorLabelsOmit": [ - "RetryableWriteError", - "TransientTransactionError" - ] - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "commitTransaction retries once with RetryableWriteError from server", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 112, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after NotWritablePrimary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 10107, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after NotPrimaryOrSecondary", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 13436, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after NotPrimaryNoSecondaryOk", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 13435, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 11602, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after HostNotFound", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 7, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after HostUnreachable", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 6, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after SocketException", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 9001, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after NetworkTimeout", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 89, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after WriteConcernError InterruptedAtShutdown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 11600, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after WriteConcernError InterruptedDueToReplStateChange", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 11602, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after WriteConcernError PrimarySteppedDown", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 189, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after WriteConcernError ShutdownInProgress", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after InterruptedAtShutdown", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 11600, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after ShutdownInProgress", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 91, - "errorLabels": [ - "RetryableWriteError" - ], - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/retryable-commit-handshake.json b/driver-core/src/test/resources/unified-test-format/transactions/retryable-commit-handshake.json deleted file mode 100644 index d9315a8fc68..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/retryable-commit-handshake.json +++ /dev/null @@ -1,211 +0,0 @@ -{ - "description": "retryable commitTransaction on handshake errors", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.2", - "topologies": [ - "replicaset", - "sharded", - "load-balanced" - ], - "serverless": "forbid", - "auth": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent", - "connectionCheckOutStartedEvent" - ], - "uriOptions": { - "retryWrites": false - } - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-handshake-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "session": { - "id": "session1", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-handshake-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "CommitTransaction succeeds after handshake network error", - "skipReason": "DRIVERS-2032: Pinned servers need to be checked if they are still selectable", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 2, - "x": 22 - } - } - }, - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "session": "session1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "saslContinue", - "ping" - ], - "closeConnection": true - } - } - } - }, - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1 - }, - "session": "session1" - }, - "expectError": { - "isError": true - } - }, - { - "name": "commitTransaction", - "object": "session0" - } - ], - "expectEvents": [ - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - }, - { - "connectionCheckOutStartedEvent": {} - } - ] - }, - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 2, - "x": 22 - } - ], - "startTransaction": true - }, - "commandName": "insert", - "databaseName": "retryable-handshake-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "ping": 1 - }, - "databaseName": "retryable-handshake-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-handshake-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/retryable-commit.json b/driver-core/src/test/resources/unified-test-format/transactions/retryable-commit.json deleted file mode 100644 index b794c1c55c9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/retryable-commit.json +++ /dev/null @@ -1,868 +0,0 @@ -{ - "description": "retryable-commit", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "retryWrites": false - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "commitTransaction fails after Interrupted", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "errorCode": 11601, - "closeConnection": false - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorCodeName": "Interrupted", - "errorLabelsOmit": [ - "RetryableWriteError", - "TransientTransactionError", - "UnknownTransactionCommitResult" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "commitTransaction is not retried after UnsatisfiableWriteConcern error", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "writeConcernError": { - "code": 100, - "errmsg": "Not enough data-bearing nodes" - } - } - } - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction", - "expectError": { - "errorLabelsOmit": [ - "RetryableWriteError", - "TransientTransactionError", - "UnknownTransactionCommitResult" - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction fails after two errors", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "closeConnection": true - } - } - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ], - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "session1", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction applies majority write concern on retries", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "closeConnection": true - } - } - } - }, - { - "object": "session1", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": 2, - "journal": true, - "wtimeoutMS": 5000 - } - } - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction", - "expectError": { - "errorLabelsContain": [ - "RetryableWriteError", - "UnknownTransactionCommitResult" - ], - "errorLabelsOmit": [ - "TransientTransactionError" - ] - } - }, - { - "object": "session1", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": 2, - "j": true, - "wtimeout": 5000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "j": true, - "wtimeout": 5000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "j": true, - "wtimeout": 5000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commitTransaction succeeds after connection error", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "commitTransaction" - ], - "closeConnection": true - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority", - "wtimeout": 10000 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/retryable-writes.json b/driver-core/src/test/resources/unified-test-format/transactions/retryable-writes.json deleted file mode 100644 index c196e686227..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/retryable-writes.json +++ /dev/null @@ -1,468 +0,0 @@ -{ - "description": "retryable-writes", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "increment txnNumber", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - }, - { - "object": "collection0", - "name": "insertMany", - "arguments": { - "documents": [ - { - "_id": 4 - }, - { - "_id": 5 - } - ], - "session": "session0" - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 4, - "1": 5 - } - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 3 - } - ], - "ordered": true, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "3" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "3" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 4 - }, - { - "_id": 5 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "4" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 4 - }, - { - "_id": 5 - } - ] - } - ] - }, - { - "description": "writes are not retried", - "operations": [ - { - "object": "testRunner", - "name": "failPoint", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ] - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/run-command.json b/driver-core/src/test/resources/unified-test-format/transactions/run-command.json deleted file mode 100644 index 7bd420ef744..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/run-command.json +++ /dev/null @@ -1,421 +0,0 @@ -{ - "description": "run-command", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "run command with default read preference", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "database0", - "name": "runCommand", - "arguments": { - "session": "session0", - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ] - }, - "commandName": "insert" - }, - "expectResult": { - "n": 1 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "run command with secondary read preference in client option and primary read preference in transaction options", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "readPreference": "secondary" - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction", - "arguments": { - "readPreference": { - "mode": "primary" - } - } - }, - { - "object": "database1", - "name": "runCommand", - "arguments": { - "session": "session1", - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ] - }, - "commandName": "insert" - }, - "expectResult": { - "n": 1 - } - }, - { - "object": "session1", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "run command with explicit primary read preference", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "database0", - "name": "runCommand", - "arguments": { - "session": "session0", - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ] - }, - "readPreference": { - "mode": "primary" - }, - "commandName": "insert" - }, - "expectResult": { - "n": 1 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "run command fails with explicit secondary read preference", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "database0", - "name": "runCommand", - "arguments": { - "session": "session0", - "command": { - "find": "test" - }, - "readPreference": { - "mode": "secondary" - }, - "commandName": "find" - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - } - ] - }, - { - "description": "run command fails with secondary read preference from transaction options", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "readPreference": { - "mode": "secondary" - } - } - }, - { - "object": "database0", - "name": "runCommand", - "arguments": { - "session": "session0", - "command": { - "find": "test" - }, - "commandName": "find" - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/transaction-options-repl.json b/driver-core/src/test/resources/unified-test-format/transactions/transaction-options-repl.json deleted file mode 100644 index dc2cb77582c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/transaction-options-repl.json +++ /dev/null @@ -1,267 +0,0 @@ -{ - "description": "transaction-options-repl", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "readConcern snapshot in startTransaction options", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "session": { - "id": "session1", - "client": "client0", - "sessionOptions": { - "defaultTransactionOptions": { - "readConcern": { - "level": "majority" - } - } - } - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction", - "arguments": { - "readConcern": { - "level": "snapshot" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction" - }, - { - "object": "session1", - "name": "startTransaction", - "arguments": { - "readConcern": { - "level": "snapshot" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "object": "session1", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "snapshot" - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "snapshot", - "afterClusterTime": { - "$$exists": true - } - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/transaction-options.json b/driver-core/src/test/resources/unified-test-format/transactions/transaction-options.json deleted file mode 100644 index 78e4c8207b6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/transaction-options.json +++ /dev/null @@ -1,2081 +0,0 @@ -{ - "description": "transaction-options", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "no transaction options set", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - }, - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "afterClusterTime": { - "$$exists": true - } - }, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "transaction options inherited from client", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "readConcernLevel": "local", - "w": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction" - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "object": "session1", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "local" - }, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": 1 - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "local", - "afterClusterTime": { - "$$exists": true - } - }, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": 1 - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "transaction options inherited from defaultTransactionOptions", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "session": { - "id": "session1", - "client": "client0", - "sessionOptions": { - "defaultTransactionOptions": { - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "w": 1 - }, - "maxCommitTimeMS": 60000 - } - } - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction" - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "object": "session1", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": 1 - }, - "maxTimeMS": 60000 - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "majority", - "afterClusterTime": { - "$$exists": true - } - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": 1 - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "startTransaction options override defaults", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "readConcernLevel": "local", - "w": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1", - "sessionOptions": { - "defaultTransactionOptions": { - "readConcern": { - "level": "snapshot" - }, - "writeConcern": { - "w": 1 - }, - "maxCommitTimeMS": 30000 - } - } - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction", - "arguments": { - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "w": "majority" - }, - "maxCommitTimeMS": 60000 - } - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction" - }, - { - "object": "session1", - "name": "startTransaction", - "arguments": { - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "object": "session1", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": "majority" - }, - "maxTimeMS": 60000 - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "majority", - "afterClusterTime": { - "$$exists": true - } - }, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": "majority" - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "defaultTransactionOptions override client options", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "readConcernLevel": "local", - "w": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1", - "sessionOptions": { - "defaultTransactionOptions": { - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "w": "majority" - }, - "maxCommitTimeMS": 60000 - } - } - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction" - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "object": "session1", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": "majority" - }, - "maxTimeMS": 60000 - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "majority", - "afterClusterTime": { - "$$exists": true - } - }, - "writeConcern": { - "$$exists": false - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": "majority" - }, - "maxTimeMS": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "readConcern local in defaultTransactionOptions", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "w": 1 - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1", - "sessionOptions": { - "defaultTransactionOptions": { - "readConcern": { - "level": "local" - } - } - } - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session1", - "name": "commitTransaction" - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "object": "session1", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "local" - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": 1 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "local", - "afterClusterTime": { - "$$exists": true - } - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "2" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "w": 1 - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "client writeConcern ignored for bulk", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "w": "majority" - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": 1 - } - } - }, - { - "object": "collection1", - "name": "bulkWrite", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ], - "session": "session1" - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 1 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - }, - { - "object": "session1", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": 1 - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "readPreference inherited from client", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "readPreference": "secondary" - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "collection1", - "name": "find", - "arguments": { - "session": "session1", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - }, - { - "object": "session1", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "readPreference inherited from defaultTransactionOptions", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "readPreference": "primary" - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1", - "sessionOptions": { - "defaultTransactionOptions": { - "readPreference": { - "mode": "secondary" - } - } - } - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction" - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "collection1", - "name": "find", - "arguments": { - "session": "session1", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - }, - { - "object": "session1", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "startTransaction overrides readPreference", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "readPreference": "primary" - }, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session1", - "client": "client1", - "sessionOptions": { - "defaultTransactionOptions": { - "readPreference": { - "mode": "primary" - } - } - } - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction", - "arguments": { - "readPreference": { - "mode": "secondary" - } - } - }, - { - "object": "collection1", - "name": "insertOne", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "collection1", - "name": "find", - "arguments": { - "session": "session1", - "filter": { - "_id": 1 - } - }, - "expectError": { - "errorContains": "read preference in a transaction must be primary" - } - }, - { - "object": "session1", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/update.json b/driver-core/src/test/resources/unified-test-format/transactions/update.json deleted file mode 100644 index 8090fc90879..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/update.json +++ /dev/null @@ -1,565 +0,0 @@ -{ - "description": "update", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ], - "tests": [ - { - "description": "update", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "updateOne", - "arguments": { - "session": "session0", - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - } - }, - { - "object": "collection0", - "name": "replaceOne", - "arguments": { - "session": "session0", - "filter": { - "x": 1 - }, - "replacement": { - "y": 1 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "object": "collection0", - "name": "updateMany", - "arguments": { - "session": "session0", - "filter": { - "_id": { - "$gte": 3 - } - }, - "update": { - "$set": { - "z": 1 - } - } - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 4 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "upsert": true, - "multi": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "x": 1 - }, - "u": { - "y": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": { - "$gte": 3 - } - }, - "u": { - "$set": { - "z": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3, - "z": 1 - }, - { - "_id": 4, - "y": 1, - "z": 1 - } - ] - } - ] - }, - { - "description": "collections writeConcern ignored for update", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "collection": { - "id": "collection1", - "database": "database0", - "collectionName": "test", - "collectionOptions": { - "writeConcern": { - "w": "majority" - } - } - } - } - ] - } - }, - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection1", - "name": "updateOne", - "arguments": { - "session": "session0", - "filter": { - "_id": 4 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - }, - "expectResult": { - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 1, - "upsertedId": 4 - } - }, - { - "object": "collection1", - "name": "replaceOne", - "arguments": { - "session": "session0", - "filter": { - "x": 1 - }, - "replacement": { - "y": 1 - } - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "object": "collection1", - "name": "updateMany", - "arguments": { - "session": "session0", - "filter": { - "_id": { - "$gte": 3 - } - }, - "update": { - "$set": { - "z": 1 - } - } - }, - "expectResult": { - "matchedCount": 2, - "modifiedCount": 2, - "upsertedCount": 0 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 4 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "upsert": true, - "multi": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "x": 1 - }, - "u": { - "y": 1 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": { - "$gte": 3 - } - }, - "u": { - "$set": { - "z": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/transactions/write-concern.json b/driver-core/src/test/resources/unified-test-format/transactions/write-concern.json deleted file mode 100644 index 7acdd54066e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/transactions/write-concern.json +++ /dev/null @@ -1,1584 +0,0 @@ -{ - "description": "write-concern", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "collection": { - "id": "collection_w0", - "database": "database0", - "collectionName": "test", - "collectionOptions": { - "writeConcern": { - "w": 0 - } - } - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 0 - } - ] - } - ], - "tests": [ - { - "description": "commit with majority", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 0 - }, - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "commit with default", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 0 - }, - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "abort with majority", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": "majority" - } - } - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "w": "majority" - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 0 - } - ] - } - ] - }, - { - "description": "abort with default", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "abortTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 0 - } - ] - } - ] - }, - { - "description": "start with unacknowledged write concern", - "operations": [ - { - "object": "session0", - "name": "startTransaction", - "arguments": { - "writeConcern": { - "w": 0 - } - }, - "expectError": { - "isClientError": true, - "errorContains": "transactions do not support unacknowledged write concern" - } - } - ] - }, - { - "description": "start with implicit unacknowledged write concern", - "operations": [ - { - "object": "testRunner", - "name": "createEntities", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "useMultipleMongoses": false, - "uriOptions": { - "w": 0 - } - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - } - ] - } - }, - { - "object": "session1", - "name": "startTransaction", - "expectError": { - "isClientError": true, - "errorContains": "transactions do not support unacknowledged write concern" - } - } - ] - }, - { - "description": "unacknowledged write concern coll insertOne", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_w0", - "name": "insertOne", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 0 - }, - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "unacknowledged write concern coll insertMany", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_w0", - "name": "insertMany", - "arguments": { - "session": "session0", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 1, - "1": 2 - } - } - } - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 0 - }, - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "unacknowledged write concern coll bulkWrite", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_w0", - "name": "bulkWrite", - "arguments": { - "session": "session0", - "requests": [ - { - "insertOne": { - "document": { - "_id": 1 - } - } - } - ] - }, - "expectResult": { - "deletedCount": 0, - "insertedCount": 1, - "insertedIds": { - "$$unsetOrMatches": { - "0": 1 - } - }, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 0 - }, - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "unacknowledged write concern coll deleteOne", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_w0", - "name": "deleteOne", - "arguments": { - "session": "session0", - "filter": { - "_id": 0 - } - }, - "expectResult": { - "deletedCount": 1 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": 0 - }, - "limit": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "delete", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "unacknowledged write concern coll deleteMany", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_w0", - "name": "deleteMany", - "arguments": { - "session": "session0", - "filter": { - "_id": 0 - } - }, - "expectResult": { - "deletedCount": 1 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": 0 - }, - "limit": 0 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "delete", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "unacknowledged write concern coll updateOne", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_w0", - "name": "updateOne", - "arguments": { - "session": "session0", - "filter": { - "_id": 0 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 0 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "upsert": true, - "multi": { - "$$unsetOrMatches": false - } - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 0, - "x": 1 - } - ] - } - ] - }, - { - "description": "unacknowledged write concern coll updateMany", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_w0", - "name": "updateMany", - "arguments": { - "session": "session0", - "filter": { - "_id": 0 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "upsert": true - }, - "expectResult": { - "matchedCount": 1, - "modifiedCount": 1, - "upsertedCount": 0 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 0 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "upsert": true - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "update", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 0, - "x": 1 - } - ] - } - ] - }, - { - "description": "unacknowledged write concern coll findOneAndDelete", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_w0", - "name": "findOneAndDelete", - "arguments": { - "session": "session0", - "filter": { - "_id": 0 - } - }, - "expectResult": { - "_id": 0 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 0 - }, - "remove": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ] - }, - { - "description": "unacknowledged write concern coll findOneAndReplace", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_w0", - "name": "findOneAndReplace", - "arguments": { - "session": "session0", - "filter": { - "_id": 0 - }, - "replacement": { - "x": 1 - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 0 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 0 - }, - "update": { - "x": 1 - }, - "new": false, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 0, - "x": 1 - } - ] - } - ] - }, - { - "description": "unacknowledged write concern coll findOneAndUpdate", - "operations": [ - { - "object": "session0", - "name": "startTransaction" - }, - { - "object": "collection_w0", - "name": "findOneAndUpdate", - "arguments": { - "session": "session0", - "filter": { - "_id": 0 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 0 - } - }, - { - "object": "session0", - "name": "commitTransaction" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 0 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "new": false, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "findAndModify", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": { - "$numberLong": "1" - }, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 0, - "x": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/assertNumberConnectionsCheckedOut.json b/driver-core/src/test/resources/unified-test-format/valid-fail/assertNumberConnectionsCheckedOut.json deleted file mode 100644 index 9799bb2f651..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/assertNumberConnectionsCheckedOut.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "description": "assertNumberConnectionsCheckedOut", - "schemaVersion": "1.3", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true - } - } - ], - "tests": [ - { - "description": "operation fails if client field is not specified", - "operations": [ - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "connections": 1 - } - } - ] - }, - { - "description": "operation fails if connections field is not specified", - "operations": [ - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ] - }, - { - "description": "operation fails if client entity does not exist", - "operations": [ - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client1" - } - } - ] - }, - { - "description": "operation fails if number of connections is incorrect", - "operations": [ - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 1 - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-bucket-database-undefined.json b/driver-core/src/test/resources/unified-test-format/valid-fail/entity-bucket-database-undefined.json deleted file mode 100644 index 7f7f1978c38..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-bucket-database-undefined.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "entity-bucket-database-undefined", - "schemaVersion": "1.0", - "createEntities": [ - { - "bucket": { - "id": "bucket0", - "database": "foo" - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.json b/driver-core/src/test/resources/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.json deleted file mode 100644 index d92d23dcaf0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "entity-client-apiVersion-unsupported", - "schemaVersion": "1.1", - "createEntities": [ - { - "client": { - "id": "client0", - "serverApi": { - "version": "server_will_never_support_this_api_version" - } - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-client-storeEventsAsEntities-conflict_with_client_id.json b/driver-core/src/test/resources/unified-test-format/valid-fail/entity-client-storeEventsAsEntities-conflict_with_client_id.json deleted file mode 100644 index 8c0c4d2041e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-client-storeEventsAsEntities-conflict_with_client_id.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "description": "entity-client-storeEventsAsEntities-conflict_with_client_id", - "schemaVersion": "1.2", - "createEntities": [ - { - "client": { - "id": "client0", - "storeEventsAsEntities": [ - { - "id": "client0", - "events": [ - "PoolCreatedEvent", - "PoolReadyEvent", - "PoolClearedEvent", - "PoolClosedEvent" - ] - } - ] - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-client-storeEventsAsEntities-conflict_within_different_array.json b/driver-core/src/test/resources/unified-test-format/valid-fail/entity-client-storeEventsAsEntities-conflict_within_different_array.json deleted file mode 100644 index 77bc4abf2ec..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-client-storeEventsAsEntities-conflict_within_different_array.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "description": "entity-client-storeEventsAsEntities-conflict_within_different_array", - "schemaVersion": "1.2", - "createEntities": [ - { - "client": { - "id": "client0", - "storeEventsAsEntities": [ - { - "id": "events", - "events": [ - "PoolCreatedEvent", - "PoolReadyEvent", - "PoolClearedEvent", - "PoolClosedEvent" - ] - } - ] - } - }, - { - "client": { - "id": "client1", - "storeEventsAsEntities": [ - { - "id": "events", - "events": [ - "CommandStartedEvent", - "CommandSucceededEvent", - "CommandFailedEvent" - ] - } - ] - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-client-storeEventsAsEntities-conflict_within_same_array.json b/driver-core/src/test/resources/unified-test-format/valid-fail/entity-client-storeEventsAsEntities-conflict_within_same_array.json deleted file mode 100644 index e1a94998830..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-client-storeEventsAsEntities-conflict_within_same_array.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "description": "entity-client-storeEventsAsEntities-conflict_within_same_array", - "schemaVersion": "1.2", - "createEntities": [ - { - "client": { - "id": "client0", - "storeEventsAsEntities": [ - { - "id": "events", - "events": [ - "PoolCreatedEvent", - "PoolReadyEvent", - "PoolClearedEvent", - "PoolClosedEvent" - ] - }, - { - "id": "events", - "events": [ - "CommandStartedEvent", - "CommandSucceededEvent", - "CommandFailedEvent" - ] - } - ] - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-collection-database-undefined.json b/driver-core/src/test/resources/unified-test-format/valid-fail/entity-collection-database-undefined.json deleted file mode 100644 index 20b0733e340..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-collection-database-undefined.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "entity-collection-database-undefined", - "schemaVersion": "1.0", - "createEntities": [ - { - "collection": { - "id": "collection0", - "database": "foo", - "collectionName": "foo" - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-database-client-undefined.json b/driver-core/src/test/resources/unified-test-format/valid-fail/entity-database-client-undefined.json deleted file mode 100644 index 0f8110e6d37..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-database-client-undefined.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "entity-database-client-undefined", - "schemaVersion": "1.0", - "createEntities": [ - { - "database": { - "id": "database0", - "client": "foo", - "databaseName": "foo" - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-findCursor-malformed.json b/driver-core/src/test/resources/unified-test-format/valid-fail/entity-findCursor-malformed.json deleted file mode 100644 index 0956efa4c86..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-findCursor-malformed.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "description": "entity-findCursor-malformed", - "schemaVersion": "1.3", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "databaseName": "database0Name", - "collectionName": "coll0", - "documents": [] - } - ], - "tests": [ - { - "description": "createFindCursor fails if filter is not specified", - "operations": [ - { - "name": "createFindCursor", - "object": "collection0", - "saveResultAsEntity": "cursor0" - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-findCursor.json b/driver-core/src/test/resources/unified-test-format/valid-fail/entity-findCursor.json deleted file mode 100644 index 389e448c061..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-findCursor.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "description": "entity-findCursor", - "schemaVersion": "1.3", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "databaseName": "database0Name", - "collectionName": "coll0", - "documents": [] - } - ], - "tests": [ - { - "description": "iterateUntilDocumentOrError fails if it references a nonexistent entity", - "operations": [ - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0" - } - ] - }, - { - "description": "close fails if it references a nonexistent entity", - "operations": [ - { - "name": "close", - "object": "cursor0" - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-session-client-undefined.json b/driver-core/src/test/resources/unified-test-format/valid-fail/entity-session-client-undefined.json deleted file mode 100644 index 260356436a8..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/entity-session-client-undefined.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "description": "entity-session-client-undefined", - "schemaVersion": "1.0", - "createEntities": [ - { - "session": { - "id": "session0", - "client": "foo" - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/ignoreResultAndError-malformed.json b/driver-core/src/test/resources/unified-test-format/valid-fail/ignoreResultAndError-malformed.json deleted file mode 100644 index b64779c7232..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/ignoreResultAndError-malformed.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "description": "ignoreResultAndError-malformed", - "schemaVersion": "1.3", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0Name", - "documents": [] - } - ], - "tests": [ - { - "description": "malformed operation fails if ignoreResultAndError is true", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "foo": "bar" - }, - "ignoreResultAndError": true - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/ignoreResultAndError.json b/driver-core/src/test/resources/unified-test-format/valid-fail/ignoreResultAndError.json deleted file mode 100644 index 01b2421a9fa..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/ignoreResultAndError.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "description": "ignoreResultAndError", - "schemaVersion": "1.3", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0Name", - "documents": [] - } - ], - "tests": [ - { - "description": "operation errors are not ignored if ignoreResultAndError is false", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1 - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1 - } - }, - "ignoreResultAndError": false - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/kmsProviders-missing_aws_kms_credentials.json b/driver-core/src/test/resources/unified-test-format/valid-fail/kmsProviders-missing_aws_kms_credentials.json deleted file mode 100644 index e62de800332..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/kmsProviders-missing_aws_kms_credentials.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "description": "kmsProviders-missing_aws_kms_credentials", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws": { - "accessKeyId": "accessKeyId" - } - } - } - } - } - ], - "tests": [ - { - "description": "", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/kmsProviders-missing_azure_kms_credentials.json b/driver-core/src/test/resources/unified-test-format/valid-fail/kmsProviders-missing_azure_kms_credentials.json deleted file mode 100644 index 8ef805d0fa6..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/kmsProviders-missing_azure_kms_credentials.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "description": "kmsProviders-missing_azure_kms_credentials", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "azure": { - "tenantId": "tenantId" - } - } - } - } - } - ], - "tests": [ - { - "description": "", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/kmsProviders-missing_gcp_kms_credentials.json b/driver-core/src/test/resources/unified-test-format/valid-fail/kmsProviders-missing_gcp_kms_credentials.json deleted file mode 100644 index c6da1ce58ca..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/kmsProviders-missing_gcp_kms_credentials.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "description": "kmsProviders-missing_gcp_kms_credentials", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "gcp": { - "email": "email" - } - } - } - } - } - ], - "tests": [ - { - "description": "", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/kmsProviders-no_kms.json b/driver-core/src/test/resources/unified-test-format/valid-fail/kmsProviders-no_kms.json deleted file mode 100644 index 57499b4eaf4..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/kmsProviders-no_kms.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "description": "clientEncryptionOpts-no_kms", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": {} - } - } - } - ], - "tests": [ - { - "description": "", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/operation-failure.json b/driver-core/src/test/resources/unified-test-format/valid-fail/operation-failure.json deleted file mode 100644 index 8f6cae1521c..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/operation-failure.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "description": "operation-failure", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "operation-failure" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "tests": [ - { - "description": "Unsupported command", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "unsupportedCommand", - "command": { - "unsupportedCommand": 1 - } - } - } - ] - }, - { - "description": "Unsupported query operator", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "$unsupportedQueryOperator": 1 - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/operation-unsupported.json b/driver-core/src/test/resources/unified-test-format/valid-fail/operation-unsupported.json deleted file mode 100644 index d8ef5ab1c8b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/operation-unsupported.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "description": "operation-unsupported", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - } - ], - "tests": [ - { - "description": "Unsupported operation", - "operations": [ - { - "name": "unsupportedOperation", - "object": "client0" - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/returnDocument-enum-invalid.json b/driver-core/src/test/resources/unified-test-format/valid-fail/returnDocument-enum-invalid.json deleted file mode 100644 index ea425fb5681..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/returnDocument-enum-invalid.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "description": "returnDocument-enum-invalid", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - } - ], - "tests": [ - { - "description": "FindOneAndReplace returnDocument invalid enum value", - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "_id": 1, - "x": 111 - }, - "returnDocument": "invalid" - } - } - ] - }, - { - "description": "FindOneAndUpdate returnDocument invalid enum value", - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "invalid" - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-fail/schemaVersion-unsupported.json b/driver-core/src/test/resources/unified-test-format/valid-fail/schemaVersion-unsupported.json deleted file mode 100644 index ceb55329179..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-fail/schemaVersion-unsupported.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "description": "schemaVersion-unsupported", - "schemaVersion": "0.1", - "tests": [ - { - "description": "foo", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/assertNumberConnectionsCheckedOut.json b/driver-core/src/test/resources/unified-test-format/valid-pass/assertNumberConnectionsCheckedOut.json deleted file mode 100644 index a9fc063f330..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/assertNumberConnectionsCheckedOut.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "description": "assertNumberConnectionsCheckedOut", - "schemaVersion": "1.3", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true - } - } - ], - "tests": [ - { - "description": "basic assertion succeeds", - "operations": [ - { - "name": "assertNumberConnectionsCheckedOut", - "object": "testRunner", - "arguments": { - "client": "client0", - "connections": 0 - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/collectionData-createOptions.json b/driver-core/src/test/resources/unified-test-format/valid-pass/collectionData-createOptions.json deleted file mode 100644 index 19edc2247b0..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/collectionData-createOptions.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "description": "collectionData-createOptions", - "schemaVersion": "1.9", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0", - "createOptions": { - "capped": true, - "size": 4096 - }, - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "collection is created with the correct options", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$collStats": { - "storageStats": {} - } - }, - { - "$project": { - "capped": "$storageStats.capped", - "maxSize": "$storageStats.maxSize" - } - } - ] - }, - "expectResult": [ - { - "capped": true, - "maxSize": 4096 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/createEntities-operation.json b/driver-core/src/test/resources/unified-test-format/valid-pass/createEntities-operation.json deleted file mode 100644 index 3fde42919d7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/createEntities-operation.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "description": "createEntities-operation", - "schemaVersion": "1.9", - "tests": [ - { - "description": "createEntities operation", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client1", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "database1" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll1" - } - } - ] - } - }, - { - "name": "deleteOne", - "object": "collection1", - "arguments": { - "filter": { - "_id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll1", - "deletes": [ - { - "q": { - "_id": 1 - }, - "limit": 1 - } - ] - }, - "commandName": "delete", - "databaseName": "database1" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/entity-client-cmap-events.json b/driver-core/src/test/resources/unified-test-format/valid-pass/entity-client-cmap-events.json deleted file mode 100644 index 3209033def4..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/entity-client-cmap-events.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "description": "entity-client-cmap-events", - "schemaVersion": "1.3", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "connectionReadyEvent", - "connectionCheckedOutEvent", - "connectionCheckedInEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0Name", - "documents": [] - } - ], - "tests": [ - { - "description": "events are captured during an operation", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "x": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - }, - { - "connectionCheckedOutEvent": {} - }, - { - "connectionCheckedInEvent": {} - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/entity-client-storeEventsAsEntities.json b/driver-core/src/test/resources/unified-test-format/valid-pass/entity-client-storeEventsAsEntities.json deleted file mode 100644 index e37e5a1acd9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/entity-client-storeEventsAsEntities.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "description": "entity-client-storeEventsAsEntities", - "schemaVersion": "1.2", - "createEntities": [ - { - "client": { - "id": "client0", - "storeEventsAsEntities": [ - { - "id": "client0_events", - "events": [ - "CommandStartedEvent", - "CommandSucceededEvent", - "CommandFailedEvent" - ] - } - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "test", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ], - "tests": [ - { - "description": "storeEventsAsEntities captures events", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {} - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/entity-commandCursor.json b/driver-core/src/test/resources/unified-test-format/valid-pass/entity-commandCursor.json deleted file mode 100644 index 72b74b4a9a8..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/entity-commandCursor.json +++ /dev/null @@ -1,278 +0,0 @@ -{ - "description": "entity-commandCursor", - "schemaVersion": "1.3", - "createEntities": [ - { - "client": { - "id": "client", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "db", - "client": "client", - "databaseName": "db" - } - }, - { - "collection": { - "id": "collection", - "database": "db", - "collectionName": "collection" - } - } - ], - "initialData": [ - { - "collectionName": "collection", - "databaseName": "db", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "tests": [ - { - "description": "runCursorCommand creates and exhausts cursor by running getMores", - "operations": [ - { - "name": "runCursorCommand", - "object": "db", - "arguments": { - "commandName": "find", - "batchSize": 2, - "command": { - "find": "collection", - "filter": {}, - "batchSize": 2 - } - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection", - "filter": {}, - "batchSize": 2, - "$db": "db", - "lsid": { - "$$exists": true - } - }, - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "collection", - "$db": "db", - "lsid": { - "$$exists": true - } - }, - "commandName": "getMore" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "collection", - "$db": "db", - "lsid": { - "$$exists": true - } - }, - "commandName": "getMore" - } - } - ] - } - ] - }, - { - "description": "createCommandCursor creates a cursor and stores it as an entity that can be iterated one document at a time", - "operations": [ - { - "name": "createCommandCursor", - "object": "db", - "arguments": { - "commandName": "find", - "batchSize": 2, - "command": { - "find": "collection", - "filter": {}, - "batchSize": 2 - } - }, - "saveResultAsEntity": "myRunCommandCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "myRunCommandCursor", - "expectResult": { - "_id": 1, - "x": 11 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "myRunCommandCursor", - "expectResult": { - "_id": 2, - "x": 22 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "myRunCommandCursor", - "expectResult": { - "_id": 3, - "x": 33 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "myRunCommandCursor", - "expectResult": { - "_id": 4, - "x": 44 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "myRunCommandCursor", - "expectResult": { - "_id": 5, - "x": 55 - } - } - ] - }, - { - "description": "createCommandCursor's cursor can be closed and will perform a killCursors operation", - "operations": [ - { - "name": "createCommandCursor", - "object": "db", - "arguments": { - "commandName": "find", - "batchSize": 2, - "command": { - "find": "collection", - "filter": {}, - "batchSize": 2 - } - }, - "saveResultAsEntity": "myRunCommandCursor" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "myRunCommandCursor", - "expectResult": { - "_id": 1, - "x": 11 - } - }, - { - "name": "close", - "object": "myRunCommandCursor" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "collection", - "filter": {}, - "batchSize": 2, - "$db": "db", - "lsid": { - "$$exists": true - } - }, - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "command": { - "killCursors": "collection", - "cursors": { - "$$type": "array" - } - }, - "commandName": "killCursors" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/entity-cursor-iterateOnce.json b/driver-core/src/test/resources/unified-test-format/valid-pass/entity-cursor-iterateOnce.json deleted file mode 100644 index b17ae78b942..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/entity-cursor-iterateOnce.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - "description": "entity-cursor-iterateOnce", - "schemaVersion": "1.9", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "databaseName": "database0", - "collectionName": "coll0", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ], - "tests": [ - { - "description": "iterateOnce", - "operations": [ - { - "name": "createFindCursor", - "object": "collection0", - "arguments": { - "filter": {}, - "batchSize": 2 - }, - "saveResultAsEntity": "cursor0" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectResult": { - "_id": 1 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectResult": { - "_id": 2 - } - }, - { - "name": "iterateOnce", - "object": "cursor0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": {}, - "batchSize": 2 - }, - "commandName": "find", - "databaseName": "database0" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0" - }, - "commandName": "getMore" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/entity-find-cursor.json b/driver-core/src/test/resources/unified-test-format/valid-pass/entity-find-cursor.json deleted file mode 100644 index 6f955d81f4a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/entity-find-cursor.json +++ /dev/null @@ -1,191 +0,0 @@ -{ - "description": "entity-find-cursor", - "schemaVersion": "1.3", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "databaseName": "database0Name", - "collectionName": "coll0", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - }, - { - "_id": 4 - }, - { - "_id": 5 - } - ] - } - ], - "tests": [ - { - "description": "cursors can be created, iterated, and closed", - "operations": [ - { - "name": "createFindCursor", - "object": "collection0", - "arguments": { - "filter": {}, - "batchSize": 2 - }, - "saveResultAsEntity": "cursor0" - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectResult": { - "_id": 1 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectResult": { - "_id": 2 - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "cursor0", - "expectResult": { - "_id": 3 - } - }, - { - "name": "close", - "object": "cursor0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll0", - "filter": {}, - "batchSize": 2 - }, - "commandName": "find", - "databaseName": "database0Name" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursor": { - "id": { - "$$type": [ - "int", - "long" - ] - }, - "ns": { - "$$type": "string" - }, - "firstBatch": { - "$$type": "array" - } - } - }, - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "coll0" - }, - "commandName": "getMore" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursor": { - "id": { - "$$type": [ - "int", - "long" - ] - }, - "ns": { - "$$type": "string" - }, - "nextBatch": { - "$$type": "array" - } - } - }, - "commandName": "getMore" - } - }, - { - "commandStartedEvent": { - "command": { - "killCursors": "coll0", - "cursors": { - "$$type": "array" - } - }, - "commandName": "killCursors" - } - }, - { - "commandSucceededEvent": { - "reply": { - "cursorsKilled": { - "$$unsetOrMatches": { - "$$type": "array" - } - } - }, - "commandName": "killCursors" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/expectedError-errorResponse.json b/driver-core/src/test/resources/unified-test-format/valid-pass/expectedError-errorResponse.json deleted file mode 100644 index 177b1baf56a..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/expectedError-errorResponse.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "expectedError-errorResponse", - "schemaVersion": "1.12", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "test" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "tests": [ - { - "description": "Unsupported command", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "unsupportedCommand", - "command": { - "unsupportedCommand": 1 - } - }, - "expectError": { - "errorResponse": { - "errmsg": { - "$$type": "string" - } - } - } - } - ] - }, - { - "description": "Unsupported query operator", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "$unsupportedQueryOperator": 1 - } - }, - "expectError": { - "errorResponse": { - "errmsg": { - "$$type": "string" - } - } - } - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/expectedEventsForClient-eventType.json b/driver-core/src/test/resources/unified-test-format/valid-pass/expectedEventsForClient-eventType.json deleted file mode 100644 index fe308df9653..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/expectedEventsForClient-eventType.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "description": "expectedEventsForClient-eventType", - "schemaVersion": "1.3", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent", - "connectionReadyEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0Name", - "documents": [] - } - ], - "tests": [ - { - "description": "eventType can be set to command and cmap", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "eventType": "command", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1 - } - ] - }, - "commandName": "insert" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - } - ] - } - ] - }, - { - "description": "eventType defaults to command if unset", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1 - } - ] - }, - "commandName": "insert" - } - } - ] - }, - { - "client": "client0", - "eventType": "cmap", - "events": [ - { - "connectionReadyEvent": {} - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/expectedEventsForClient-ignoreExtraEvents.json b/driver-core/src/test/resources/unified-test-format/valid-pass/expectedEventsForClient-ignoreExtraEvents.json deleted file mode 100644 index 178b756c2cf..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/expectedEventsForClient-ignoreExtraEvents.json +++ /dev/null @@ -1,151 +0,0 @@ -{ - "description": "expectedEventsForClient-ignoreExtraEvents", - "schemaVersion": "1.7", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0Name", - "documents": [] - } - ], - "tests": [ - { - "description": "ignoreExtraEvents can be set to false", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": false, - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 1 - } - ] - }, - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "ignoreExtraEvents can be set to true", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 2 - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "ignoreExtraEvents": true, - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 2 - } - ] - }, - "commandName": "insert" - } - } - ] - } - ] - }, - { - "description": "ignoreExtraEvents defaults to false if unset", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 4 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": 4 - } - ] - }, - "commandName": "insert" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/expectedEventsForClient-topologyDescriptionChangedEvent.json b/driver-core/src/test/resources/unified-test-format/valid-pass/expectedEventsForClient-topologyDescriptionChangedEvent.json deleted file mode 100644 index cf7bd60826b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/expectedEventsForClient-topologyDescriptionChangedEvent.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "description": "expectedEventsForClient-topologyDescriptionChangedEvent", - "schemaVersion": "1.20", - "runOnRequirements": [ - { - "topologies": [ - "replicaset" - ], - "minServerVersion": "4.4" - } - ], - "tests": [ - { - "description": "can assert on values of newDescription and previousDescription fields", - "operations": [ - { - "name": "createEntities", - "object": "testRunner", - "arguments": { - "entities": [ - { - "client": { - "id": "client", - "uriOptions": { - "directConnection": true - }, - "observeEvents": [ - "topologyDescriptionChangedEvent" - ] - } - } - ] - } - }, - { - "name": "waitForEvent", - "object": "testRunner", - "arguments": { - "client": "client", - "event": { - "topologyDescriptionChangedEvent": {} - }, - "count": 1 - } - } - ], - "expectEvents": [ - { - "client": "client", - "eventType": "sdam", - "ignoreExtraEvents": true, - "events": [ - { - "topologyDescriptionChangedEvent": { - "previousDescription": { - "type": "Unknown" - }, - "newDescription": { - "type": "Single" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/ignoreResultAndError.json b/driver-core/src/test/resources/unified-test-format/valid-pass/ignoreResultAndError.json deleted file mode 100644 index 2e9b1c58ab9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/ignoreResultAndError.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "description": "ignoreResultAndError", - "schemaVersion": "1.3", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0Name", - "documents": [] - } - ], - "tests": [ - { - "description": "operation errors are ignored if ignoreResultAndError is true", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1 - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1 - } - }, - "ignoreResultAndError": true - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/kmsProviders-explicit_kms_credentials.json b/driver-core/src/test/resources/unified-test-format/valid-pass/kmsProviders-explicit_kms_credentials.json deleted file mode 100644 index 7cc74939ebc..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/kmsProviders-explicit_kms_credentials.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "description": "kmsProviders-explicit_kms_credentials", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws": { - "accessKeyId": "accessKeyId", - "secretAccessKey": "secretAccessKey" - }, - "azure": { - "tenantId": "tenantId", - "clientId": "clientId", - "clientSecret": "clientSecret" - }, - "gcp": { - "email": "email", - "privateKey": "cHJpdmF0ZUtleQo=" - }, - "kmip": { - "endpoint": "endpoint" - }, - "local": { - "key": "a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5a2V5" - } - } - } - } - } - ], - "tests": [ - { - "description": "", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/kmsProviders-mixed_kms_credential_fields.json b/driver-core/src/test/resources/unified-test-format/valid-pass/kmsProviders-mixed_kms_credential_fields.json deleted file mode 100644 index 363f2a45761..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/kmsProviders-mixed_kms_credential_fields.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "description": "kmsProviders-mixed_kms_credential_fields", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws": { - "accessKeyId": "accessKeyId", - "secretAccessKey": { - "$$placeholder": 1 - } - }, - "azure": { - "tenantId": "tenantId", - "clientId": { - "$$placeholder": 1 - }, - "clientSecret": { - "$$placeholder": 1 - } - }, - "gcp": { - "email": "email", - "privateKey": { - "$$placeholder": 1 - } - } - } - } - } - } - ], - "tests": [ - { - "description": "", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/kmsProviders-placeholder_kms_credentials.json b/driver-core/src/test/resources/unified-test-format/valid-pass/kmsProviders-placeholder_kms_credentials.json deleted file mode 100644 index 3f7721f01d5..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/kmsProviders-placeholder_kms_credentials.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "description": "kmsProviders-placeholder_kms_credentials", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws": { - "accessKeyId": { - "$$placeholder": 1 - }, - "secretAccessKey": { - "$$placeholder": 1 - } - }, - "azure": { - "tenantId": { - "$$placeholder": 1 - }, - "clientId": { - "$$placeholder": 1 - }, - "clientSecret": { - "$$placeholder": 1 - } - }, - "gcp": { - "email": { - "$$placeholder": 1 - }, - "privateKey": { - "$$placeholder": 1 - } - }, - "kmip": { - "endpoint": { - "$$placeholder": 1 - } - }, - "local": { - "key": { - "$$placeholder": 1 - } - } - } - } - } - } - ], - "tests": [ - { - "description": "", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/kmsProviders-unconfigured_kms.json b/driver-core/src/test/resources/unified-test-format/valid-pass/kmsProviders-unconfigured_kms.json deleted file mode 100644 index 12ca580941b..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/kmsProviders-unconfigured_kms.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "description": "kmsProviders-unconfigured_kms", - "schemaVersion": "1.8", - "runOnRequirements": [ - { - "csfle": true - } - ], - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "clientEncryption": { - "id": "clientEncryption0", - "clientEncryptionOpts": { - "keyVaultClient": "client0", - "keyVaultNamespace": "keyvault.datakeys", - "kmsProviders": { - "aws": {}, - "azure": {}, - "gcp": {}, - "kmip": {}, - "local": {} - } - } - } - } - ], - "tests": [ - { - "description": "", - "skipReason": "DRIVERS-2280: waiting on driver support for on-demand credentials", - "operations": [] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/matches-lte-operator.json b/driver-core/src/test/resources/unified-test-format/valid-pass/matches-lte-operator.json deleted file mode 100644 index 4de65c58387..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/matches-lte-operator.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "description": "matches-lte-operator", - "schemaVersion": "1.9", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0Name" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0Name", - "documents": [] - } - ], - "tests": [ - { - "description": "special lte matching operator", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 1, - "y": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll0", - "documents": [ - { - "_id": { - "$$lte": 1 - }, - "y": { - "$$lte": 2 - } - } - ] - }, - "commandName": "insert", - "databaseName": "database0Name" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/observeSensitiveCommands.json b/driver-core/src/test/resources/unified-test-format/valid-pass/observeSensitiveCommands.json deleted file mode 100644 index d3ae5665be9..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/observeSensitiveCommands.json +++ /dev/null @@ -1,706 +0,0 @@ -{ - "description": "observeSensitiveCommands", - "schemaVersion": "1.5", - "runOnRequirements": [ - { - "auth": false - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent" - ], - "observeSensitiveCommands": true - } - }, - { - "client": { - "id": "client1", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent" - ], - "observeSensitiveCommands": false - } - }, - { - "client": { - "id": "client2", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "observeSensitiveCommands" - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "observeSensitiveCommands" - } - }, - { - "database": { - "id": "database2", - "client": "client2", - "databaseName": "observeSensitiveCommands" - } - } - ], - "tests": [ - { - "description": "getnonce is observed with observeSensitiveCommands=true", - "runOnRequirements": [ - { - "maxServerVersion": "6.1.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "getnonce", - "command": { - "getnonce": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "getnonce", - "command": { - "getnonce": { - "$$exists": false - } - } - } - }, - { - "commandSucceededEvent": { - "commandName": "getnonce", - "reply": { - "ok": { - "$$exists": false - }, - "nonce": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "getnonce is not observed with observeSensitiveCommands=false", - "runOnRequirements": [ - { - "maxServerVersion": "6.1.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database1", - "arguments": { - "commandName": "getnonce", - "command": { - "getnonce": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [] - } - ] - }, - { - "description": "getnonce is not observed by default", - "runOnRequirements": [ - { - "maxServerVersion": "6.1.99" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database2", - "arguments": { - "commandName": "getnonce", - "command": { - "getnonce": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client2", - "events": [] - } - ] - }, - { - "description": "hello with speculativeAuthenticate", - "runOnRequirements": [ - { - "minServerVersion": "4.9" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "hello", - "command": { - "hello": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - }, - { - "name": "runCommand", - "object": "database1", - "arguments": { - "commandName": "hello", - "command": { - "hello": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - }, - { - "name": "runCommand", - "object": "database2", - "arguments": { - "commandName": "hello", - "command": { - "hello": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "hello", - "command": { - "hello": { - "$$exists": false - }, - "speculativeAuthenticate": { - "$$exists": false - } - } - } - }, - { - "commandSucceededEvent": { - "commandName": "hello", - "reply": { - "isWritablePrimary": { - "$$exists": false - }, - "speculativeAuthenticate": { - "$$exists": false - } - } - } - } - ] - }, - { - "client": "client1", - "events": [] - }, - { - "client": "client2", - "events": [] - } - ] - }, - { - "description": "hello without speculativeAuthenticate is always observed", - "runOnRequirements": [ - { - "minServerVersion": "4.9" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "hello", - "command": { - "hello": 1 - } - } - }, - { - "name": "runCommand", - "object": "database1", - "arguments": { - "commandName": "hello", - "command": { - "hello": 1 - } - } - }, - { - "name": "runCommand", - "object": "database2", - "arguments": { - "commandName": "hello", - "command": { - "hello": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "hello", - "command": { - "hello": 1 - } - } - }, - { - "commandSucceededEvent": { - "commandName": "hello", - "reply": { - "isWritablePrimary": { - "$$exists": true - } - } - } - } - ] - }, - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "commandName": "hello", - "command": { - "hello": 1 - } - } - }, - { - "commandSucceededEvent": { - "commandName": "hello", - "reply": { - "isWritablePrimary": { - "$$exists": true - } - } - } - } - ] - }, - { - "client": "client2", - "events": [ - { - "commandStartedEvent": { - "commandName": "hello", - "command": { - "hello": 1 - } - } - }, - { - "commandSucceededEvent": { - "commandName": "hello", - "reply": { - "isWritablePrimary": { - "$$exists": true - } - } - } - } - ] - } - ] - }, - { - "description": "legacy hello with speculativeAuthenticate", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "ismaster", - "command": { - "ismaster": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - }, - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "isMaster", - "command": { - "isMaster": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - }, - { - "name": "runCommand", - "object": "database1", - "arguments": { - "commandName": "ismaster", - "command": { - "ismaster": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - }, - { - "name": "runCommand", - "object": "database1", - "arguments": { - "commandName": "isMaster", - "command": { - "isMaster": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - }, - { - "name": "runCommand", - "object": "database2", - "arguments": { - "commandName": "ismaster", - "command": { - "ismaster": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - }, - { - "name": "runCommand", - "object": "database2", - "arguments": { - "commandName": "isMaster", - "command": { - "isMaster": 1, - "speculativeAuthenticate": { - "saslStart": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "ismaster", - "command": { - "ismaster": { - "$$exists": false - }, - "speculativeAuthenticate": { - "$$exists": false - } - } - } - }, - { - "commandSucceededEvent": { - "commandName": "ismaster", - "reply": { - "ismaster": { - "$$exists": false - }, - "speculativeAuthenticate": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "isMaster", - "command": { - "isMaster": { - "$$exists": false - }, - "speculativeAuthenticate": { - "$$exists": false - } - } - } - }, - { - "commandSucceededEvent": { - "commandName": "isMaster", - "reply": { - "ismaster": { - "$$exists": false - }, - "speculativeAuthenticate": { - "$$exists": false - } - } - } - } - ] - }, - { - "client": "client1", - "events": [] - }, - { - "client": "client2", - "events": [] - } - ] - }, - { - "description": "legacy hello without speculativeAuthenticate is always observed", - "operations": [ - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "ismaster", - "command": { - "ismaster": 1 - } - } - }, - { - "name": "runCommand", - "object": "database0", - "arguments": { - "commandName": "isMaster", - "command": { - "isMaster": 1 - } - } - }, - { - "name": "runCommand", - "object": "database1", - "arguments": { - "commandName": "ismaster", - "command": { - "ismaster": 1 - } - } - }, - { - "name": "runCommand", - "object": "database1", - "arguments": { - "commandName": "isMaster", - "command": { - "isMaster": 1 - } - } - }, - { - "name": "runCommand", - "object": "database2", - "arguments": { - "commandName": "ismaster", - "command": { - "ismaster": 1 - } - } - }, - { - "name": "runCommand", - "object": "database2", - "arguments": { - "commandName": "isMaster", - "command": { - "isMaster": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "commandName": "ismaster", - "command": { - "ismaster": 1 - } - } - }, - { - "commandSucceededEvent": { - "commandName": "ismaster", - "reply": { - "ismaster": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "isMaster", - "command": { - "isMaster": 1 - } - } - }, - { - "commandSucceededEvent": { - "commandName": "isMaster", - "reply": { - "ismaster": { - "$$exists": true - } - } - } - } - ] - }, - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "commandName": "ismaster", - "command": { - "ismaster": 1 - } - } - }, - { - "commandSucceededEvent": { - "commandName": "ismaster", - "reply": { - "ismaster": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "isMaster", - "command": { - "isMaster": 1 - } - } - }, - { - "commandSucceededEvent": { - "commandName": "isMaster", - "reply": { - "ismaster": { - "$$exists": true - } - } - } - } - ] - }, - { - "client": "client2", - "events": [ - { - "commandStartedEvent": { - "commandName": "ismaster", - "command": { - "ismaster": 1 - } - } - }, - { - "commandSucceededEvent": { - "commandName": "ismaster", - "reply": { - "ismaster": { - "$$exists": true - } - } - } - }, - { - "commandStartedEvent": { - "commandName": "isMaster", - "command": { - "isMaster": 1 - } - } - }, - { - "commandSucceededEvent": { - "commandName": "isMaster", - "reply": { - "ismaster": { - "$$exists": true - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-change-streams.json b/driver-core/src/test/resources/unified-test-format/valid-pass/poc-change-streams.json deleted file mode 100644 index 50f0d06f08d..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-change-streams.json +++ /dev/null @@ -1,455 +0,0 @@ -{ - "description": "poc-change-streams", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ], - "ignoreCommandMonitoringEvents": [ - "getMore", - "killCursors" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "change-stream-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "client": { - "id": "client1", - "useMultipleMongoses": false - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "change-stream-tests" - } - }, - { - "database": { - "id": "database2", - "client": "client1", - "databaseName": "change-stream-tests-2" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "collection": { - "id": "collection2", - "database": "database1", - "collectionName": "test2" - } - }, - { - "collection": { - "id": "collection3", - "database": "database2", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "change-stream-tests", - "documents": [] - }, - { - "collectionName": "test2", - "databaseName": "change-stream-tests", - "documents": [] - }, - { - "collectionName": "test", - "databaseName": "change-stream-tests-2", - "documents": [] - } - ], - "tests": [ - { - "description": "saveResultAsEntity is optional for createChangeStream", - "runOnRequirements": [ - { - "minServerVersion": "3.8.0", - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "client0", - "arguments": { - "pipeline": [] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1 - }, - "commandName": "aggregate", - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "Executing a watch helper on a MongoClient results in notifications for changes to all collections in all databases in the cluster.", - "runOnRequirements": [ - { - "minServerVersion": "3.8.0", - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "createChangeStream", - "object": "client0", - "arguments": { - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection2", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "insertOne", - "object": "collection3", - "arguments": { - "document": { - "y": 1 - } - } - }, - { - "name": "insertOne", - "object": "collection1", - "arguments": { - "document": { - "z": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "change-stream-tests", - "coll": "test2" - }, - "fullDocument": { - "_id": { - "$$type": "objectId" - }, - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "change-stream-tests-2", - "coll": "test" - }, - "fullDocument": { - "_id": { - "$$type": "objectId" - }, - "y": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "change-stream-tests", - "coll": "test" - }, - "fullDocument": { - "_id": { - "$$type": "objectId" - }, - "z": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "cursor": {}, - "pipeline": [ - { - "$changeStream": { - "allChangesForCluster": true, - "fullDocument": { - "$$unsetOrMatches": "default" - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "Test consecutive resume", - "runOnRequirements": [ - { - "minServerVersion": "4.1.7", - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "getMore" - ], - "closeConnection": true - } - } - } - }, - { - "name": "createChangeStream", - "object": "collection0", - "arguments": { - "batchSize": 1, - "pipeline": [] - }, - "saveResultAsEntity": "changeStream0" - }, - { - "name": "insertOne", - "object": "collection1", - "arguments": { - "document": { - "x": 1 - } - } - }, - { - "name": "insertOne", - "object": "collection1", - "arguments": { - "document": { - "x": 2 - } - } - }, - { - "name": "insertOne", - "object": "collection1", - "arguments": { - "document": { - "x": 3 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "change-stream-tests", - "coll": "test" - }, - "fullDocument": { - "_id": { - "$$type": "objectId" - }, - "x": 1 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "change-stream-tests", - "coll": "test" - }, - "fullDocument": { - "_id": { - "$$type": "objectId" - }, - "x": 2 - } - } - }, - { - "name": "iterateUntilDocumentOrError", - "object": "changeStream0", - "expectResult": { - "operationType": "insert", - "ns": { - "db": "change-stream-tests", - "coll": "test" - }, - "fullDocument": { - "_id": { - "$$type": "objectId" - }, - "x": 3 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "cursor": { - "batchSize": 1 - }, - "pipeline": [ - { - "$changeStream": { - "fullDocument": { - "$$unsetOrMatches": "default" - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "change-stream-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "cursor": { - "batchSize": 1 - }, - "pipeline": [ - { - "$changeStream": { - "fullDocument": { - "$$unsetOrMatches": "default" - }, - "resumeAfter": { - "$$exists": true - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "change-stream-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "cursor": { - "batchSize": 1 - }, - "pipeline": [ - { - "$changeStream": { - "fullDocument": { - "$$unsetOrMatches": "default" - }, - "resumeAfter": { - "$$exists": true - } - } - } - ] - }, - "commandName": "aggregate", - "databaseName": "change-stream-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-command-monitoring.json b/driver-core/src/test/resources/unified-test-format/valid-pass/poc-command-monitoring.json deleted file mode 100644 index b62f08a35e7..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-command-monitoring.json +++ /dev/null @@ -1,224 +0,0 @@ -{ - "description": "poc-command-monitoring", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent", - "commandSucceededEvent", - "commandFailedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "command-monitoring-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "command-monitoring-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "tests": [ - { - "description": "A successful find event with a getmore and the server kills the cursor (<= 4.4)", - "comment": "UPDATED final batchSize to 3 as batchSize is no longer calculated see: DRIVERS-1448 ", - "runOnRequirements": [ - { - "minServerVersion": "3.1", - "maxServerVersion": "4.4.99", - "topologies": [ - "single", - "replicaset" - ] - } - ], - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": { - "$gte": 1 - } - }, - "sort": { - "_id": 1 - }, - "batchSize": 3, - "limit": 4 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": { - "$gte": 1 - } - }, - "sort": { - "_id": 1 - }, - "batchSize": 3, - "limit": 4 - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "cursor": { - "id": { - "$$type": [ - "int", - "long" - ] - }, - "ns": "command-monitoring-tests.test", - "firstBatch": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - }, - "commandName": "find" - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "collection": "test", - "batchSize": 3 - }, - "commandName": "getMore", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandSucceededEvent": { - "reply": { - "ok": 1, - "cursor": { - "id": 0, - "ns": "command-monitoring-tests.test", - "nextBatch": [ - { - "_id": 4, - "x": 44 - } - ] - } - }, - "commandName": "getMore" - } - } - ] - } - ] - }, - { - "description": "A failed find event", - "operations": [ - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "$or": true - } - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "$or": true - } - }, - "commandName": "find", - "databaseName": "command-monitoring-tests" - } - }, - { - "commandFailedEvent": { - "commandName": "find" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-crud.json b/driver-core/src/test/resources/unified-test-format/valid-pass/poc-crud.json deleted file mode 100644 index 94e4ec56829..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-crud.json +++ /dev/null @@ -1,450 +0,0 @@ -{ - "description": "poc-crud", - "schemaVersion": "1.4", - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "crud-tests" - } - }, - { - "database": { - "id": "database1", - "client": "client0", - "databaseName": "admin" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - }, - { - "collection": { - "id": "collection1", - "database": "database0", - "collectionName": "coll1" - } - }, - { - "collection": { - "id": "collection2", - "database": "database0", - "collectionName": "coll2", - "collectionOptions": { - "readConcern": { - "level": "majority" - } - } - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - }, - { - "collectionName": "coll1", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - }, - { - "collectionName": "coll2", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - }, - { - "collectionName": "aggregate_out", - "databaseName": "crud-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "BulkWrite with mixed ordered operations", - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 3, - "x": 33 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "updateMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "insertOne": { - "document": { - "_id": 4, - "x": 44 - } - } - }, - { - "deleteMany": { - "filter": { - "x": { - "$nin": [ - 24, - 34 - ] - } - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 44 - }, - "upsert": true - } - } - ], - "ordered": true - }, - "expectResult": { - "deletedCount": 2, - "insertedCount": 2, - "insertedIds": { - "$$unsetOrMatches": { - "0": 3, - "3": 4 - } - }, - "matchedCount": 3, - "modifiedCount": 3, - "upsertedCount": 1, - "upsertedIds": { - "5": 4 - } - } - } - ], - "outcome": [ - { - "collectionName": "coll0", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 2, - "x": 24 - }, - { - "_id": 3, - "x": 34 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "InsertMany continue-on-error behavior with unordered (duplicate key in requests)", - "operations": [ - { - "name": "insertMany", - "object": "collection1", - "arguments": { - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ], - "ordered": false - }, - "expectError": { - "expectResult": { - "$$unsetOrMatches": { - "deletedCount": 0, - "insertedCount": 2, - "matchedCount": 0, - "modifiedCount": 0, - "upsertedCount": 0, - "upsertedIds": {} - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll1", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "ReplaceOne prohibits atomic modifiers", - "operations": [ - { - "name": "replaceOne", - "object": "collection1", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "$set": { - "x": 22 - } - } - }, - "expectError": { - "isClientError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [] - } - ], - "outcome": [ - { - "collectionName": "coll1", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 1, - "x": 11 - } - ] - } - ] - }, - { - "description": "readConcern majority with out stage", - "runOnRequirements": [ - { - "minServerVersion": "4.1.0", - "topologies": [ - "replicaset", - "sharded" - ], - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "aggregate", - "object": "collection2", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "aggregate_out" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll2", - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "aggregate_out" - } - ], - "readConcern": { - "level": "majority" - } - }, - "commandName": "aggregate", - "databaseName": "crud-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "aggregate_out", - "databaseName": "crud-tests", - "documents": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - }, - { - "description": "Aggregate with $listLocalSessions", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0", - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "aggregate", - "object": "database1", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - }, - { - "$addFields": { - "dummy": "dummy field" - } - }, - { - "$project": { - "_id": 0, - "dummy": 1 - } - } - ] - }, - "expectResult": [ - { - "dummy": "dummy field" - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-gridfs.json b/driver-core/src/test/resources/unified-test-format/valid-pass/poc-gridfs.json deleted file mode 100644 index 1f07a19bf6e..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-gridfs.json +++ /dev/null @@ -1,301 +0,0 @@ -{ - "description": "poc-gridfs", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "gridfs-tests" - } - }, - { - "bucket": { - "id": "bucket0", - "database": "database0" - } - }, - { - "collection": { - "id": "bucket0_files_collection", - "database": "database0", - "collectionName": "fs.files" - } - }, - { - "collection": { - "id": "bucket0_chunks_collection", - "database": "database0", - "collectionName": "fs.chunks" - } - } - ], - "initialData": [ - { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000005" - }, - "length": 10, - "chunkSize": 4, - "uploadDate": { - "$date": "1970-01-01T00:00:00.000Z" - }, - "md5": "57d83cd477bfb1ccd975ab33d827a92b", - "filename": "length-10", - "contentType": "application/octet-stream", - "aliases": [], - "metadata": {} - } - ] - }, - { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [ - { - "_id": { - "$oid": "000000000000000000000005" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000006" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 1, - "data": { - "$binary": { - "base64": "VWZ3iA==", - "subType": "00" - } - } - }, - { - "_id": { - "$oid": "000000000000000000000007" - }, - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 2, - "data": { - "$binary": { - "base64": "mao=", - "subType": "00" - } - } - } - ] - } - ], - "tests": [ - { - "description": "Delete when length is 10", - "operations": [ - { - "name": "delete", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - } - } - ], - "outcome": [ - { - "collectionName": "fs.files", - "databaseName": "gridfs-tests", - "documents": [] - }, - { - "collectionName": "fs.chunks", - "databaseName": "gridfs-tests", - "documents": [] - } - ] - }, - { - "description": "Download when there are three chunks", - "operations": [ - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectResult": { - "$$matchesHexBytes": "112233445566778899aa" - } - } - ] - }, - { - "description": "Download when files entry does not exist", - "operations": [ - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000000" - } - }, - "expectError": { - "isError": true - } - } - ] - }, - { - "description": "Download when an intermediate chunk is missing", - "operations": [ - { - "name": "deleteOne", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": { - "files_id": { - "$oid": "000000000000000000000005" - }, - "n": 1 - } - }, - "expectResult": { - "deletedCount": 1 - } - }, - { - "name": "download", - "object": "bucket0", - "arguments": { - "id": { - "$oid": "000000000000000000000005" - } - }, - "expectError": { - "isError": true - } - } - ] - }, - { - "description": "Upload when length is 5", - "operations": [ - { - "name": "upload", - "object": "bucket0", - "arguments": { - "filename": "filename", - "source": { - "$$hexBytes": "1122334455" - }, - "chunkSizeBytes": 4 - }, - "expectResult": { - "$$type": "objectId" - }, - "saveResultAsEntity": "oid0" - }, - { - "name": "find", - "object": "bucket0_files_collection", - "arguments": { - "filter": {}, - "sort": { - "uploadDate": -1 - }, - "limit": 1 - }, - "expectResult": [ - { - "_id": { - "$$matchesEntity": "oid0" - }, - "length": 5, - "chunkSize": 4, - "uploadDate": { - "$$type": "date" - }, - "md5": { - "$$unsetOrMatches": "283d4fea5dded59cf837d3047328f5af" - }, - "filename": "filename" - } - ] - }, - { - "name": "find", - "object": "bucket0_chunks_collection", - "arguments": { - "filter": { - "_id": { - "$gt": { - "$oid": "000000000000000000000007" - } - } - }, - "sort": { - "n": 1 - } - }, - "expectResult": [ - { - "_id": { - "$$type": "objectId" - }, - "files_id": { - "$$matchesEntity": "oid0" - }, - "n": 0, - "data": { - "$binary": { - "base64": "ESIzRA==", - "subType": "00" - } - } - }, - { - "_id": { - "$$type": "objectId" - }, - "files_id": { - "$$matchesEntity": "oid0" - }, - "n": 1, - "data": { - "$binary": { - "base64": "VQ==", - "subType": "00" - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-retryable-reads.json b/driver-core/src/test/resources/unified-test-format/valid-pass/poc-retryable-reads.json deleted file mode 100644 index 2b65d501a78..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-retryable-reads.json +++ /dev/null @@ -1,433 +0,0 @@ -{ - "description": "poc-retryable-reads", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "single", - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "client": { - "id": "client1", - "uriOptions": { - "retryReads": false - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-reads-tests" - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-reads-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-reads-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "tests": [ - { - "description": "Aggregate succeeds after InterruptedAtShutdown", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "aggregate" - ], - "errorCode": 11600 - } - } - } - }, - { - "name": "aggregate", - "object": "collection0", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "expectResult": [ - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$sort": { - "x": 1 - } - } - ] - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find succeeds on second attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 2 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 2 - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {}, - "sort": { - "_id": 1 - }, - "limit": 2 - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find fails on first attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "name": "find", - "object": "collection1", - "arguments": { - "filter": {} - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {} - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "Find fails on second attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "find" - ], - "closeConnection": true - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": {} - }, - "expectError": { - "isError": true - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {} - }, - "databaseName": "retryable-reads-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "coll", - "filter": {} - }, - "databaseName": "retryable-reads-tests" - } - } - ] - } - ] - }, - { - "description": "ListDatabases succeeds on second attempt", - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "listDatabases" - ], - "closeConnection": true - } - } - } - }, - { - "name": "listDatabases", - "object": "client0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - }, - { - "commandStartedEvent": { - "command": { - "listDatabases": 1 - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-retryable-writes.json b/driver-core/src/test/resources/unified-test-format/valid-pass/poc-retryable-writes.json deleted file mode 100644 index f19aa3f9d87..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-retryable-writes.json +++ /dev/null @@ -1,491 +0,0 @@ -{ - "description": "poc-retryable-writes", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "client": { - "id": "client1", - "uriOptions": { - "retryWrites": false - }, - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "retryable-writes-tests" - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "retryable-writes-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "coll" - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "FindOneAndUpdate is committed on first attempt", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate is not committed on first attempt", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 1 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectResult": { - "_id": 1, - "x": 11 - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 12 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "FindOneAndUpdate is never committed", - "runOnRequirements": [ - { - "minServerVersion": "3.6", - "topologies": [ - "replicaset" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "onPrimaryTransactionalWrite", - "mode": { - "times": 2 - }, - "data": { - "failBeforeCommitExceptionCode": 1 - } - } - } - }, - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "returnDocument": "Before" - }, - "expectError": { - "isError": true - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "InsertMany succeeds after PrimarySteppedDown", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 189, - "errorLabels": [ - "RetryableWriteError" - ] - } - } - } - }, - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "documents": [ - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ], - "ordered": true - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedIds": { - "$$unsetOrMatches": { - "0": 3, - "1": 4 - } - } - } - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - } - ] - } - ] - }, - { - "description": "InsertOne fails after connection failure when retryWrites option is false", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.7", - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client1", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "name": "insertOne", - "object": "collection1", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "errorLabelsOmit": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "InsertOne fails after multiple retryable writeConcernErrors", - "runOnRequirements": [ - { - "minServerVersion": "4.3.1", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 2 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorLabels": [ - "RetryableWriteError" - ], - "writeConcernError": { - "code": 91, - "errmsg": "Replication is being shut down" - } - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3, - "x": 33 - } - }, - "expectError": { - "errorLabelsContain": [ - "RetryableWriteError" - ] - } - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "retryable-writes-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-sessions.json b/driver-core/src/test/resources/unified-test-format/valid-pass/poc-sessions.json deleted file mode 100644 index 117c9e7d009..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-sessions.json +++ /dev/null @@ -1,466 +0,0 @@ -{ - "description": "poc-sessions", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.6.0" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": false, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "session-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ], - "tests": [ - { - "description": "Server supports explicit sessions", - "operations": [ - { - "name": "assertSessionNotDirty", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "name": "assertSessionNotDirty", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "endSession", - "object": "session0" - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": -1 - } - }, - "expectResult": [] - }, - { - "name": "assertSameLsidOnLastTwoCommands", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - } - }, - "commandName": "insert", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": -1 - }, - "lsid": { - "$$sessionLsid": "session0" - } - }, - "commandName": "find", - "databaseName": "session-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "Server supports implicit sessions", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": -1 - } - }, - "expectResult": [] - }, - { - "name": "assertSameLsidOnLastTwoCommands", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$type": "object" - } - }, - "commandName": "insert", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": -1 - }, - "lsid": { - "$$type": "object" - } - }, - "commandName": "find", - "databaseName": "session-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "Dirty explicit session is discarded", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded" - ] - } - ], - "operations": [ - { - "name": "failPoint", - "object": "testRunner", - "arguments": { - "client": "client0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "name": "assertSessionNotDirty", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 2 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 2 - } - } - } - }, - { - "name": "assertSessionDirty", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "assertSessionDirty", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "endSession", - "object": "session0" - }, - { - "name": "find", - "object": "collection0", - "arguments": { - "filter": { - "_id": -1 - } - }, - "expectResult": [] - }, - { - "name": "assertDifferentLsidOnLastTwoCommands", - "object": "testRunner", - "arguments": { - "client": "client0" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1 - }, - "commandName": "insert", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 2 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1 - }, - "commandName": "insert", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 3 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 2 - }, - "commandName": "insert", - "databaseName": "session-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "find": "test", - "filter": { - "_id": -1 - }, - "lsid": { - "$$type": "object" - } - }, - "commandName": "find", - "databaseName": "session-tests" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "session-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-transactions-convenient-api.json b/driver-core/src/test/resources/unified-test-format/valid-pass/poc-transactions-convenient-api.json deleted file mode 100644 index 9ab44a9c548..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-transactions-convenient-api.json +++ /dev/null @@ -1,505 +0,0 @@ -{ - "description": "poc-transactions-convenient-api", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "client": { - "id": "client1", - "uriOptions": { - "readConcernLevel": "local", - "w": 1 - }, - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "database": { - "id": "database1", - "client": "client1", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "collection": { - "id": "collection1", - "database": "database1", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - }, - { - "session": { - "id": "session1", - "client": "client1" - } - }, - { - "session": { - "id": "session2", - "client": "client0", - "sessionOptions": { - "defaultTransactionOptions": { - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "w": 1 - } - } - } - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "withTransaction and no transaction options set", - "operations": [ - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "autocommit": false, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "withTransaction inherits transaction options from client", - "operations": [ - { - "name": "withTransaction", - "object": "session1", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection1", - "arguments": { - "session": "session1", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client1", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": 1, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "local" - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session1" - }, - "txnNumber": 1, - "autocommit": false, - "writeConcern": { - "w": 1 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "withTransaction inherits transaction options from defaultTransactionOptions", - "operations": [ - { - "name": "withTransaction", - "object": "session2", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session2", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session2" - }, - "txnNumber": 1, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session2" - }, - "txnNumber": 1, - "autocommit": false, - "writeConcern": { - "w": 1 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - }, - { - "description": "withTransaction explicit transaction options", - "operations": [ - { - "name": "withTransaction", - "object": "session0", - "arguments": { - "callback": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 1 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 1 - } - } - } - } - ], - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "w": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 1 - } - ], - "ordered": true, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": true, - "autocommit": false, - "readConcern": { - "level": "majority" - }, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "autocommit": false, - "writeConcern": { - "w": 1 - }, - "readConcern": { - "$$exists": false - }, - "startTransaction": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-transactions-mongos-pin-auto.json b/driver-core/src/test/resources/unified-test-format/valid-pass/poc-transactions-mongos-pin-auto.json deleted file mode 100644 index de08edec442..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-transactions-mongos-pin-auto.json +++ /dev/null @@ -1,409 +0,0 @@ -{ - "description": "poc-transactions-mongos-pin-auto", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "useMultipleMongoses": true, - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ], - "tests": [ - { - "description": "remain pinned after non-transient Interrupted error on insertOne", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "errorCode": 11601 - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 4 - } - }, - "expectError": { - "errorLabelsOmit": [ - "TransientTransactionError", - "UnknownTransactionCommitResult" - ], - "errorCodeName": "Interrupted" - } - }, - { - "name": "assertSessionPinned", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "commitTransaction", - "object": "session0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 3 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 4 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - }, - "recoveryToken": { - "$$type": "object" - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - }, - { - "_id": 3 - } - ] - } - ] - }, - { - "description": "unpin after transient error within a transaction", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 3 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 3 - } - } - } - }, - { - "name": "targetedFailPoint", - "object": "testRunner", - "arguments": { - "session": "session0", - "failPoint": { - "configureFailPoint": "failCommand", - "mode": { - "times": 1 - }, - "data": { - "failCommands": [ - "insert" - ], - "closeConnection": true - } - } - } - }, - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "session": "session0", - "document": { - "_id": 4 - } - }, - "expectError": { - "errorLabelsContain": [ - "TransientTransactionError" - ], - "errorLabelsOmit": [ - "UnknownTransactionCommitResult" - ] - } - }, - { - "name": "assertSessionUnpinned", - "object": "testRunner", - "arguments": { - "session": "session0" - } - }, - { - "name": "abortTransaction", - "object": "session0" - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 3 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 4 - } - ], - "ordered": true, - "readConcern": { - "$$exists": false - }, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "insert", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - }, - "recoveryToken": { - "$$type": "object" - } - }, - "commandName": "abortTransaction", - "databaseName": "admin" - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [ - { - "_id": 1 - }, - { - "_id": 2 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-transactions.json b/driver-core/src/test/resources/unified-test-format/valid-pass/poc-transactions.json deleted file mode 100644 index 2055a3b7057..00000000000 --- a/driver-core/src/test/resources/unified-test-format/valid-pass/poc-transactions.json +++ /dev/null @@ -1,323 +0,0 @@ -{ - "description": "poc-transactions", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.0", - "topologies": [ - "replicaset" - ] - }, - { - "minServerVersion": "4.1.8", - "topologies": [ - "sharded" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "transaction-tests" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "test" - } - }, - { - "session": { - "id": "session0", - "client": "client0" - } - } - ], - "initialData": [ - { - "collectionName": "test", - "databaseName": "transaction-tests", - "documents": [] - } - ], - "tests": [ - { - "description": "Client side error in command starting transaction", - "operations": [ - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "session": "session0", - "filter": { - "_id": 1 - }, - "update": { - "x": 1 - } - }, - "expectError": { - "isClientError": true - } - }, - { - "name": "assertSessionTransactionState", - "object": "testRunner", - "arguments": { - "session": "session0", - "state": "starting" - } - } - ] - }, - { - "description": "explicitly create collection using create command", - "runOnRequirements": [ - { - "minServerVersion": "4.3.4", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "test" - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "createCollection", - "object": "database0", - "arguments": { - "session": "session0", - "collection": "test" - } - }, - { - "name": "assertCollectionNotExists", - "object": "testRunner", - "arguments": { - "databaseName": "transaction-tests", - "collectionName": "test" - } - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "assertCollectionExists", - "object": "testRunner", - "arguments": { - "databaseName": "transaction-tests", - "collectionName": "test" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test", - "writeConcern": { - "$$exists": false - } - }, - "commandName": "drop", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "create": "test", - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "create", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - }, - { - "description": "create index on a non-existing collection", - "runOnRequirements": [ - { - "minServerVersion": "4.3.4", - "topologies": [ - "replicaset", - "sharded" - ] - } - ], - "operations": [ - { - "name": "dropCollection", - "object": "database0", - "arguments": { - "collection": "test" - } - }, - { - "name": "startTransaction", - "object": "session0" - }, - { - "name": "createIndex", - "object": "collection0", - "arguments": { - "session": "session0", - "name": "x_1", - "keys": { - "x": 1 - } - } - }, - { - "name": "assertIndexNotExists", - "object": "testRunner", - "arguments": { - "databaseName": "transaction-tests", - "collectionName": "test", - "indexName": "x_1" - } - }, - { - "name": "commitTransaction", - "object": "session0" - }, - { - "name": "assertIndexExists", - "object": "testRunner", - "arguments": { - "databaseName": "transaction-tests", - "collectionName": "test", - "indexName": "x_1" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "drop": "test", - "writeConcern": { - "$$exists": false - } - }, - "commandName": "drop", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "createIndexes": "test", - "indexes": [ - { - "name": "x_1", - "key": { - "x": 1 - } - } - ], - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": true, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "createIndexes", - "databaseName": "transaction-tests" - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session0" - }, - "txnNumber": 1, - "startTransaction": { - "$$exists": false - }, - "autocommit": false, - "writeConcern": { - "$$exists": false - } - }, - "commandName": "commitTransaction", - "databaseName": "admin" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-2.6.json b/driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-2.6.json deleted file mode 100644 index 0d8f9c98a18..00000000000 --- a/driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-2.6.json +++ /dev/null @@ -1,636 +0,0 @@ -{ - "description": "default-write-concern-2.6", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "2.6" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "default-write-concern-tests", - "databaseOptions": { - "writeConcern": {} - } - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll", - "collectionOptions": { - "writeConcern": {} - } - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "default-write-concern-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "DeleteOne omits default write concern", - "operations": [ - { - "name": "deleteOne", - "object": "collection0", - "arguments": { - "filter": {} - }, - "expectResult": { - "deletedCount": 1 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll", - "deletes": [ - { - "q": {}, - "limit": 1 - } - ], - "writeConcern": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "DeleteMany omits default write concern", - "operations": [ - { - "name": "deleteMany", - "object": "collection0", - "arguments": { - "filter": {} - }, - "expectResult": { - "deletedCount": 2 - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll", - "deletes": [ - { - "q": {}, - "limit": 0 - } - ], - "writeConcern": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "BulkWrite with all models omits default write concern", - "operations": [ - { - "name": "bulkWrite", - "object": "collection0", - "arguments": { - "ordered": true, - "requests": [ - { - "deleteMany": { - "filter": {} - } - }, - { - "insertOne": { - "document": { - "_id": 1 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "insertOne": { - "document": { - "_id": 2 - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 2 - } - } - }, - { - "insertOne": { - "document": { - "_id": 3 - } - } - }, - { - "updateMany": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 3 - } - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 3 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll", - "deletes": [ - { - "q": {}, - "limit": 0 - } - ], - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 1 - } - ], - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "coll", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 1 - } - }, - "upsert": { - "$$unsetOrMatches": false - }, - "multi": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 2 - } - ], - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "coll", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "x": 2 - }, - "upsert": { - "$$unsetOrMatches": false - }, - "multi": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3 - } - ], - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "coll", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 3 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "coll", - "deletes": [ - { - "q": { - "_id": 3 - }, - "limit": 1 - } - ], - "writeConcern": { - "$$exists": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "default-write-concern-tests", - "documents": [ - { - "_id": 1, - "x": 3 - }, - { - "_id": 2 - } - ] - } - ] - }, - { - "description": "InsertOne and InsertMany omit default write concern", - "operations": [ - { - "name": "insertOne", - "object": "collection0", - "arguments": { - "document": { - "_id": 3 - } - } - }, - { - "name": "insertMany", - "object": "collection0", - "arguments": { - "documents": [ - { - "_id": 4 - }, - { - "_id": 5 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 3 - } - ], - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "coll", - "documents": [ - { - "_id": 4 - }, - { - "_id": 5 - } - ], - "writeConcern": { - "$$exists": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "default-write-concern-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3 - }, - { - "_id": 4 - }, - { - "_id": 5 - } - ] - } - ] - }, - { - "description": "UpdateOne, UpdateMany, and ReplaceOne omit default write concern", - "operations": [ - { - "name": "updateOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "name": "updateMany", - "object": "collection0", - "arguments": { - "filter": { - "_id": 2 - }, - "update": { - "$set": { - "x": 2 - } - } - } - }, - { - "name": "replaceOne", - "object": "collection0", - "arguments": { - "filter": { - "_id": 2 - }, - "replacement": { - "x": 3 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "coll", - "updates": [ - { - "q": { - "_id": 1 - }, - "u": { - "$set": { - "x": 1 - } - }, - "upsert": { - "$$unsetOrMatches": false - }, - "multi": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "coll", - "updates": [ - { - "q": { - "_id": 2 - }, - "u": { - "$set": { - "x": 2 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "coll", - "updates": [ - { - "q": { - "_id": 2 - }, - "u": { - "x": 3 - }, - "upsert": { - "$$unsetOrMatches": false - }, - "multi": { - "$$unsetOrMatches": false - } - } - ], - "writeConcern": { - "$$exists": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "default-write-concern-tests", - "documents": [ - { - "_id": 1, - "x": 1 - }, - { - "_id": 2, - "x": 3 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-3.2.json b/driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-3.2.json deleted file mode 100644 index 166a1849168..00000000000 --- a/driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-3.2.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "description": "default-write-concern-3.2", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "3.2" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "default-write-concern-tests", - "databaseOptions": { - "writeConcern": {} - } - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll", - "collectionOptions": { - "writeConcern": {} - } - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "default-write-concern-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "findAndModify operations omit default write concern", - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection0", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - } - } - }, - { - "name": "findOneAndReplace", - "object": "collection0", - "arguments": { - "filter": { - "_id": 2 - }, - "replacement": { - "x": 2 - } - } - }, - { - "name": "findOneAndDelete", - "object": "collection0", - "arguments": { - "filter": { - "_id": 2 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll", - "query": { - "_id": 1 - }, - "update": { - "$set": { - "x": 1 - } - }, - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll", - "query": { - "_id": 2 - }, - "update": { - "x": 2 - }, - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "findAndModify": "coll", - "query": { - "_id": 2 - }, - "remove": true, - "writeConcern": { - "$$exists": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "coll", - "databaseName": "default-write-concern-tests", - "documents": [ - { - "_id": 1, - "x": 1 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-3.4.json b/driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-3.4.json deleted file mode 100644 index e18cdfc0c44..00000000000 --- a/driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-3.4.json +++ /dev/null @@ -1,278 +0,0 @@ -{ - "description": "default-write-concern-3.4", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "3.4" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "default-write-concern-tests", - "databaseOptions": { - "writeConcern": {} - } - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll", - "collectionOptions": { - "writeConcern": {} - } - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "default-write-concern-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Aggregate with $out omits default write concern", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_collection_name" - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$out": "other_collection_name" - } - ], - "writeConcern": { - "$$exists": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "other_collection_name", - "databaseName": "default-write-concern-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - }, - { - "description": "RunCommand with a write command omits default write concern (runCommand should never inherit write concern)", - "operations": [ - { - "object": "database0", - "name": "runCommand", - "arguments": { - "command": { - "delete": "coll", - "deletes": [ - { - "q": {}, - "limit": 1 - } - ] - }, - "commandName": "delete" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "coll", - "deletes": [ - { - "q": {}, - "limit": 1 - } - ], - "writeConcern": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "CreateIndex and dropIndex omits default write concern", - "operations": [ - { - "object": "collection0", - "name": "createIndex", - "arguments": { - "keys": { - "x": 1 - } - } - }, - { - "object": "collection0", - "name": "dropIndex", - "arguments": { - "name": "x_1" - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "createIndexes": "coll", - "indexes": [ - { - "name": "x_1", - "key": { - "x": 1 - } - } - ], - "writeConcern": { - "$$exists": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "dropIndexes": "coll", - "index": "x_1", - "writeConcern": { - "$$exists": false - } - } - } - } - ] - } - ] - }, - { - "description": "MapReduce omits default write concern", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "mapReduce", - "object": "collection0", - "arguments": { - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "mapReduce": "coll", - "map": { - "$code": "function inc() { return emit(0, this.x + 1) }" - }, - "reduce": { - "$code": "function sum(key, values) { return values.reduce((acc, x) => acc + x); }" - }, - "out": { - "inline": 1 - }, - "writeConcern": { - "$$exists": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-4.2.json b/driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-4.2.json deleted file mode 100644 index e8bb78d91dc..00000000000 --- a/driver-core/src/test/resources/unified-test-format/write-concern/default-write-concern-4.2.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "description": "default-write-concern-4.2", - "schemaVersion": "1.0", - "runOnRequirements": [ - { - "minServerVersion": "4.2" - } - ], - "createEntities": [ - { - "client": { - "id": "client0", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "default-write-concern-tests", - "databaseOptions": { - "writeConcern": {} - } - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll", - "collectionOptions": { - "writeConcern": {} - } - } - } - ], - "initialData": [ - { - "collectionName": "coll", - "databaseName": "default-write-concern-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - } - ] - } - ], - "tests": [ - { - "description": "Aggregate with $merge omits default write concern", - "operations": [ - { - "object": "collection0", - "name": "aggregate", - "arguments": { - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$merge": { - "into": "other_collection_name" - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client0", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "coll", - "pipeline": [ - { - "$match": { - "_id": { - "$gt": 1 - } - } - }, - { - "$merge": { - "into": "other_collection_name" - } - } - ], - "writeConcern": { - "$$exists": false - } - } - } - } - ] - } - ], - "outcome": [ - { - "collectionName": "other_collection_name", - "databaseName": "default-write-concern-tests", - "documents": [ - { - "_id": 2, - "x": 22 - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/uri-options/README.rst b/driver-core/src/test/resources/uri-options/README.rst deleted file mode 100644 index b1b4877cd64..00000000000 --- a/driver-core/src/test/resources/uri-options/README.rst +++ /dev/null @@ -1,52 +0,0 @@ -======================= -URI Options Tests -======================= - -The YAML and JSON files in this directory tree are platform-independent tests -that drivers can use to prove their conformance to the URI Options spec. - -These tests use the same format as the Connection String spec tests. - -Version -------- - -Files in the "specifications" repository have no version scheme. They are not -tied to a MongoDB server version. - -Format ------- - -Each YAML file contains an object with a single ``tests`` key. This key is an -array of test case objects, each of which have the following keys: - -- ``description``: A string describing the test. -- ``uri``: A string containing the URI to be parsed. -- ``valid``: A boolean indicating if the URI should be considered valid. - This will always be true, as the Connection String spec tests the validity of the structure, but - it's still included to make it easier to reuse the connection string spec test runners that - drivers already have. -- ``warning``: A boolean indicating whether URI parsing should emit a warning. -- ``hosts``: Included for compatibility with the Connection String spec tests. This will always be ``~``. -- ``auth``: Included for compatibility with the Connection String spec tests. This will always be ``~``. -- ``options``: An object containing key/value pairs for each parsed query string - option. - -If a test case includes a null value for one of these keys (e.g. ``auth: ~``, -``hosts: ~``), no assertion is necessary. This both simplifies parsing of the -test files (keys should always exist) and allows flexibility for drivers that -might substitute default values *during* parsing (e.g. omitted ``hosts`` could be -parsed as ``["localhost"]``). - -The ``valid`` and ``warning`` fields are boolean in order to keep the tests -flexible. We are not concerned with asserting the format of specific error or -warnings messages strings. - -Use as unit tests -================= - -Testing whether a URI is valid or not requires testing whether URI parsing (or -MongoClient construction) causes a warning due to a URI option being invalid and asserting that the -options parsed from the URI match those listed in the ``options`` field. - -Note that there are tests for each of the options marked as optional; drivers will need to implement -logic to skip over the optional tests that they don’t implement. diff --git a/driver-core/src/test/resources/uri-options/auth-options.json b/driver-core/src/test/resources/uri-options/auth-options.json deleted file mode 100644 index fadbac35d23..00000000000 --- a/driver-core/src/test/resources/uri-options/auth-options.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "tests": [ - { - "description": "Valid auth options are parsed correctly (GSSAPI)", - "uri": "mongodb://foo:bar@example.com/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true&authSource=$external", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "authMechanism": "GSSAPI", - "authMechanismProperties": { - "SERVICE_NAME": "other", - "CANONICALIZE_HOST_NAME": true - }, - "authSource": "$external" - } - }, - { - "description": "Valid auth options are parsed correctly (SCRAM-SHA-1)", - "uri": "mongodb://foo:bar@example.com/?authMechanism=SCRAM-SHA-1&authSource=authSourceDB", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "authMechanism": "SCRAM-SHA-1", - "authSource": "authSourceDB" - } - } - ] -} diff --git a/driver-core/src/test/resources/uri-options/compression-options.json b/driver-core/src/test/resources/uri-options/compression-options.json deleted file mode 100644 index c3297b254ba..00000000000 --- a/driver-core/src/test/resources/uri-options/compression-options.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "tests": [ - { - "description": "Valid compression options are parsed correctly", - "uri": "mongodb://example.com/?compressors=zlib&zlibCompressionLevel=9", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "compressors": [ - "zlib" - ], - "zlibCompressionLevel": 9 - } - }, - { - "description": "Multiple compressors are parsed correctly", - "uri": "mongodb://example.com/?compressors=snappy,zlib", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": { - "compressors": [ - "snappy", - "zlib" - ] - } - }, - { - "description": "Non-numeric zlibCompressionLevel causes a warning", - "uri": "mongodb://example.com/?compressors=zlib&zlibCompressionLevel=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Too low zlibCompressionLevel causes a warning", - "uri": "mongodb://example.com/?compressors=zlib&zlibCompressionLevel=-2", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Too high zlibCompressionLevel causes a warning", - "uri": "mongodb://example.com/?compressors=zlib&zlibCompressionLevel=10", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - } - ] -} diff --git a/driver-core/src/test/resources/uri-options/concern-options.json b/driver-core/src/test/resources/uri-options/concern-options.json deleted file mode 100644 index 2b3783746c3..00000000000 --- a/driver-core/src/test/resources/uri-options/concern-options.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "tests": [ - { - "description": "Valid read and write concern are parsed correctly", - "uri": "mongodb://example.com/?readConcernLevel=majority&w=5&wTimeoutMS=30000&journal=false", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "readConcernLevel": "majority", - "w": 5, - "wTimeoutMS": 30000, - "journal": false - } - }, - { - "description": "Arbitrary string readConcernLevel does not cause a warning", - "uri": "mongodb://example.com/?readConcernLevel=arbitraryButStillValid", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "readConcernLevel": "arbitraryButStillValid" - } - }, - { - "description": "Arbitrary string w doesn't cause a warning", - "uri": "mongodb://example.com/?w=arbitraryButStillValid", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "w": "arbitraryButStillValid" - } - }, - { - "description": "Too low w causes a warning", - "uri": "mongodb://example.com/?w=-2", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Non-numeric wTimeoutMS causes a warning", - "uri": "mongodb://example.com/?wTimeoutMS=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Too low wTimeoutMS causes a warning", - "uri": "mongodb://example.com/?wTimeoutMS=-2", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Invalid journal causes a warning", - "uri": "mongodb://example.com/?journal=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - } - ] -} diff --git a/driver-core/src/test/resources/uri-options/connection-options.json b/driver-core/src/test/resources/uri-options/connection-options.json deleted file mode 100644 index 8bb05cc7216..00000000000 --- a/driver-core/src/test/resources/uri-options/connection-options.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "tests": [ - { - "description": "Valid connection and timeout options are parsed correctly", - "uri": "mongodb://example.com/?appname=URI-OPTIONS-SPEC-TEST&connectTimeoutMS=20000&heartbeatFrequencyMS=5000&localThresholdMS=3000&maxIdleTimeMS=50000&replicaSet=uri-options-spec&retryWrites=true&serverSelectionTimeoutMS=15000&socketTimeoutMS=7500", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "appname": "URI-OPTIONS-SPEC-TEST", - "connectTimeoutMS": 20000, - "heartbeatFrequencyMS": 5000, - "localThresholdMS": 3000, - "maxIdleTimeMS": 50000, - "replicaSet": "uri-options-spec", - "retryWrites": true, - "serverSelectionTimeoutMS": 15000, - "socketTimeoutMS": 7500 - } - }, - { - "description": "Non-numeric connectTimeoutMS causes a warning", - "uri": "mongodb://example.com/?connectTimeoutMS=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Too low connectTimeoutMS causes a warning", - "uri": "mongodb://example.com/?connectTimeoutMS=-2", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Non-numeric heartbeatFrequencyMS causes a warning", - "uri": "mongodb://example.com/?heartbeatFrequencyMS=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Too low heartbeatFrequencyMS causes a warning", - "uri": "mongodb://example.com/?heartbeatFrequencyMS=-2", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Non-numeric localThresholdMS causes a warning", - "uri": "mongodb://example.com/?localThresholdMS=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Too low localThresholdMS causes a warning", - "uri": "mongodb://example.com/?localThresholdMS=-2", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Invalid retryWrites causes a warning", - "uri": "mongodb://example.com/?retryWrites=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Non-numeric serverSelectionTimeoutMS causes a warning", - "uri": "mongodb://example.com/?serverSelectionTimeoutMS=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Too low serverSelectionTimeoutMS causes a warning", - "uri": "mongodb://example.com/?serverSelectionTimeoutMS=-2", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Non-numeric socketTimeoutMS causes a warning", - "uri": "mongodb://example.com/?socketTimeoutMS=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Too low socketTimeoutMS causes a warning", - "uri": "mongodb://example.com/?socketTimeoutMS=-2", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "directConnection=true", - "uri": "mongodb://example.com/?directConnection=true", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "directConnection": true - } - }, - { - "description": "directConnection=true with multiple seeds", - "uri": "mongodb://example1.com,example2.com/?directConnection=true", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "directConnection=false", - "uri": "mongodb://example.com/?directConnection=false", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "directConnection": false - } - }, - { - "description": "directConnection=false with multiple seeds", - "uri": "mongodb://example1.com,example2.com/?directConnection=false", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "directConnection": false - } - }, - { - "description": "Invalid directConnection value", - "uri": "mongodb://example.com/?directConnection=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "loadBalanced=true", - "uri": "mongodb://example.com/?loadBalanced=true", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "loadBalanced": true - } - }, - { - "description": "loadBalanced=true with directConnection=false", - "uri": "mongodb://example.com/?loadBalanced=true&directConnection=false", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "loadBalanced": true, - "directConnection": false - } - }, - { - "description": "loadBalanced=false", - "uri": "mongodb://example.com/?loadBalanced=false", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "loadBalanced": false - } - }, - { - "description": "Invalid loadBalanced value", - "uri": "mongodb://example.com/?loadBalanced=1", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "loadBalanced=true with multiple hosts causes an error", - "uri": "mongodb://example1,example2/?loadBalanced=true", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "loadBalanced=true with directConnection=true causes an error", - "uri": "mongodb://example.com/?loadBalanced=true&directConnection=true", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "loadBalanced=true with replicaSet causes an error", - "uri": "mongodb://example.com/?loadBalanced=true&replicaSet=replset", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - } - ] -} diff --git a/driver-core/src/test/resources/uri-options/connection-pool-options.json b/driver-core/src/test/resources/uri-options/connection-pool-options.json deleted file mode 100644 index 118b2f6783d..00000000000 --- a/driver-core/src/test/resources/uri-options/connection-pool-options.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "tests": [ - { - "description": "Valid connection pool options are parsed correctly", - "uri": "mongodb://example.com/?maxIdleTimeMS=50000&maxPoolSize=5&minPoolSize=3&maxConnecting=1", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "maxIdleTimeMS": 50000, - "maxPoolSize": 5, - "minPoolSize": 3, - "maxConnecting": 1 - } - }, - { - "description": "Non-numeric maxIdleTimeMS causes a warning", - "uri": "mongodb://example.com/?maxIdleTimeMS=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Too low maxIdleTimeMS causes a warning", - "uri": "mongodb://example.com/?maxIdleTimeMS=-2", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "maxPoolSize=0 does not error", - "uri": "mongodb://example.com/?maxPoolSize=0", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "maxPoolSize": 0 - } - }, - { - "description": "minPoolSize=0 does not error", - "uri": "mongodb://example.com/?minPoolSize=0", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "minPoolSize": 0 - } - }, - { - "description": "maxConnecting=0 causes a warning", - "uri": "mongodb://example.com/?maxConnecting=0", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "maxConnecting<0 causes a warning", - "uri": "mongodb://example.com/?maxConnecting=-1", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - } - ] -} diff --git a/driver-core/src/test/resources/uri-options/read-preference-options.json b/driver-core/src/test/resources/uri-options/read-preference-options.json deleted file mode 100644 index cdac6a63c33..00000000000 --- a/driver-core/src/test/resources/uri-options/read-preference-options.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "tests": [ - { - "description": "Valid read preference options are parsed correctly", - "uri": "mongodb://example.com/?readPreference=primaryPreferred&readPreferenceTags=dc:ny,rack:1&maxStalenessSeconds=120&readPreferenceTags=dc:ny", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "readPreference": "primaryPreferred", - "readPreferenceTags": [ - { - "dc": "ny", - "rack": "1" - }, - { - "dc": "ny" - } - ], - "maxStalenessSeconds": 120 - } - }, - { - "description": "Single readPreferenceTags is parsed as array of size one", - "uri": "mongodb://example.com/?readPreference=secondary&readPreferenceTags=dc:ny", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "readPreferenceTags": [ - { - "dc": "ny" - } - ] - } - }, - { - "description": "Invalid readPreferenceTags causes a warning", - "uri": "mongodb://example.com/?readPreferenceTags=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Non-numeric maxStalenessSeconds causes a warning", - "uri": "mongodb://example.com/?maxStalenessSeconds=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Too low maxStalenessSeconds causes a warning", - "uri": "mongodb://example.com/?maxStalenessSeconds=-2", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - } - ] -} diff --git a/driver-core/src/test/resources/uri-options/sdam-options.json b/driver-core/src/test/resources/uri-options/sdam-options.json deleted file mode 100644 index 673f5607ee9..00000000000 --- a/driver-core/src/test/resources/uri-options/sdam-options.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "tests": [ - { - "description": "serverMonitoringMode=auto", - "uri": "mongodb://example.com/?serverMonitoringMode=auto", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "serverMonitoringMode": "auto" - } - }, - { - "description": "serverMonitoringMode=stream", - "uri": "mongodb://example.com/?serverMonitoringMode=stream", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "serverMonitoringMode": "stream" - } - }, - { - "description": "serverMonitoringMode=poll", - "uri": "mongodb://example.com/?serverMonitoringMode=poll", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "serverMonitoringMode": "poll" - } - }, - { - "description": "invalid serverMonitoringMode", - "uri": "mongodb://example.com/?serverMonitoringMode=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - } - ] -} diff --git a/driver-core/src/test/resources/uri-options/single-threaded-options.json b/driver-core/src/test/resources/uri-options/single-threaded-options.json deleted file mode 100644 index fcd24fb8803..00000000000 --- a/driver-core/src/test/resources/uri-options/single-threaded-options.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "tests": [ - { - "description": "Valid options specific to single-threaded drivers are parsed correctly", - "uri": "mongodb://example.com/?serverSelectionTryOnce=false", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "serverSelectionTryOnce": false - } - }, - { - "description": "Invalid serverSelectionTryOnce causes a warning", - "uri": "mongodb://example.com/?serverSelectionTryOnce=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - } - ] -} diff --git a/driver-core/src/test/resources/uri-options/srv-options.json b/driver-core/src/test/resources/uri-options/srv-options.json deleted file mode 100644 index ffc356f12f0..00000000000 --- a/driver-core/src/test/resources/uri-options/srv-options.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "tests": [ - { - "description": "SRV URI with custom srvServiceName", - "uri": "mongodb+srv://test22.test.build.10gen.cc/?srvServiceName=customname", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "srvServiceName": "customname" - } - }, - { - "description": "Non-SRV URI with custom srvServiceName", - "uri": "mongodb://example.com/?srvServiceName=customname", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "SRV URI with srvMaxHosts", - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "srvMaxHosts": 2 - } - }, - { - "description": "SRV URI with negative integer for srvMaxHosts", - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=-1", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "SRV URI with invalid type for srvMaxHosts", - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=foo", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "Non-SRV URI with srvMaxHosts", - "uri": "mongodb://example.com/?srvMaxHosts=2", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "SRV URI with positive srvMaxHosts and replicaSet", - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&replicaSet=foo", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "SRV URI with positive srvMaxHosts and loadBalanced=true", - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&loadBalanced=true", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "SRV URI with positive srvMaxHosts and loadBalanced=false", - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=2&loadBalanced=false", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "loadBalanced": false, - "srvMaxHosts": 2 - } - }, - { - "description": "SRV URI with srvMaxHosts=0 and replicaSet", - "uri": "mongodb+srv://test1.test.build.10gen.cc/?srvMaxHosts=0&replicaSet=foo", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "replicaSet": "foo", - "srvMaxHosts": 0 - } - }, - { - "description": "SRV URI with srvMaxHosts=0 and loadBalanced=true", - "uri": "mongodb+srv://test3.test.build.10gen.cc/?srvMaxHosts=0&loadBalanced=true", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "loadBalanced": true, - "srvMaxHosts": 0 - } - } - ] -} diff --git a/driver-core/src/test/resources/uri-options/tls-options.json b/driver-core/src/test/resources/uri-options/tls-options.json deleted file mode 100644 index 6db80ed6235..00000000000 --- a/driver-core/src/test/resources/uri-options/tls-options.json +++ /dev/null @@ -1,231 +0,0 @@ -{ - "tests": [ - { - "description": "Valid required tls options are parsed correctly", - "uri": "mongodb://example.com/?tls=true&tlsCAFile=ca.pem&tlsCertificateKeyFile=cert.pem&tlsCertificateKeyFilePassword=hunter2", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "tls": true, - "tlsCAFile": "ca.pem", - "tlsCertificateKeyFile": "cert.pem", - "tlsCertificateKeyFilePassword": "hunter2" - } - }, - { - "description": "Invalid tlsAllowInvalidCertificates causes a warning", - "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tlsAllowInvalidCertificates is parsed correctly", - "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=true", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "tlsAllowInvalidCertificates": true - } - }, - { - "description": "Invalid tlsAllowInvalidCertificates causes a warning", - "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tlsAllowInvalidHostnames is parsed correctly", - "uri": "mongodb://example.com/?tlsAllowInvalidHostnames=true", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "tlsAllowInvalidHostnames": true - } - }, - { - "description": "Invalid tlsAllowInvalidHostnames causes a warning", - "uri": "mongodb://example.com/?tlsAllowInvalidHostnames=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tlsInsecure is parsed correctly", - "uri": "mongodb://example.com/?tlsInsecure=true", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": { - "tlsInsecure": true - } - }, - { - "description": "Invalid tlsAllowInsecure causes a warning", - "uri": "mongodb://example.com/?tlsAllowInsecure=invalid", - "valid": true, - "warning": true, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tlsInsecure and tlsAllowInvalidCertificates both present (and true) raises an error", - "uri": "mongodb://example.com/?tlsInsecure=true&tlsAllowInvalidCertificates=true", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tlsInsecure and tlsAllowInvalidCertificates both present (and false) raises an error", - "uri": "mongodb://example.com/?tlsInsecure=false&tlsAllowInvalidCertificates=false", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tlsAllowInvalidCertificates and tlsInsecure both present (and true) raises an error", - "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=true&tlsInsecure=true", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tlsAllowInvalidCertificates and tlsInsecure both present (and false) raises an error", - "uri": "mongodb://example.com/?tlsAllowInvalidCertificates=false&tlsInsecure=false", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tlsInsecure and tlsAllowInvalidHostnames both present (and true) raises an error", - "uri": "mongodb://example.com/?tlsInsecure=true&tlsAllowInvalidHostnames=true", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tlsInsecure and tlsAllowInvalidHostnames both present (and false) raises an error", - "uri": "mongodb://example.com/?tlsInsecure=false&tlsAllowInvalidHostnames=false", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tlsAllowInvalidHostnames and tlsInsecure both present (and true) raises an error", - "uri": "mongodb://example.com/?tlsAllowInvalidHostnames=true&tlsInsecure=true", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tlsAllowInvalidHostnames and tlsInsecure both present (and false) raises an error", - "uri": "mongodb://example.com/?tlsAllowInvalidHostnames=false&tlsInsecure=false", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tls=true and ssl=true doesn't warn", - "uri": "mongodb://example.com/?tls=true&ssl=true", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tls=false and ssl=false doesn't warn", - "uri": "mongodb://example.com/?tls=false&ssl=false", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "ssl=true and tls=true doesn't warn", - "uri": "mongodb://example.com/?ssl=true&tls=true", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "ssl=false and tls=false doesn't warn", - "uri": "mongodb://example.com/?ssl=false&tls=false", - "valid": true, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tls=false and ssl=true raises error", - "uri": "mongodb://example.com/?tls=false&ssl=true", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "tls=true and ssl=false raises error", - "uri": "mongodb://example.com/?tls=true&ssl=false", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "ssl=false and tls=true raises error", - "uri": "mongodb://example.com/?ssl=false&tls=true", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - }, - { - "description": "ssl=true and tls=false raises error", - "uri": "mongodb://example.com/?ssl=true&tls=false", - "valid": false, - "warning": false, - "hosts": null, - "auth": null, - "options": {} - } - ] -} diff --git a/driver-core/src/test/resources/versioned-api/README.rst b/driver-core/src/test/resources/versioned-api/README.rst deleted file mode 100644 index a0b0599f643..00000000000 --- a/driver-core/src/test/resources/versioned-api/README.rst +++ /dev/null @@ -1,37 +0,0 @@ -=================== -Versioned API Tests -=================== - -.. contents:: - ----- - -Notes -===== - -This directory contains tests for the Versioned API specification. They are -implemented in the `Unified Test Format <../../unified-test-format/unified-test-format.rst>`__, -and require schema version 1.1. Note that to run these tests, the server must be -started with both ``enableTestCommands`` and ``acceptApiVersion2`` parameters -set to true. - -Testing with required API version -================================= - -Drivers MUST run their test suite against a cluster with the -``requireApiVersion`` parameter enabled and also requires authentication. - -To run this test, proceed as follows: -- Start a standalone mongod instance - -- Connect to the standalone instance and run the following command on the - ``admin`` database: ``{ setParameter: 1, requireApiVersion: true }`` - -- Declare an API version for the test run through the ``MONGODB_API_VERSION`` - environment variable. - -- If the environment variable is set, all clients created in tests MUST declare - the ``ServerApiVersion`` specified. - -No other topologies must be tested until ``mongo-orchestration`` can handle -servers with ``requireApiVersion`` enabled. diff --git a/driver-core/src/test/resources/versioned-api/crud-api-version-1-strict.json b/driver-core/src/test/resources/versioned-api/crud-api-version-1-strict.json deleted file mode 100644 index c1c8ecce01f..00000000000 --- a/driver-core/src/test/resources/versioned-api/crud-api-version-1-strict.json +++ /dev/null @@ -1,1109 +0,0 @@ -{ - "description": "CRUD Api Version 1 (strict)", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.9" - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent" - ], - "serverApi": { - "version": "1", - "strict": true - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "versioned-api-tests" - } - }, - { - "database": { - "id": "adminDatabase", - "client": "client", - "databaseName": "admin" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "_yamlAnchors": { - "versions": [ - { - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - ] - }, - "initialData": [ - { - "collectionName": "test", - "databaseName": "versioned-api-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "tests": [ - { - "description": "aggregate on collection appends declared API version", - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "aggregate on database appends declared API version", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "aggregate", - "object": "adminDatabase", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - }, - "expectError": { - "errorCodeName": "APIStrictError" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "bulkWrite appends declared API version", - "operations": [ - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 6, - "x": 66 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteMany": { - "filter": { - "x": { - "$nin": [ - 24, - 34 - ] - } - } - } - }, - { - "updateMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 7 - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 44 - }, - "upsert": true - } - } - ], - "ordered": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 6, - "x": 66 - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 2 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "x": { - "$nin": [ - 24, - 34 - ] - } - }, - "limit": 0 - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": 7 - }, - "limit": 1 - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 4 - }, - "u": { - "_id": 4, - "x": 44 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": true - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "countDocuments appends declared API version", - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": { - "x": { - "$gt": 11 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$match": { - "x": { - "$gt": 11 - } - } - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "deleteMany appends declared API version", - "operations": [ - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "filter": { - "x": { - "$nin": [ - 24, - 34 - ] - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "x": { - "$nin": [ - 24, - 34 - ] - } - }, - "limit": 0 - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "deleteOne appends declared API version", - "operations": [ - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 7 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": 7 - }, - "limit": 1 - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "distinct appends declared API version", - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - }, - "expectError": { - "isError": true, - "errorContains": "command distinct is not in API Version 1", - "errorCodeName": "APIStrictError" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "test", - "key": "x", - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "estimatedDocumentCount appends declared API version", - "runOnRequirements": [ - { - "minServerVersion": "5.0.9", - "maxServerVersion": "5.0.99" - }, - { - "minServerVersion": "5.3.2" - } - ], - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "arguments": {} - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "test", - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "find and getMore append API version", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "batchSize": 3 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "findOneAndDelete appends declared API version", - "operations": [ - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 1 - }, - "remove": true, - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "findOneAndReplace appends declared API version", - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 33 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 1 - }, - "update": { - "x": 33 - }, - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "findOneAndUpdate appends declared API version", - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "insertMany appends declared API version", - "operations": [ - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 6, - "x": 66 - }, - { - "_id": 7, - "x": 77 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 6, - "x": 66 - }, - { - "_id": 7, - "x": 77 - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "insertOne appends declared API version", - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 6, - "x": 66 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 6, - "x": 66 - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "replaceOne appends declared API version", - "operations": [ - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 44 - }, - "upsert": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 4 - }, - "u": { - "_id": 4, - "x": 44 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": true - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "updateMany appends declared API version", - "operations": [ - { - "name": "updateMany", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "updateOne appends declared API version", - "operations": [ - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 2 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/versioned-api/crud-api-version-1.json b/driver-core/src/test/resources/versioned-api/crud-api-version-1.json deleted file mode 100644 index 23ef59a6d98..00000000000 --- a/driver-core/src/test/resources/versioned-api/crud-api-version-1.json +++ /dev/null @@ -1,1182 +0,0 @@ -{ - "description": "CRUD Api Version 1", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.9" - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent" - ], - "serverApi": { - "version": "1", - "deprecationErrors": true - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "versioned-api-tests" - } - }, - { - "database": { - "id": "adminDatabase", - "client": "client", - "databaseName": "admin" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - } - ], - "_yamlAnchors": { - "versions": [ - { - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - ], - "namespace": "versioned-api-tests.test" - }, - "initialData": [ - { - "collectionName": "test", - "databaseName": "versioned-api-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "tests": [ - { - "description": "aggregate on collection appends declared API version", - "operations": [ - { - "name": "aggregate", - "object": "collection", - "arguments": { - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$sort": { - "x": 1 - } - }, - { - "$match": { - "_id": { - "$gt": 1 - } - } - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "aggregate on database appends declared API version", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "aggregate", - "object": "adminDatabase", - "arguments": { - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": 1, - "pipeline": [ - { - "$listLocalSessions": {} - }, - { - "$limit": 1 - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "bulkWrite appends declared API version", - "operations": [ - { - "name": "bulkWrite", - "object": "collection", - "arguments": { - "requests": [ - { - "insertOne": { - "document": { - "_id": 6, - "x": 66 - } - } - }, - { - "updateOne": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteMany": { - "filter": { - "x": { - "$nin": [ - 24, - 34 - ] - } - } - } - }, - { - "updateMany": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - }, - { - "deleteOne": { - "filter": { - "_id": 7 - } - } - }, - { - "replaceOne": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 44 - }, - "upsert": true - } - } - ], - "ordered": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 6, - "x": 66 - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 2 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "x": { - "$nin": [ - 24, - 34 - ] - } - }, - "limit": 0 - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - }, - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": 7 - }, - "limit": 1 - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - }, - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 4 - }, - "u": { - "_id": 4, - "x": 44 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": true - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "client bulkWrite appends declared API version", - "runOnRequirements": [ - { - "minServerVersion": "8.0", - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "clientBulkWrite", - "object": "client", - "arguments": { - "models": [ - { - "insertOne": { - "namespace": "versioned-api-tests.test", - "document": { - "_id": 6, - "x": 6 - } - } - } - ], - "verboseResults": true - }, - "expectResult": { - "insertedCount": 1, - "upsertedCount": 0, - "matchedCount": 0, - "modifiedCount": 0, - "deletedCount": 0, - "insertResults": { - "0": { - "insertedId": 6 - } - }, - "updateResults": {}, - "deleteResults": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "commandName": "bulkWrite", - "databaseName": "admin", - "command": { - "bulkWrite": 1, - "errorsOnly": false, - "ordered": true, - "ops": [ - { - "insert": 0, - "document": { - "_id": 6, - "x": 6 - } - } - ], - "nsInfo": [ - { - "ns": "versioned-api-tests.test" - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "countDocuments appends declared API version", - "operations": [ - { - "name": "countDocuments", - "object": "collection", - "arguments": { - "filter": { - "x": { - "$gt": 11 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "aggregate": "test", - "pipeline": [ - { - "$match": { - "x": { - "$gt": 11 - } - } - }, - { - "$group": { - "_id": 1, - "n": { - "$sum": 1 - } - } - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "deleteMany appends declared API version", - "operations": [ - { - "name": "deleteMany", - "object": "collection", - "arguments": { - "filter": { - "x": { - "$nin": [ - 24, - 34 - ] - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "x": { - "$nin": [ - 24, - 34 - ] - } - }, - "limit": 0 - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "deleteOne appends declared API version", - "operations": [ - { - "name": "deleteOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 7 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "delete": "test", - "deletes": [ - { - "q": { - "_id": 7 - }, - "limit": 1 - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "distinct appends declared API version", - "operations": [ - { - "name": "distinct", - "object": "collection", - "arguments": { - "fieldName": "x", - "filter": {} - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "distinct": "test", - "key": "x", - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "estimatedDocumentCount appends declared API version", - "runOnRequirements": [ - { - "minServerVersion": "5.0.9", - "maxServerVersion": "5.0.99" - }, - { - "minServerVersion": "5.3.2" - } - ], - "operations": [ - { - "name": "estimatedDocumentCount", - "object": "collection", - "arguments": {} - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "count": "test", - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "find and getMore append API version", - "operations": [ - { - "name": "find", - "object": "collection", - "arguments": { - "filter": {}, - "sort": { - "_id": 1 - }, - "batchSize": 3 - }, - "expectResult": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "find": "test", - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - }, - { - "commandStartedEvent": { - "command": { - "getMore": { - "$$type": [ - "int", - "long" - ] - }, - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "findOneAndDelete appends declared API version", - "operations": [ - { - "name": "findOneAndDelete", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 1 - }, - "remove": true, - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "findOneAndReplace appends declared API version", - "operations": [ - { - "name": "findOneAndReplace", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - }, - "replacement": { - "x": 33 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 1 - }, - "update": { - "x": 33 - }, - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "findOneAndUpdate appends declared API version", - "operations": [ - { - "name": "findOneAndUpdate", - "object": "collection", - "arguments": { - "filter": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "findAndModify": "test", - "query": { - "_id": 1 - }, - "update": { - "$inc": { - "x": 1 - } - }, - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "insertMany appends declared API version", - "operations": [ - { - "name": "insertMany", - "object": "collection", - "arguments": { - "documents": [ - { - "_id": 6, - "x": 66 - }, - { - "_id": 7, - "x": 77 - } - ] - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 6, - "x": 66 - }, - { - "_id": 7, - "x": 77 - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "insertOne appends declared API version", - "operations": [ - { - "name": "insertOne", - "object": "collection", - "arguments": { - "document": { - "_id": 6, - "x": 66 - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 6, - "x": 66 - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "replaceOne appends declared API version", - "operations": [ - { - "name": "replaceOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 4 - }, - "replacement": { - "_id": 4, - "x": 44 - }, - "upsert": true - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 4 - }, - "u": { - "_id": 4, - "x": 44 - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": true - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "updateMany appends declared API version", - "operations": [ - { - "name": "updateMany", - "object": "collection", - "arguments": { - "filter": { - "_id": { - "$gt": 1 - } - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": { - "$gt": 1 - } - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": true, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - }, - { - "description": "updateOne appends declared API version", - "operations": [ - { - "name": "updateOne", - "object": "collection", - "arguments": { - "filter": { - "_id": 2 - }, - "update": { - "$inc": { - "x": 1 - } - } - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "update": "test", - "updates": [ - { - "q": { - "_id": 2 - }, - "u": { - "$inc": { - "x": 1 - } - }, - "multi": { - "$$unsetOrMatches": false - }, - "upsert": { - "$$unsetOrMatches": false - } - } - ], - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/versioned-api/runcommand-helper-no-api-version-declared.json b/driver-core/src/test/resources/versioned-api/runcommand-helper-no-api-version-declared.json deleted file mode 100644 index 17e0126d107..00000000000 --- a/driver-core/src/test/resources/versioned-api/runcommand-helper-no-api-version-declared.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "description": "RunCommand helper: No API version declared", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.9", - "serverParameters": { - "requireApiVersion": false - } - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "versioned-api-tests" - } - } - ], - "tests": [ - { - "description": "runCommand does not inspect or change the command document", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1, - "apiVersion": "server_will_never_support_this_api_version" - } - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1, - "apiVersion": "server_will_never_support_this_api_version", - "apiStrict": { - "$$exists": false - }, - "apiDeprecationErrors": { - "$$exists": false - } - }, - "commandName": "ping", - "databaseName": "versioned-api-tests" - } - } - ] - } - ] - }, - { - "description": "runCommand does not prevent sending invalid API version declarations", - "runOnRequirements": [ - { - "serverless": "forbid" - } - ], - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "ping", - "command": { - "ping": 1, - "apiStrict": true - } - }, - "expectError": { - "isError": true, - "isClientError": false - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "ping": 1, - "apiVersion": { - "$$exists": false - }, - "apiStrict": true, - "apiDeprecationErrors": { - "$$exists": false - } - }, - "commandName": "ping", - "databaseName": "versioned-api-tests" - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/versioned-api/test-commands-deprecation-errors.json b/driver-core/src/test/resources/versioned-api/test-commands-deprecation-errors.json deleted file mode 100644 index 0668df830a5..00000000000 --- a/driver-core/src/test/resources/versioned-api/test-commands-deprecation-errors.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "description": "Test commands: deprecation errors", - "schemaVersion": "1.1", - "runOnRequirements": [ - { - "minServerVersion": "4.9", - "serverParameters": { - "enableTestCommands": true, - "acceptApiVersion2": true, - "requireApiVersion": false - } - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent" - ] - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "versioned-api-tests" - } - } - ], - "tests": [ - { - "description": "Running a command that is deprecated raises a deprecation error", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "testDeprecationInVersion2", - "command": { - "testDeprecationInVersion2": 1, - "apiVersion": "2", - "apiDeprecationErrors": true - } - }, - "expectError": { - "isError": true, - "errorContains": "command testDeprecationInVersion2 is deprecated in API Version 2", - "errorCodeName": "APIDeprecationError" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "testDeprecationInVersion2": 1, - "apiVersion": "2", - "apiStrict": { - "$$exists": false - }, - "apiDeprecationErrors": true - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/versioned-api/test-commands-strict-mode.json b/driver-core/src/test/resources/versioned-api/test-commands-strict-mode.json deleted file mode 100644 index 9c4ebea7850..00000000000 --- a/driver-core/src/test/resources/versioned-api/test-commands-strict-mode.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "description": "Test commands: strict mode", - "schemaVersion": "1.4", - "runOnRequirements": [ - { - "minServerVersion": "4.9", - "serverParameters": { - "enableTestCommands": true - }, - "serverless": "forbid" - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent" - ], - "serverApi": { - "version": "1", - "strict": true - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "versioned-api-tests" - } - } - ], - "tests": [ - { - "description": "Running a command that is not part of the versioned API results in an error", - "operations": [ - { - "name": "runCommand", - "object": "database", - "arguments": { - "commandName": "testVersion2", - "command": { - "testVersion2": 1 - } - }, - "expectError": { - "isError": true, - "errorContains": "command testVersion2 is not in API Version 1", - "errorCodeName": "APIStrictError" - } - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "testVersion2": 1, - "apiVersion": "1", - "apiStrict": true, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/versioned-api/transaction-handling.json b/driver-core/src/test/resources/versioned-api/transaction-handling.json deleted file mode 100644 index c00c5240ae6..00000000000 --- a/driver-core/src/test/resources/versioned-api/transaction-handling.json +++ /dev/null @@ -1,348 +0,0 @@ -{ - "description": "Transaction handling", - "schemaVersion": "1.3", - "runOnRequirements": [ - { - "minServerVersion": "4.9", - "topologies": [ - "replicaset", - "sharded-replicaset", - "load-balanced" - ] - } - ], - "createEntities": [ - { - "client": { - "id": "client", - "observeEvents": [ - "commandStartedEvent" - ], - "serverApi": { - "version": "1" - } - } - }, - { - "database": { - "id": "database", - "client": "client", - "databaseName": "versioned-api-tests" - } - }, - { - "collection": { - "id": "collection", - "database": "database", - "collectionName": "test" - } - }, - { - "session": { - "id": "session", - "client": "client" - } - } - ], - "_yamlAnchors": { - "versions": [ - { - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - ] - }, - "initialData": [ - { - "collectionName": "test", - "databaseName": "versioned-api-tests", - "documents": [ - { - "_id": 1, - "x": 11 - }, - { - "_id": 2, - "x": 22 - }, - { - "_id": 3, - "x": 33 - }, - { - "_id": 4, - "x": 44 - }, - { - "_id": 5, - "x": 55 - } - ] - } - ], - "tests": [ - { - "description": "All commands in a transaction declare an API version", - "runOnRequirements": [ - { - "topologies": [ - "replicaset", - "sharded-replicaset", - "load-balanced" - ] - } - ], - "operations": [ - { - "name": "startTransaction", - "object": "session" - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 6, - "x": 66 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 6 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 7, - "x": 77 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 7 - } - } - } - }, - { - "name": "commitTransaction", - "object": "session" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 6, - "x": 66 - } - ], - "lsid": { - "$$sessionLsid": "session" - }, - "startTransaction": true, - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 7, - "x": 77 - } - ], - "lsid": { - "$$sessionLsid": "session" - }, - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "commitTransaction": 1, - "lsid": { - "$$sessionLsid": "session" - }, - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - }, - { - "description": "abortTransaction includes an API version", - "runOnRequirements": [ - { - "topologies": [ - "replicaset", - "sharded-replicaset", - "load-balanced" - ] - } - ], - "operations": [ - { - "name": "startTransaction", - "object": "session" - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 6, - "x": 66 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 6 - } - } - } - }, - { - "name": "insertOne", - "object": "collection", - "arguments": { - "session": "session", - "document": { - "_id": 7, - "x": 77 - } - }, - "expectResult": { - "$$unsetOrMatches": { - "insertedId": { - "$$unsetOrMatches": 7 - } - } - } - }, - { - "name": "abortTransaction", - "object": "session" - } - ], - "expectEvents": [ - { - "client": "client", - "events": [ - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 6, - "x": 66 - } - ], - "lsid": { - "$$sessionLsid": "session" - }, - "startTransaction": true, - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "insert": "test", - "documents": [ - { - "_id": 7, - "x": 77 - } - ], - "lsid": { - "$$sessionLsid": "session" - }, - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - }, - { - "commandStartedEvent": { - "command": { - "abortTransaction": 1, - "lsid": { - "$$sessionLsid": "session" - }, - "apiVersion": "1", - "apiStrict": { - "$$unsetOrMatches": false - }, - "apiDeprecationErrors": { - "$$unsetOrMatches": false - } - } - } - } - ] - } - ] - } - ] -} diff --git a/driver-core/src/test/resources/write-concern/connection-string/write-concern.json b/driver-core/src/test/resources/write-concern/connection-string/write-concern.json deleted file mode 100644 index 51bdf821c34..00000000000 --- a/driver-core/src/test/resources/write-concern/connection-string/write-concern.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "tests": [ - { - "description": "Default", - "uri": "mongodb://localhost/", - "valid": true, - "warning": false, - "writeConcern": {} - }, - { - "description": "w as a valid number", - "uri": "mongodb://localhost/?w=1", - "valid": true, - "warning": false, - "writeConcern": { - "w": 1 - } - }, - { - "description": "w as an invalid number", - "uri": "mongodb://localhost/?w=-2", - "valid": false, - "warning": null - }, - { - "description": "w as a string", - "uri": "mongodb://localhost/?w=majority", - "valid": true, - "warning": false, - "writeConcern": { - "w": "majority" - } - }, - { - "description": "wtimeoutMS as a valid number", - "uri": "mongodb://localhost/?wtimeoutMS=500", - "valid": true, - "warning": false, - "writeConcern": { - "wtimeoutMS": 500 - } - }, - { - "description": "wtimeoutMS as an invalid number", - "uri": "mongodb://localhost/?wtimeoutMS=-500", - "valid": false, - "warning": null - }, - { - "description": "journal as false", - "uri": "mongodb://localhost/?journal=false", - "valid": true, - "warning": false, - "writeConcern": { - "journal": false - } - }, - { - "description": "journal as true", - "uri": "mongodb://localhost/?journal=true", - "valid": true, - "warning": false, - "writeConcern": { - "journal": true - } - }, - { - "description": "All options combined", - "uri": "mongodb://localhost/?w=3&wtimeoutMS=500&journal=true", - "valid": true, - "warning": false, - "writeConcern": { - "w": 3, - "wtimeoutMS": 500, - "journal": true - } - }, - { - "description": "Unacknowledged with w", - "uri": "mongodb://localhost/?w=0", - "valid": true, - "warning": false, - "writeConcern": { - "w": 0 - } - }, - { - "description": "Unacknowledged with w and journal", - "uri": "mongodb://localhost/?w=0&journal=false", - "valid": true, - "warning": false, - "writeConcern": { - "w": 0, - "journal": false - } - }, - { - "description": "Unacknowledged with w and wtimeoutMS", - "uri": "mongodb://localhost/?w=0&wtimeoutMS=500", - "valid": true, - "warning": false, - "writeConcern": { - "w": 0, - "wtimeoutMS": 500 - } - }, - { - "description": "Acknowledged with w as 0 and journal true", - "uri": "mongodb://localhost/?w=0&journal=true", - "valid": false, - "warning": false, - "writeConcern": { - "w": 0, - "journal": true - } - } - ] -} diff --git a/driver-core/src/test/resources/write-concern/document/write-concern.json b/driver-core/src/test/resources/write-concern/document/write-concern.json deleted file mode 100644 index 64cd5d0eae2..00000000000 --- a/driver-core/src/test/resources/write-concern/document/write-concern.json +++ /dev/null @@ -1,174 +0,0 @@ -{ - "tests": [ - { - "description": "Default", - "valid": true, - "writeConcern": {}, - "writeConcernDocument": {}, - "isServerDefault": true, - "isAcknowledged": true - }, - { - "description": "W as a number", - "valid": true, - "writeConcern": { - "w": 3 - }, - "writeConcernDocument": { - "w": 3 - }, - "isServerDefault": false, - "isAcknowledged": true - }, - { - "description": "W as an invalid number", - "valid": false, - "writeConcern": { - "w": -3 - }, - "writeConcernDocument": null, - "isServerDefault": null, - "isAcknowledged": null - }, - { - "description": "W as majority", - "valid": true, - "writeConcern": { - "w": "majority" - }, - "writeConcernDocument": { - "w": "majority" - }, - "isServerDefault": false, - "isAcknowledged": true - }, - { - "description": "W as a custom string", - "valid": true, - "writeConcern": { - "w": "my_mode" - }, - "writeConcernDocument": { - "w": "my_mode" - }, - "isServerDefault": false, - "isAcknowledged": true - }, - { - "description": "WTimeoutMS", - "valid": true, - "writeConcern": { - "wtimeoutMS": 1000 - }, - "writeConcernDocument": { - "wtimeout": 1000 - }, - "isServerDefault": false, - "isAcknowledged": true - }, - { - "description": "WTimeoutMS as an invalid number", - "valid": false, - "writeConcern": { - "wtimeoutMS": -1000 - }, - "writeConcernDocument": null, - "isServerDefault": null, - "isAcknowledged": null - }, - { - "description": "Journal as true", - "valid": true, - "writeConcern": { - "journal": true - }, - "writeConcernDocument": { - "j": true - }, - "isServerDefault": false, - "isAcknowledged": true - }, - { - "description": "Journal as false", - "valid": true, - "writeConcern": { - "journal": false - }, - "writeConcernDocument": { - "j": false - }, - "isServerDefault": false, - "isAcknowledged": true - }, - { - "description": "Unacknowledged with only w", - "valid": true, - "writeConcern": { - "w": 0 - }, - "writeConcernDocument": { - "w": 0 - }, - "isServerDefault": false, - "isAcknowledged": false - }, - { - "description": "Unacknowledged with wtimeoutMS", - "valid": true, - "writeConcern": { - "w": 0, - "wtimeoutMS": 500 - }, - "writeConcernDocument": { - "w": 0, - "wtimeout": 500 - }, - "isServerDefault": false, - "isAcknowledged": false - }, - { - "description": "Unacknowledged with journal", - "valid": true, - "writeConcern": { - "w": 0, - "journal": false - }, - "writeConcernDocument": { - "w": 0, - "j": false - }, - "isServerDefault": false, - "isAcknowledged": false - }, - { - "description": "W is 0 with journal true", - "valid": false, - "writeConcern": { - "w": 0, - "journal": true - }, - "writeConcernDocument": { - "w": 0, - "j": true - }, - "isServerDefault": false, - "isAcknowledged": true - }, - { - "description": "Everything", - "valid": true, - "writeConcern": { - "w": 3, - "wtimeoutMS": 1000, - "journal": true - }, - "writeConcernDocument": { - "w": 3, - "wtimeout": 1000, - "j": true - }, - "isServerDefault": false, - "isAcknowledged": true - } - ] -} diff --git a/driver-core/src/test/unit/com/mongodb/AbstractConnectionStringTest.java b/driver-core/src/test/unit/com/mongodb/AbstractConnectionStringTest.java index bb26a3edb53..d511d2750eb 100644 --- a/driver-core/src/test/unit/com/mongodb/AbstractConnectionStringTest.java +++ b/driver-core/src/test/unit/com/mongodb/AbstractConnectionStringTest.java @@ -125,6 +125,9 @@ protected void testValidOptions() { } else if (option.getKey().equalsIgnoreCase("replicaset")) { String expected = option.getValue().asString().getValue(); assertEquals(expected, connectionString.getRequiredReplicaSetName()); + } else if (option.getKey().equalsIgnoreCase("timeoutMS")) { + int expected = option.getValue().asInt32().getValue(); + assertEquals(expected, connectionString.getTimeout().intValue()); } else if (option.getKey().equalsIgnoreCase("serverselectiontimeoutms")) { int expected = option.getValue().asInt32().getValue(); assertEquals(expected, connectionString.getServerSelectionTimeout().intValue()); diff --git a/driver-core/src/test/unit/com/mongodb/AuthConnectionStringTest.java b/driver-core/src/test/unit/com/mongodb/AuthConnectionStringTest.java index cab5b0e0365..f214667e510 100644 --- a/driver-core/src/test/unit/com/mongodb/AuthConnectionStringTest.java +++ b/driver-core/src/test/unit/com/mongodb/AuthConnectionStringTest.java @@ -29,30 +29,34 @@ import org.junit.runners.Parameterized; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; import static com.mongodb.AuthenticationMechanism.MONGODB_OIDC; import static com.mongodb.MongoCredential.OIDC_CALLBACK_KEY; +import static org.junit.Assume.assumeFalse; // See https://github.com/mongodb/specifications/tree/master/source/auth/legacy/tests @RunWith(Parameterized.class) public class AuthConnectionStringTest extends TestCase { + private final String description; private final String input; private final BsonDocument definition; public AuthConnectionStringTest(final String filename, final String description, final String input, final BsonDocument definition) { + this.description = description; this.input = input; this.definition = definition; } @Test public void shouldPassAllOutcomes() { + // No CANONICALIZE_HOST_NAME support https://jira.mongodb.org/browse/JAVA-4278 + assumeFalse(description.equals("must raise an error when the hostname canonicalization is invalid")); + assumeFalse(description.equals("should accept forwardAndReverse hostname canonicalization (GSSAPI)")); + assumeFalse(description.equals("should accept generic mechanism property (GSSAPI)")); + assumeFalse(description.equals("should accept no hostname canonicalization (GSSAPI)")); + if (definition.getBoolean("valid").getValue()) { testValidUris(); } else { @@ -61,16 +65,8 @@ public void shouldPassAllOutcomes() { } @Parameterized.Parameters(name = "{1}") - public static Collection data() throws URISyntaxException, IOException { - List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/auth/legacy")) { - BsonDocument testDocument = JsonPoweredTestHelper.getTestDocument(file); - for (BsonValue test : testDocument.getArray("tests")) { - data.add(new Object[]{file.getName(), test.asDocument().getString("description").getValue(), - test.asDocument().getString("uri").getValue(), test.asDocument()}); - } - } - return data; + public static Collection data() { + return JsonPoweredTestHelper.getTestData("auth/tests/legacy"); } private void testInvalidUris() { diff --git a/driver-core/src/test/unit/com/mongodb/ConnectionStringTest.java b/driver-core/src/test/unit/com/mongodb/ConnectionStringTest.java index 80cc9f65e83..ba8b7763a8d 100644 --- a/driver-core/src/test/unit/com/mongodb/ConnectionStringTest.java +++ b/driver-core/src/test/unit/com/mongodb/ConnectionStringTest.java @@ -17,17 +17,11 @@ package com.mongodb; import org.bson.BsonDocument; -import org.bson.BsonValue; import org.junit.Test; import org.junit.runners.Parameterized; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; import static org.junit.Assume.assumeFalse; @@ -70,15 +64,7 @@ public void shouldPassAllOutcomes() { @Parameterized.Parameters(name = "{1}") - public static Collection data() throws URISyntaxException, IOException { - List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/connection-string")) { - BsonDocument testDocument = JsonPoweredTestHelper.getTestDocument(file); - for (BsonValue test : testDocument.getArray("tests")) { - data.add(new Object[]{file.getName(), test.asDocument().getString("description").getValue(), - test.asDocument().getString("uri").getValue(), test.asDocument()}); - } - } - return data; + public static Collection data() { + return JsonPoweredTestHelper.getTestData("connection-string"); } } diff --git a/driver-core/src/test/unit/com/mongodb/ReadConcernConnectionStringTest.java b/driver-core/src/test/unit/com/mongodb/ReadConcernConnectionStringTest.java index 7d228604460..1cb70ea3f00 100644 --- a/driver-core/src/test/unit/com/mongodb/ReadConcernConnectionStringTest.java +++ b/driver-core/src/test/unit/com/mongodb/ReadConcernConnectionStringTest.java @@ -19,18 +19,12 @@ import junit.framework.TestCase; import org.bson.BsonBoolean; import org.bson.BsonDocument; -import org.bson.BsonValue; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; // See https://github.com/mongodb/specifications/tree/master/source/read-write-concern/tests/ @RunWith(Parameterized.class) @@ -39,7 +33,8 @@ public class ReadConcernConnectionStringTest extends TestCase { private final String input; private final BsonDocument definition; - public ReadConcernConnectionStringTest(final String description, final String input, final BsonDocument definition) { + public ReadConcernConnectionStringTest(@SuppressWarnings("unused") final String fileName, final String description, + final String input, final BsonDocument definition) { this.description = description; this.input = input; this.definition = definition; @@ -59,16 +54,7 @@ public void shouldPassAllOutcomes() { } @Parameterized.Parameters(name = "{0}: {1}") - public static Collection data() throws URISyntaxException, IOException { - List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/read-concern/connection-string")) { - BsonDocument testDocument = JsonPoweredTestHelper.getTestDocument(file); - for (BsonValue test : testDocument.getArray("tests")) { - data.add(new Object[]{test.asDocument().getString("description").getValue(), - test.asDocument().getString("uri").getValue(), - test.asDocument()}); - } - } - return data; + public static Collection data() { + return JsonPoweredTestHelper.getTestData("read-write-concern/tests/connection-string/read-concern.json"); } } diff --git a/driver-core/src/test/unit/com/mongodb/ReadConcernDocumentTest.java b/driver-core/src/test/unit/com/mongodb/ReadConcernDocumentTest.java index 0555d368b91..392e691706e 100644 --- a/driver-core/src/test/unit/com/mongodb/ReadConcernDocumentTest.java +++ b/driver-core/src/test/unit/com/mongodb/ReadConcernDocumentTest.java @@ -19,18 +19,12 @@ import junit.framework.TestCase; import org.bson.BsonBoolean; import org.bson.BsonDocument; -import org.bson.BsonValue; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; // See https://github.com/mongodb/specifications/tree/master/source/read-write-concern/tests/connection-string @RunWith(Parameterized.class) @@ -38,7 +32,8 @@ public class ReadConcernDocumentTest extends TestCase { private final String description; private final BsonDocument definition; - public ReadConcernDocumentTest(final String description, final BsonDocument definition) { + public ReadConcernDocumentTest(@SuppressWarnings("unused") final String fileName, final String description, + @SuppressWarnings("unused") final String uri, final BsonDocument definition) { this.description = description; this.definition = definition; } @@ -71,15 +66,7 @@ private ReadConcern getReadConcern(final BsonDocument readConcernDocument) { } @Parameterized.Parameters(name = "{0}: {1}") - public static Collection data() throws URISyntaxException, IOException { - List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/read-concern/document")) { - BsonDocument testDocument = JsonPoweredTestHelper.getTestDocument(file); - for (BsonValue test : testDocument.getArray("tests")) { - data.add(new Object[]{test.asDocument().getString("description").getValue(), - test.asDocument()}); - } - } - return data; + public static Collection data() { + return JsonPoweredTestHelper.getTestData("read-write-concern/tests/document/read-concern.json"); } } diff --git a/driver-core/src/test/unit/com/mongodb/UriOptionsTest.java b/driver-core/src/test/unit/com/mongodb/UriOptionsTest.java index 3ca5ce0aa76..d3cb925ead6 100644 --- a/driver-core/src/test/unit/com/mongodb/UriOptionsTest.java +++ b/driver-core/src/test/unit/com/mongodb/UriOptionsTest.java @@ -18,17 +18,11 @@ import org.bson.BsonBoolean; import org.bson.BsonDocument; -import org.bson.BsonValue; import org.junit.Test; import org.junit.runners.Parameterized; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; import static org.junit.Assume.assumeFalse; @@ -42,9 +36,19 @@ public UriOptionsTest(final String filename, final String description, final Str public void shouldPassAllOutcomes() { assumeFalse(getDefinition().getBoolean("warning", BsonBoolean.FALSE).getValue()); assumeFalse(getDescription().equals("Arbitrary string readConcernLevel does not cause a warning")); - // Skip because Java driver does not support the tlsAllowInvalidCertificates option + // Skip because Java driver does not support the tlsAllowInvalidCertificates & tlsInsecure options assumeFalse(getDescription().startsWith("tlsInsecure and tlsAllowInvalidCertificates both present")); assumeFalse(getDescription().startsWith("tlsAllowInvalidCertificates and tlsInsecure both present")); + // Skip because Java driver does not support the tlsDisableCertificateRevocationCheck option + assumeFalse(getDescription().contains("tlsDisableCertificateRevocationCheck")); + // Skip because Java driver does not support the tlsDisableOCSPEndpointCheck option + assumeFalse(getDescription().contains("tlsDisableOCSPEndpointCheck")); + + // No CANONICALIZE_HOST_NAME support https://jira.mongodb.org/browse/JAVA-4278 + assumeFalse(getDescription().equals("Valid auth options are parsed correctly (GSSAPI)")); + + // https://jira.mongodb.org/browse/JAVA-5834 + assumeFalse(getFilename().equals("proxy-options.json")); if (getDefinition().getBoolean("valid", BsonBoolean.TRUE).getValue()) { testValidOptions(); @@ -54,15 +58,7 @@ public void shouldPassAllOutcomes() { } @Parameterized.Parameters(name = "{1}") - public static Collection data() throws URISyntaxException, IOException { - List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/uri-options")) { - BsonDocument testDocument = JsonPoweredTestHelper.getTestDocument(file); - for (BsonValue test : testDocument.getArray("tests")) { - data.add(new Object[]{file.getName(), test.asDocument().getString("description").getValue(), - test.asDocument().getString("uri").getValue(), test.asDocument()}); - } - } - return data; + public static Collection data() { + return JsonPoweredTestHelper.getTestData("uri-options"); } } diff --git a/driver-core/src/test/unit/com/mongodb/WriteConcernConnectionStringTest.java b/driver-core/src/test/unit/com/mongodb/WriteConcernConnectionStringTest.java index ec5815abfc9..503cac0a5e9 100644 --- a/driver-core/src/test/unit/com/mongodb/WriteConcernConnectionStringTest.java +++ b/driver-core/src/test/unit/com/mongodb/WriteConcernConnectionStringTest.java @@ -28,12 +28,7 @@ import org.junit.runners.Parameterized; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; import java.util.concurrent.TimeUnit; // See https://github.com/mongodb/specifications/tree/master/source/read-write-concern/tests/connection-string @@ -43,7 +38,8 @@ public class WriteConcernConnectionStringTest extends TestCase { private final String input; private final BsonDocument definition; - public WriteConcernConnectionStringTest(final String description, final String input, final BsonDocument definition) { + public WriteConcernConnectionStringTest(@SuppressWarnings("unused") final String fileName, final String description, + final String input, final BsonDocument definition) { this.description = description; this.input = input; this.definition = definition; @@ -89,16 +85,7 @@ private WriteConcern getExpectedWriteConcern() { } @Parameterized.Parameters(name = "{0}: {1}") - public static Collection data() throws URISyntaxException, IOException { - List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/write-concern/connection-string")) { - BsonDocument testDocument = JsonPoweredTestHelper.getTestDocument(file); - for (BsonValue test : testDocument.getArray("tests")) { - data.add(new Object[]{test.asDocument().getString("description").getValue(), - test.asDocument().getString("uri").getValue(), - test.asDocument()}); - } - } - return data; + public static Collection data() { + return JsonPoweredTestHelper.getTestData("read-write-concern/tests/connection-string/write-concern.json"); } } diff --git a/driver-core/src/test/unit/com/mongodb/WriteConcernDocumentTest.java b/driver-core/src/test/unit/com/mongodb/WriteConcernDocumentTest.java index 1c828a42f15..18185250e57 100644 --- a/driver-core/src/test/unit/com/mongodb/WriteConcernDocumentTest.java +++ b/driver-core/src/test/unit/com/mongodb/WriteConcernDocumentTest.java @@ -28,12 +28,7 @@ import org.junit.runners.Parameterized; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.util.ArrayList; import java.util.Collection; -import java.util.List; import java.util.concurrent.TimeUnit; // See https://github.com/mongodb/specifications/tree/master/source/read-write-concern/tests/connection-string @@ -43,9 +38,10 @@ public class WriteConcernDocumentTest extends TestCase { private final BsonDocument writeConcernDocument; private final BsonDocument definition; - public WriteConcernDocumentTest(final String description, final BsonDocument writeConcernDocument, final BsonDocument definition) { + public WriteConcernDocumentTest(@SuppressWarnings("unused") final String fileName, final String description, + @SuppressWarnings("unused") final String uri, final BsonDocument definition) { this.description = description; - this.writeConcernDocument = writeConcernDocument; + this.writeConcernDocument = definition.getDocument("writeConcern"); this.definition = definition; } @@ -86,16 +82,7 @@ private WriteConcern getWriteConcern(final BsonDocument writeConcernDocument) { } @Parameterized.Parameters(name = "{0}: {1}") - public static Collection data() throws URISyntaxException, IOException { - List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/write-concern/document")) { - BsonDocument testDocument = JsonPoweredTestHelper.getTestDocument(file); - for (BsonValue test : testDocument.getArray("tests")) { - data.add(new Object[]{test.asDocument().getString("description").getValue(), - test.asDocument().getDocument("writeConcern"), - test.asDocument()}); - } - } - return data; + public static Collection data() { + return JsonPoweredTestHelper.getTestData("read-write-concern/tests/document/write-concern.json"); } } diff --git a/driver-core/src/test/unit/com/mongodb/connection/ServerSelectionSelectionTest.java b/driver-core/src/test/unit/com/mongodb/connection/ServerSelectionSelectionTest.java index 9e1326f6d54..5ac15e92817 100644 --- a/driver-core/src/test/unit/com/mongodb/connection/ServerSelectionSelectionTest.java +++ b/driver-core/src/test/unit/com/mongodb/connection/ServerSelectionSelectionTest.java @@ -39,9 +39,6 @@ import org.junit.runners.Parameterized; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collection; import java.util.Date; @@ -75,8 +72,7 @@ public ServerSelectionSelectionTest(final String description, final BsonDocument @Test public void shouldPassAllOutcomes() { // skip this test because the driver prohibits maxStaleness or tagSets with mode of primary at a much lower level - assumeTrue(!description.equals("max-staleness/ReplicaSetWithPrimary/MaxStalenessWithModePrimary.json")); - + assumeTrue(!description.endsWith("/max-staleness/tests/ReplicaSetWithPrimary/MaxStalenessWithModePrimary.json")); ServerSelector serverSelector = null; List suitableServers = buildServerDescriptions(definition.getArray("suitable_servers", new BsonArray())); List selectedServers = null; @@ -102,26 +98,17 @@ public void shouldPassAllOutcomes() { } @Parameterized.Parameters(name = "{0}") - public static Collection data() throws URISyntaxException, IOException { + public static Collection data() { List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/server-selection/server_selection")) { - data.add(new Object[]{getServerSelectionTestDescription(file), JsonPoweredTestHelper.getTestDocument(file)}); + for (BsonDocument testDocument : JsonPoweredTestHelper.getSpecTestDocuments("server-selection/tests/server_selection")) { + data.add(new Object[]{testDocument.getString("resourcePath").getValue(), testDocument}); } - for (File file : JsonPoweredTestHelper.getTestFiles("/max-staleness/server_selection")) { - data.add(new Object[]{getMaxStalenessTestDescription(file), JsonPoweredTestHelper.getTestDocument(file)}); + for (BsonDocument testDocument : JsonPoweredTestHelper.getSpecTestDocuments("max-staleness/tests")) { + data.add(new Object[]{testDocument.getString("resourcePath").getValue(), testDocument}); } return data; } - private static String getServerSelectionTestDescription(final File file) { - return "server-selection" + "/" + file.getParentFile().getParentFile().getName() + "/" + file.getParentFile().getName() + "/" - + file.getName(); - } - - private static String getMaxStalenessTestDescription(final File file) { - return "max-staleness" + "/" + file.getParentFile().getName() + "/" + file.getName(); - } - public static ClusterDescription buildClusterDescription(final BsonDocument topologyDescription, @Nullable final ServerSettings serverSettings) { ClusterType clusterType = getClusterType(topologyDescription.getString("type").getValue()); diff --git a/driver-core/src/test/unit/com/mongodb/internal/TimeoutSettingsTest.java b/driver-core/src/test/unit/com/mongodb/internal/TimeoutSettingsTest.java index 71f63d32e6d..9bffd08542b 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/TimeoutSettingsTest.java +++ b/driver-core/src/test/unit/com/mongodb/internal/TimeoutSettingsTest.java @@ -53,10 +53,11 @@ Collection timeoutSettingsTest() { .withMaxAwaitTimeMS(11) .withMaxCommitMS(999L) .withReadTimeoutMS(11_000) + .withConnectTimeoutMS(500) .withWTimeoutMS(222L); assertAll( () -> assertEquals(30_000, timeoutSettings.getServerSelectionTimeoutMS()), - () -> assertEquals(10_000, timeoutSettings.getConnectTimeoutMS()), + () -> assertEquals(500, timeoutSettings.getConnectTimeoutMS()), () -> assertEquals(11_000, timeoutSettings.getReadTimeoutMS()), () -> assertEquals(100, timeoutSettings.getTimeoutMS()), () -> assertEquals(111, timeoutSettings.getMaxTimeMS()), diff --git a/driver-core/src/test/unit/com/mongodb/internal/async/SameThreadAsyncFunctionsTest.java b/driver-core/src/test/unit/com/mongodb/internal/async/SameThreadAsyncFunctionsTest.java index 04b9290af55..7dd4c0f37ac 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/async/SameThreadAsyncFunctionsTest.java +++ b/driver-core/src/test/unit/com/mongodb/internal/async/SameThreadAsyncFunctionsTest.java @@ -16,7 +16,7 @@ package com.mongodb.internal.async; -import org.jetbrains.annotations.NotNull; +import com.mongodb.lang.NonNull; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -62,7 +62,7 @@ void testInvalid() { private static class SameThreadExecutorService extends AbstractExecutorService { @Override - public void execute(@NotNull final Runnable command) { + public void execute(@NonNull final Runnable command) { command.run(); } @@ -70,7 +70,7 @@ public void execute(@NotNull final Runnable command) { public void shutdown() { } - @NotNull + @NonNull @Override public List shutdownNow() { return Collections.emptyList(); @@ -87,7 +87,7 @@ public boolean isTerminated() { } @Override - public boolean awaitTermination(final long timeout, @NotNull final TimeUnit unit) { + public boolean awaitTermination(final long timeout, @NonNull final TimeUnit unit) { return true; } } diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/AbstractConnectionPoolTest.java b/driver-core/src/test/unit/com/mongodb/internal/connection/AbstractConnectionPoolTest.java index 5b2cb1ab5f6..0cf8deb479d 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/AbstractConnectionPoolTest.java +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/AbstractConnectionPoolTest.java @@ -60,9 +60,6 @@ import org.mockito.Mockito; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -85,8 +82,8 @@ import static com.mongodb.assertions.Assertions.assertFalse; import static com.mongodb.internal.thread.InterruptionUtil.interruptAndCreateMongoInterruptedException; import static java.lang.String.format; -import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.Arrays.asList; +import static java.util.concurrent.TimeUnit.MILLISECONDS; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -96,7 +93,7 @@ import static org.mockito.Mockito.mock; // Implementation of -// https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst +// https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md // specification tests @SuppressWarnings("deprecation") @RunWith(Parameterized.class) @@ -126,6 +123,13 @@ public AbstractConnectionPoolTest( this.description = description; this.definition = definition; this.skipTest = skipTest; + + // Driver does not support interruptInUseConnections option See: JAVA-4536 + assumeFalse(fileName.equals("pool-clear-schedule-run-interruptInUseConnections-false.json")); + assumeFalse(fileName.equals("pool-clear-interrupting-pending-connections.json")); + + // Events out of order - the driver closes connection first then clears the pool. See: JAVA-5664 + assumeFalse(fileName.equals("pool-create-min-size-error.json")); } @Before @@ -566,16 +570,13 @@ protected ConnectionPool getPool() { } @Parameterized.Parameters(name = "{0}: {1}") - public static Collection data() throws URISyntaxException, IOException { + public static Collection data() { List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/connection-monitoring-and-pooling/cmap-format")) { - BsonDocument testDocument = JsonPoweredTestHelper.getTestDocument(file); - data.add(new Object[]{ - file.getName(), + for (BsonDocument testDocument + : JsonPoweredTestHelper.getSpecTestDocuments("connection-monitoring-and-pooling/tests/cmap-format")) { + data.add(new Object[]{testDocument.getString("fileName").getValue(), testDocument.getString("description").getValue(), - testDocument, - JsonTestServerVersionChecker.skipTest(testDocument, BsonDocument.parse("{}")) - }); + testDocument, JsonTestServerVersionChecker.skipTest(testDocument, BsonDocument.parse("{}"))}); } return data; } diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/AbstractServerDiscoveryAndMonitoringTest.java b/driver-core/src/test/unit/com/mongodb/internal/connection/AbstractServerDiscoveryAndMonitoringTest.java index 6fe76d0198a..514f5bde383 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/AbstractServerDiscoveryAndMonitoringTest.java +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/AbstractServerDiscoveryAndMonitoringTest.java @@ -35,9 +35,7 @@ import org.bson.BsonInt32; import util.JsonPoweredTestHelper; -import java.io.File; import java.io.IOException; -import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -60,11 +58,11 @@ public AbstractServerDiscoveryAndMonitoringTest(final BsonDocument definition) { this.definition = definition; } - public static Collection data(final String root) throws URISyntaxException, IOException { + public static Collection data(final String resourcePath) { List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles(root)) { - BsonDocument testDocument = JsonPoweredTestHelper.getTestDocument(file); - data.add(new Object[]{file.getName() + ": " + testDocument.getString("description").getValue(), testDocument}); + for (BsonDocument testDocument : JsonPoweredTestHelper.getSpecTestDocuments(resourcePath)) { + data.add(new Object[]{testDocument.getString("fileName").getValue() + + ": " + testDocument.getString("description").getValue(), testDocument}); } return data; } diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/BaseClusterSpecification.groovy b/driver-core/src/test/unit/com/mongodb/internal/connection/BaseClusterSpecification.groovy index 50f78639168..a509779d09f 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/BaseClusterSpecification.groovy +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/BaseClusterSpecification.groovy @@ -37,7 +37,7 @@ import com.mongodb.internal.selector.ServerAddressSelector import com.mongodb.internal.selector.WritableServerSelector import com.mongodb.internal.time.Timeout import spock.lang.Specification -import util.spock.annotations.Slow +import com.mongodb.spock.Slow import java.util.concurrent.CountDownLatch diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufSpecification.groovy b/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufSpecification.groovy index 0e0755f65bd..d052d6b23f1 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufSpecification.groovy +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufSpecification.groovy @@ -249,11 +249,7 @@ class ByteBufSpecification extends Specification { @Override ByteBuf getBuffer(final int size) { io.netty.buffer.ByteBuf buffer = allocator.directBuffer(size, size) - try { - new NettyByteBuf(buffer.retain()) - } finally { - buffer.release(); - } + new NettyByteBuf(buffer) } } } diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufTest.java b/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufTest.java new file mode 100644 index 00000000000..722d7d62fa4 --- /dev/null +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufTest.java @@ -0,0 +1,101 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.mongodb.internal.connection; + + +import org.bson.ByteBuf; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.assertEquals; + + +class ByteBufTest { + + static Stream bufferProviders() { + return Stream.of(new ByteBufSpecification.NettyBufferProvider(), new SimpleBufferProvider()); + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldPutInt(final BufferProvider provider) { + ByteBuf buffer = provider.getBuffer(1024); + try { + buffer.putInt(42); + buffer.flip(); + assertEquals(42, buffer.getInt()); + } finally { + buffer.release(); + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldPutLong(final BufferProvider provider) { + ByteBuf buffer = provider.getBuffer(1024); + try { + buffer.putLong(42L); + buffer.flip(); + assertEquals(42L, buffer.getLong()); + } finally { + buffer.release(); + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldPutDouble(final BufferProvider provider) { + ByteBuf buffer = provider.getBuffer(1024); + try { + buffer.putDouble(42.0D); + buffer.flip(); + assertEquals(42.0D, buffer.getDouble()); + } finally { + buffer.release(); + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldPutIntAtIndex(final BufferProvider provider) { + ByteBuf buffer = provider.getBuffer(1024); + try { + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + buffer.putInt(0); + buffer.put((byte) 43); + buffer.put((byte) 44); + buffer.putInt(0, 22); + buffer.putInt(4, 23); + buffer.putInt(8, 24); + buffer.putInt(12, 25); + buffer.flip(); + + assertEquals(22, buffer.getInt()); + assertEquals(23, buffer.getInt()); + assertEquals(24, buffer.getInt()); + assertEquals(25, buffer.getInt()); + assertEquals(43, buffer.get()); + assertEquals(44, buffer.get()); + } finally { + buffer.release(); + } + } +} diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufferBsonInputTest.java b/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufferBsonInputTest.java new file mode 100644 index 00000000000..0846f7a54f1 --- /dev/null +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufferBsonInputTest.java @@ -0,0 +1,719 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.mongodb.internal.connection; + +import com.google.common.primitives.Ints; +import com.mongodb.internal.connection.netty.NettyByteBuf; +import io.netty.buffer.PooledByteBufAllocator; +import org.bson.BsonSerializationException; +import org.bson.ByteBuf; +import org.bson.ByteBufNIO; +import org.bson.io.ByteBufferBsonInput; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +import static java.lang.Character.MAX_CODE_POINT; +import static java.lang.Character.MAX_LOW_SURROGATE; +import static java.lang.Character.MIN_HIGH_SURROGATE; +import static java.lang.Integer.reverseBytes; +import static java.lang.String.join; +import static java.util.Collections.nCopies; +import static java.util.stream.Collectors.toList; +import static java.util.stream.IntStream.range; +import static java.util.stream.IntStream.rangeClosed; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + + +class ByteBufferBsonInputTest { + + private static final List ALL_CODE_POINTS_EXCLUDING_SURROGATES = Stream.concat( + range(1, MIN_HIGH_SURROGATE).boxed(), + rangeClosed(MAX_LOW_SURROGATE + 1, MAX_CODE_POINT).boxed()) + .filter(i -> i < 128 || i % 10 == 0) // only subset of code points to speed up testing + .collect(toList()); + + static Stream bufferProviders() { + return Stream.of( + size -> new NettyByteBuf(PooledByteBufAllocator.DEFAULT.directBuffer(size)), + size -> new NettyByteBuf(PooledByteBufAllocator.DEFAULT.heapBuffer(size)), + new PowerOfTwoBufferPool(), + size -> new ByteBufNIO(ByteBuffer.wrap(new byte[size + 5], 2, size).slice()), //different array offsets + size -> new ByteBufNIO(ByteBuffer.wrap(new byte[size + 4], 3, size).slice()), //different array offsets + size -> new ByteBufNIO(ByteBuffer.allocateDirect(size)), + size -> new ByteBufNIO(ByteBuffer.allocate(size)) { + @Override + public boolean isBackedByArray() { + return false; + } + + @Override + public byte[] array() { + return Assertions.fail("array() is called, when isBackedByArray() returns false"); + } + + @Override + public int arrayOffset() { + return Assertions.fail("arrayOffset() is called, when isBackedByArray() returns false"); + } + } + ); + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadEmptyString(final BufferProvider bufferProvider) { + // given + byte[] input = {1, 0, 0, 0, 0}; + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, input); + + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + // when + String result = bufferInput.readString(); + + // then + assertEquals("", result); + assertEquals(5, bufferInput.getPosition()); + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadEmptyCString(final BufferProvider bufferProvider) { + // given + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, new byte[]{0}); + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + // when + String result = bufferInput.readCString(); + + // then + assertEquals("", result); + assertEquals(1, bufferInput.getPosition()); + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadInvalidOneByteString(final BufferProvider bufferProvider) { + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, new byte[]{2, 0, 0, 0, (byte) 0xFF, 0}); + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when + String result = bufferInput.readString(); + + // then + assertEquals("\uFFFD", result); + assertEquals(6, bufferInput.getPosition()); + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadInvalidOneByteCString(final BufferProvider bufferProvider) { + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, new byte[]{-0x01, 0}); + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when + String result = bufferInput.readCString(); + + // then + assertEquals("\uFFFD", result); + assertEquals(2, bufferInput.getPosition()); + } + } + + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadStringUptoBufferLimit(final BufferProvider bufferProvider) { + // given + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + for (int offset = 0; offset < 18; offset++) { + String expectedString = join("", nCopies(offset, "b")) + + String.valueOf(Character.toChars(codePoint)); + byte[] expectedStringEncoding = getExpectedEncodedString(expectedString); + + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, expectedStringEncoding); + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when + String actualString = bufferInput.readString(); + + // then + assertEquals(expectedString, actualString); + assertEquals(expectedStringEncoding.length, bufferInput.getPosition()); + } + } + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadStringWithMoreDataInBuffer(final BufferProvider bufferProvider) throws IOException { + // given + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + for (int offset = 0; offset < 18; offset++) { + String expectedString = join("", nCopies(offset, "b")) + + String.valueOf(Character.toChars(codePoint)); + byte[] expectedStringEncoding = getExpectedEncodedString(expectedString); + byte[] bufferBytes = mergeArrays( + expectedStringEncoding, + new byte[]{1, 2, 3} + ); + + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, bufferBytes); + + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when + String actualString = bufferInput.readString(); + + // then + assertEquals(expectedString, actualString); + assertEquals(expectedStringEncoding.length, bufferInput.getPosition()); + } + } + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadMultipleStringsWithinBuffer(final BufferProvider bufferProvider) throws IOException { + // given + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + for (int offset = 0; offset < 18; offset++) { + String expectedString1 = join("", nCopies(offset, "b")) + + String.valueOf(Character.toChars(codePoint)); + String expectedString2 = join("", nCopies(offset, "a")) + + String.valueOf(Character.toChars(codePoint)); + + byte[] expectedStringEncoding1 = getExpectedEncodedString(expectedString1); + byte[] expectedStringEncoding2 = getExpectedEncodedString(expectedString2); + int expectedInteger = 12412; + byte[] bufferBytes = mergeArrays( + new byte[]{1, 2, 3}, + expectedStringEncoding1, + Ints.toByteArray(reverseBytes(expectedInteger)), + expectedStringEncoding2, + new byte[]{1, 2, 3, 4} + ); + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, bufferBytes); + buffer.position(3); + + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + // when + String actualString1 = bufferInput.readString(); + + // then + assertEquals( + expectedString1, + actualString1); + assertEquals( + 3 + expectedStringEncoding1.length, + bufferInput.getPosition()); + + // when + assertEquals(expectedInteger, bufferInput.readInt32()); + + // then + String actualString2 = bufferInput.readString(); + assertEquals( + expectedString2, + actualString2); + assertEquals( + 3 + expectedStringEncoding1.length + expectedStringEncoding2.length + Integer.BYTES, + bufferInput.getPosition()); + } + } + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadConsecutiveMultipleStringsWithinBuffer(final BufferProvider bufferProvider) throws IOException { + // given + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + for (int offset = 0; offset < 18; offset++) { + String expectedString1 = join("", nCopies(offset, "b")) + + String.valueOf(Character.toChars(codePoint)); + String expectedString2 = join("", nCopies(offset, "a")) + + String.valueOf(Character.toChars(codePoint)); + + byte[] expectedStringEncoding1 = getExpectedEncodedString(expectedString1); + byte[] expectedStringEncoding2 = getExpectedEncodedString(expectedString2); + byte[] bufferBytes = mergeArrays( + new byte[]{1, 2, 3}, + expectedStringEncoding1, + expectedStringEncoding2, + new byte[]{1, 2, 3, 4} + ); + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, bufferBytes); + buffer.position(3); + + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + // when + String actualString1 = bufferInput.readString(); + + // then + assertEquals( + expectedString1, + actualString1); + assertEquals( + 3 + expectedStringEncoding1.length, + bufferInput.getPosition()); + + // when + String actualString2 = bufferInput.readString(); + + // then + assertEquals( + expectedString2, + actualString2); + assertEquals( + 3 + expectedStringEncoding1.length + expectedStringEncoding2.length, + bufferInput.getPosition()); + } + } + + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadConsecutiveMultipleCStringsWithinBuffer(final BufferProvider bufferProvider) throws IOException { + // given + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + for (int offset = 0; offset < 18; offset++) { + String expectedString1 = join("", nCopies(offset, "b")) + + String.valueOf(Character.toChars(codePoint)); + String expectedString2 = join("", nCopies(offset, "a")) + + String.valueOf(Character.toChars(codePoint)); + + byte[] expectedStringEncoding1 = getExpectedEncodedCString(expectedString1); + byte[] expectedStringEncoding2 = getExpectedEncodedCString(expectedString2); + byte[] bufferBytes = mergeArrays( + new byte[]{1, 2, 3}, + expectedStringEncoding1, + expectedStringEncoding2, + new byte[]{1, 2, 3, 4} + ); + + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, bufferBytes); + buffer.position(3); + + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + // when + String actualString1 = bufferInput.readCString(); + + // then + assertEquals( + expectedString1, + actualString1); + assertEquals( + 3 + expectedStringEncoding1.length, + bufferInput.getPosition()); + + // when + String actualString2 = bufferInput.readCString(); + + // then + assertEquals( + expectedString2, + actualString2); + assertEquals( + 3 + expectedStringEncoding1.length + expectedStringEncoding2.length, + bufferInput.getPosition()); + } + } + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadMultipleCStringsWithinBuffer(final BufferProvider bufferProvider) throws IOException { + // given + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + for (int offset = 0; offset < 18; offset++) { + String expectedString1 = join("", nCopies(offset, "b")) + + String.valueOf(Character.toChars(codePoint)); + String expectedString2 = join("", nCopies(offset, "a")) + + String.valueOf(Character.toChars(codePoint)); + + byte[] expectedStringEncoding1 = getExpectedEncodedCString(expectedString1); + byte[] expectedStringEncoding2 = getExpectedEncodedCString(expectedString2); + int expectedInteger = 12412; + byte[] bufferBytes = mergeArrays( + new byte[]{1, 2, 3}, + expectedStringEncoding1, + Ints.toByteArray(reverseBytes(expectedInteger)), + expectedStringEncoding2, + new byte[]{1, 2, 3, 4} + ); + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, bufferBytes); + buffer.position(3); + + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + // when + String actualString1 = bufferInput.readCString(); + + // then + assertEquals( + expectedString1, + actualString1); + assertEquals( + 3 + expectedStringEncoding1.length, + bufferInput.getPosition()); + + // when + int actualInteger = bufferInput.readInt32(); + + // then + assertEquals(expectedInteger, actualInteger); + + // when + String actualString2 = bufferInput.readCString(); + + // then + assertEquals( + expectedString2, + actualString2); + assertEquals( + 3 + expectedStringEncoding1.length + expectedStringEncoding2.length + Integer.BYTES, + bufferInput.getPosition()); + } + } + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadStringWithinBuffer(final BufferProvider bufferProvider) throws IOException { + // given + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + for (int offset = 0; offset < 18; offset++) { + String expectedString = join("", nCopies(offset, "b")) + + String.valueOf(Character.toChars(codePoint)); + + byte[] expectedStringEncoding = getExpectedEncodedString(expectedString); + byte[] bufferBytes = mergeArrays( + new byte[]{1, 2, 3}, + expectedStringEncoding, + new byte[]{4, 5, 6} + ); + + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, bufferBytes); + buffer.position(3); + + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when + String actualString = bufferInput.readString(); + + // then + assertEquals(expectedString, actualString); + assertEquals(3 + expectedStringEncoding.length, bufferInput.getPosition()); + } + } + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadCStringUptoBufferLimit(final BufferProvider bufferProvider) { + // given + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + for (int offset = 0; offset < 18; offset++) { + String expectedString = join("", nCopies(offset, "b")) + + String.valueOf(Character.toChars(codePoint)); + byte[] expectedStringEncoding = getExpectedEncodedCString(expectedString); + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, expectedStringEncoding); + + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when + String actualString = bufferInput.readCString(); + + // then + assertEquals(expectedString, actualString); + assertEquals(expectedStringEncoding.length, bufferInput.getPosition()); + } + } + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadCStringWithMoreDataInBuffer(final BufferProvider bufferProvider) throws IOException { + // given + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + for (int offset = 0; offset < 18; offset++) { + String expectedString = join("", nCopies(offset, "b")) + + String.valueOf(Character.toChars(codePoint)); + byte[] expectedStringEncoding = getExpectedEncodedCString(expectedString); + byte[] bufferBytes = mergeArrays( + expectedStringEncoding, + new byte[]{1, 2, 3} + ); + + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, bufferBytes); + + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when + String actualString = bufferInput.readCString(); + + // then + assertEquals(expectedString, actualString); + assertEquals(expectedStringEncoding.length, bufferInput.getPosition()); + } + } + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadCStringWithingBuffer(final BufferProvider bufferProvider) throws IOException { + // given + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + for (int offset = 0; offset < 18; offset++) { + //given + String expectedString = join("", nCopies(offset, "b")) + + String.valueOf(Character.toChars(codePoint)); + + byte[] expectedStringEncoding = getExpectedEncodedCString(expectedString); + byte[] bufferBytes = mergeArrays( + new byte[]{1, 2, 3}, + expectedStringEncoding, + new byte[]{4, 5, 6} + ); + + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, bufferBytes); + buffer.position(3); + + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + // when + String actualString = bufferInput.readCString(); + + // then + assertEquals(expectedString, actualString); + assertEquals(3 + expectedStringEncoding.length, bufferInput.getPosition()); + } + } + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldThrowIfCStringIsNotNullTerminatedSkip(final BufferProvider bufferProvider) { + // given + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, new byte[]{(byte) 0xe0, (byte) 0xa4, (byte) 0x80}); + try (ByteBufferBsonInput expectedString = new ByteBufferBsonInput(buffer)) { + + // when & then + assertThrows(BsonSerializationException.class, expectedString::skipCString); + } + } + + + public static Stream nonNullTerminatedStringsWithBuffers() { + List arguments = new ArrayList<>(); + List collect = bufferProviders().collect(toList()); + for (BufferProvider bufferProvider : collect) { + arguments.add(Arguments.of(new byte[]{1, 0, 0, 0, 1}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{2, 0, 0, 0, 1, 3}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{3, 0, 0, 1, 2, 3}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{4, 0, 0, 0, 1, 2, 3, 4}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{8, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{9, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 1}, bufferProvider)); + } + return arguments.stream(); + } + + @ParameterizedTest + @MethodSource("nonNullTerminatedStringsWithBuffers") + void shouldThrowIfStringIsNotNullTerminated(final byte[] nonNullTerminatedString, final BufferProvider bufferProvider) { + // given + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, nonNullTerminatedString); + try (ByteBufferBsonInput expectedString = new ByteBufferBsonInput(buffer)) { + + // when & then + assertThrows(BsonSerializationException.class, expectedString::readString); + } + } + + public static Stream nonNullTerminatedCStringsWithBuffers() { + List arguments = new ArrayList<>(); + List collect = bufferProviders().collect(toList()); + for (BufferProvider bufferProvider : collect) { + arguments.add(Arguments.of(new byte[]{1}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{1, 2}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{1, 2, 3}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{1, 2, 3, 4}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{2, 3, 4, 5, 6, 7, 8, 9}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{2, 3, 4, 5, 6, 7, 8, 9, 1}, bufferProvider)); + } + return arguments.stream(); + } + + @ParameterizedTest + @MethodSource("nonNullTerminatedCStringsWithBuffers") + void shouldThrowIfCStringIsNotNullTerminated(final byte[] nonNullTerminatedCString, final BufferProvider bufferProvider) { + // given + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, nonNullTerminatedCString); + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when & then + assertThrows(BsonSerializationException.class, bufferInput::readCString); + } + } + + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldThrowIfOneByteStringIsNotNullTerminated(final BufferProvider bufferProvider) { + // given + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, new byte[]{2, 0, 0, 0, 1}); + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when & then + assertThrows(BsonSerializationException.class, bufferInput::readString); + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldThrowIfOneByteCStringIsNotNullTerminated(final BufferProvider bufferProvider) { + // given + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, new byte[]{1}); + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when & then + assertThrows(BsonSerializationException.class, bufferInput::readCString); + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldThrowIfLengthOfBsonStringIsNotPositive(final BufferProvider bufferProvider) { + // given + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, new byte[]{-1, -1, -1, -1, 41, 42, 43, 0}); + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when & then + assertThrows(BsonSerializationException.class, bufferInput::readString); + } + } + + public static Stream shouldSkipCStringWhenMultipleNullTerminationPresent() { + List arguments = new ArrayList<>(); + List collect = bufferProviders().collect(toList()); + for (BufferProvider bufferProvider : collect) { + arguments.add(Arguments.of(new byte[]{0, 8, 0, 0, 0}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{0x4a, 0, 8, 0, 0, 0}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{0x4a, 0x4b, 0, 8, 0, 0, 0}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{0x4a, 0x4b, 0x4c, 0, 8, 0, 0, 0}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{0x4a, 0x61, 0x76, 0x61, 0, 8, 0, 0, 0}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{0x4a, 0x61, 0x76, 0x61, 0x62, 0, 8, 0, 0, 0}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{0x4a, 0x61, 0x76, 0x61, 0x65, 0x62, 0x67, 0, 8, 0, 0, 0}, bufferProvider)); + arguments.add(Arguments.of(new byte[]{0x4a, 0, 8, 0, 0, 0}, bufferProvider)); + } + return arguments.stream(); + } + + @ParameterizedTest + @MethodSource() + void shouldSkipCStringWhenMultipleNullTerminationPresent(final byte[] cStringBytes, final BufferProvider bufferProvider) { + // given + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, cStringBytes); + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when + bufferInput.skipCString(); + + //then + assertEquals(cStringBytes.length - Integer.BYTES, bufferInput.getPosition()); + assertEquals(8, bufferInput.readInt32()); + } + } + + @ParameterizedTest + @MethodSource("bufferProviders") + void shouldReadSkipCStringWhenMultipleNullTerminationPresentWithinBuffer(final BufferProvider bufferProvider) { + // given + byte[] input = {4, 0, 0, 0, 0x4a, 0x61, 0x76, 0x61, 0, 8, 0, 0, 0}; + ByteBuf buffer = allocateAndWriteToBuffer(bufferProvider, input); + buffer.position(4); + try (ByteBufferBsonInput bufferInput = new ByteBufferBsonInput(buffer)) { + + // when + bufferInput.skipCString(); + + // then + assertEquals(9, bufferInput.getPosition()); + assertEquals(8, bufferInput.readInt32()); + } + } + + + private static ByteBuf allocateAndWriteToBuffer(final BufferProvider bufferProvider, final byte[] input) { + ByteBuf buffer = bufferProvider.getBuffer(input.length); + buffer.put(input, 0, input.length); + buffer.flip(); + return buffer; + } + + + public static byte[] mergeArrays(final byte[]... arrays) throws IOException { + int size = 0; + for (byte[] array : arrays) { + size += array.length; + } + ByteArrayOutputStream baos = new ByteArrayOutputStream(size); + for (byte[] array : arrays) { + baos.write(array); + } + return baos.toByteArray(); + } + + private static byte[] getExpectedEncodedString(final String expectedString) { + byte[] expectedEncoding = expectedString.getBytes(StandardCharsets.UTF_8); + int littleEndianLength = reverseBytes(expectedEncoding.length + "\u0000".length()); + byte[] length = Ints.toByteArray(littleEndianLength); + + byte[] combined = new byte[expectedEncoding.length + length.length + 1]; + System.arraycopy(length, 0, combined, 0, length.length); + System.arraycopy(expectedEncoding, 0, combined, length.length, expectedEncoding.length); + return combined; + } + + private static byte[] getExpectedEncodedCString(final String expectedString) { + byte[] encoding = expectedString.getBytes(StandardCharsets.UTF_8); + byte[] combined = new byte[encoding.length + 1]; + System.arraycopy(encoding, 0, combined, 0, encoding.length); + return combined; + } +} diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufferBsonOutputTest.java b/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufferBsonOutputTest.java index 3a8a2c83acb..4ab076dd5dd 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufferBsonOutputTest.java +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/ByteBufferBsonOutputTest.java @@ -16,14 +16,21 @@ package com.mongodb.internal.connection; -import com.mongodb.assertions.Assertions; +import com.google.common.primitives.Ints; +import com.mongodb.internal.connection.netty.NettyByteBuf; +import io.netty.buffer.PooledByteBufAllocator; import org.bson.BsonSerializationException; import org.bson.ByteBuf; +import org.bson.ByteBufNIO; +import org.bson.io.OutputBuffer; import org.bson.types.ObjectId; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; import java.io.ByteArrayOutputStream; @@ -31,20 +38,83 @@ import java.nio.ByteBuffer; import java.nio.charset.CharacterCodingException; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; import java.util.concurrent.ThreadLocalRandom; import java.util.function.BiConsumer; import java.util.function.Consumer; +import java.util.stream.Stream; import static com.mongodb.internal.connection.ByteBufferBsonOutput.INITIAL_BUFFER_SIZE; import static com.mongodb.internal.connection.ByteBufferBsonOutput.MAX_BUFFER_SIZE; +import static java.lang.Character.MAX_CODE_POINT; +import static java.lang.Character.MAX_HIGH_SURROGATE; +import static java.lang.Character.MAX_LOW_SURROGATE; +import static java.lang.Character.MIN_HIGH_SURROGATE; +import static java.lang.Character.MIN_LOW_SURROGATE; +import static java.lang.Integer.reverseBytes; +import static java.lang.String.format; import static java.util.Arrays.asList; import static java.util.Arrays.copyOfRange; +import static java.util.Collections.emptyList; import static java.util.stream.Collectors.toList; +import static java.util.stream.IntStream.range; +import static java.util.stream.IntStream.rangeClosed; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; final class ByteBufferBsonOutputTest { + + private static final List ALL_CODE_POINTS_EXCLUDING_SURROGATES = Stream.concat( + range(1, MIN_HIGH_SURROGATE).boxed(), + rangeClosed(MAX_LOW_SURROGATE + 1, MAX_CODE_POINT).boxed()) + .collect(toList()); + private static final List ALL_SURROGATE_CODE_POINTS = Stream.concat( + range(MIN_LOW_SURROGATE, MAX_LOW_SURROGATE).boxed(), + range(MIN_HIGH_SURROGATE, MAX_HIGH_SURROGATE).boxed()).collect(toList()); + public static final List ALL_UTF_16_CODE_POINTS_FORMED_BY_SURROGATE_PAIRS = rangeClosed(0x10000, MAX_CODE_POINT) + .boxed() + .collect(toList()); + + static Stream bufferProviders() { + return Stream.of( + size -> new NettyByteBuf(PooledByteBufAllocator.DEFAULT.directBuffer(size)), + size -> new NettyByteBuf(PooledByteBufAllocator.DEFAULT.heapBuffer(size)), + new PowerOfTwoBufferPool(), + size -> new ByteBufNIO(ByteBuffer.wrap(new byte[size + 5], 2, size).slice()), //different array offsets + size -> new ByteBufNIO(ByteBuffer.wrap(new byte[size + 4], 3, size).slice()), //different array offsets + size -> new ByteBufNIO(ByteBuffer.allocate(size)) { + @Override + public boolean isBackedByArray() { + return false; + } + + @Override + public byte[] array() { + return Assertions.fail("array() is called, when isBackedByArray() returns false"); + } + + @Override + public int arrayOffset() { + return Assertions.fail("arrayOffset() is called, when isBackedByArray() returns false"); + } + } + ); + } + + public static Stream bufferProvidersWithBranches() { + List arguments = new ArrayList<>(); + List collect = bufferProviders().collect(toList()); + for (BufferProvider bufferProvider : collect) { + arguments.add(Arguments.of(true, bufferProvider)); + arguments.add(Arguments.of(false, bufferProvider)); + } + return arguments.stream(); + } + + @DisplayName("constructor should throw if buffer provider is null") @Test @SuppressWarnings("try") @@ -82,7 +152,7 @@ void positionAndSizeShouldBe0AfterConstructor(final String branchState) { break; } default: { - throw Assertions.fail(branchState); + throw com.mongodb.assertions.Assertions.fail(branchState); } } assertEquals(0, out.getPosition()); @@ -92,9 +162,9 @@ void positionAndSizeShouldBe0AfterConstructor(final String branchState) { @DisplayName("should write a byte") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteByte(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteByte(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { byte v = 11; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -109,11 +179,56 @@ void shouldWriteByte(final boolean useBranch) { } } - @DisplayName("should write a bytes") + @DisplayName("should write byte at position") @ParameterizedTest @ValueSource(booleans = {false, true}) - void shouldWriteBytes(final boolean useBranch) { + void shouldWriteByteAtPosition(final boolean useBranch) { + for (int offset = 0; offset < 5; offset++) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + byte v = 11; + byte[] byteToWrite = {1, 2, 3, 4, 5}; + if (useBranch) { + try (ByteBufferBsonOutput.Branch branch = out.branch()) { + branch.writeBytes(byteToWrite); + branch.write(offset, v); + } + } else { + out.writeBytes(byteToWrite); + out.write(offset, v); + } + byteToWrite[offset] = v; + assertArrayEquals(byteToWrite, out.toByteArray()); + assertEquals(5, out.getPosition()); + assertEquals(5, out.size()); + + } + } + } + + @DisplayName("should throw exception when writing byte at invalid position") + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void shouldThrowExceptionWhenWriteByteAtInvalidPosition(final boolean useBranch) { try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + byte v = 11; + byte[] byteToWrite = {1, 2, 3, 4, 5}; + if (useBranch) { + try (ByteBufferBsonOutput.Branch branch = out.branch()) { + out.writeBytes(byteToWrite); + assertThrows(IllegalArgumentException.class, () -> branch.write(-1, v)); + } + } else { + out.writeBytes(byteToWrite); + assertThrows(IllegalArgumentException.class, () -> out.write(-1, v)); + } + } + } + + @DisplayName("should write a bytes") + @ParameterizedTest + @MethodSource("bufferProvidersWithBranches") + void shouldWriteBytes(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { byte[] v = {1, 2, 3, 4}; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -130,9 +245,9 @@ void shouldWriteBytes(final boolean useBranch) { @DisplayName("should write bytes from offset until length") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteBytesFromOffsetUntilLength(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteBytesFromOffsetUntilLength(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { byte[] v = {0, 1, 2, 3, 4, 5}; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -149,9 +264,9 @@ void shouldWriteBytesFromOffsetUntilLength(final boolean useBranch) { @DisplayName("should write a little endian Int32") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteLittleEndianInt32(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteLittleEndianInt32(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { int v = 0x1020304; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -168,9 +283,9 @@ void shouldWriteLittleEndianInt32(final boolean useBranch) { @DisplayName("should write a little endian Int64") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteLittleEndianInt64(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteLittleEndianInt64(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { long v = 0x102030405060708L; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -187,9 +302,9 @@ void shouldWriteLittleEndianInt64(final boolean useBranch) { @DisplayName("should write a double") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteDouble(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteDouble(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { double v = Double.longBitsToDouble(0x102030405060708L); if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -206,9 +321,9 @@ void shouldWriteDouble(final boolean useBranch) { @DisplayName("should write an ObjectId") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteObjectId(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteObjectId(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { byte[] objectIdAsByteArray = {12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; ObjectId v = new ObjectId(objectIdAsByteArray); if (useBranch) { @@ -226,9 +341,9 @@ void shouldWriteObjectId(final boolean useBranch) { @DisplayName("should write an empty string") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteEmptyString(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteEmptyString(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { String v = ""; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -245,9 +360,9 @@ void shouldWriteEmptyString(final boolean useBranch) { @DisplayName("should write an ASCII string") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteAsciiString(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteAsciiString(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { String v = "Java"; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -264,9 +379,9 @@ void shouldWriteAsciiString(final boolean useBranch) { @DisplayName("should write a UTF-8 string") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteUtf8String(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteUtf8String(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { String v = "\u0900"; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -283,9 +398,9 @@ void shouldWriteUtf8String(final boolean useBranch) { @DisplayName("should write an empty CString") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteEmptyCString(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteEmptyCString(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { String v = ""; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -302,9 +417,9 @@ void shouldWriteEmptyCString(final boolean useBranch) { @DisplayName("should write an ASCII CString") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteAsciiCString(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteAsciiCString(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { String v = "Java"; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -321,9 +436,9 @@ void shouldWriteAsciiCString(final boolean useBranch) { @DisplayName("should write a UTF-8 CString") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteUtf8CString(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteUtf8CString(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { String v = "\u0900"; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -340,9 +455,9 @@ void shouldWriteUtf8CString(final boolean useBranch) { @DisplayName("should get byte buffers as little endian") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldGetByteBuffersAsLittleEndian(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldGetByteBuffersAsLittleEndian(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { byte[] v = {1, 0, 0, 0}; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -357,9 +472,9 @@ void shouldGetByteBuffersAsLittleEndian(final boolean useBranch) { @DisplayName("null character in CString should throw SerializationException") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void nullCharacterInCStringShouldThrowSerializationException(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void nullCharacterInCStringShouldThrowSerializationException(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { String v = "hell\u0000world"; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -373,9 +488,9 @@ void nullCharacterInCStringShouldThrowSerializationException(final boolean useBr @DisplayName("null character in String should not throw SerializationException") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void nullCharacterInStringShouldNotThrowSerializationException(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void nullCharacterInStringShouldNotThrowSerializationException(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { String v = "h\u0000i"; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -388,11 +503,25 @@ void nullCharacterInStringShouldNotThrowSerializationException(final boolean use } } + + public static Stream writeInt32AtPositionShouldThrowWithInvalidPosition() { + return bufferProvidersWithBranches().flatMap(arguments -> { + Object[] args = arguments.get(); + boolean useBranch = (boolean) args[0]; + BufferProvider bufferProvider = (BufferProvider) args[1]; + return Stream.of( + Arguments.of(useBranch, -1, bufferProvider), + Arguments.of(useBranch, 1, bufferProvider) + ); + }); + } + @DisplayName("write Int32 at position should throw with invalid position") @ParameterizedTest - @CsvSource({"false, -1", "false, 1", "true, -1", "true, 1"}) - void writeInt32AtPositionShouldThrowWithInvalidPosition(final boolean useBranch, final int position) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource + void writeInt32AtPositionShouldThrowWithInvalidPosition(final boolean useBranch, final int position, + final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { byte[] v = {1, 2, 3, 4}; int v2 = 0x1020304; if (useBranch) { @@ -409,9 +538,9 @@ void writeInt32AtPositionShouldThrowWithInvalidPosition(final boolean useBranch, @DisplayName("should write Int32 at position") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldWriteInt32AtPosition(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldWriteInt32AtPosition(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { Consumer lastAssertions = effectiveOut -> { assertArrayEquals(new byte[] {4, 3, 2, 1}, copyOfRange(effectiveOut.toByteArray(), 1023, 1027), "the position is not in the first buffer"); assertEquals(1032, effectiveOut.getPosition()); @@ -442,9 +571,22 @@ void shouldWriteInt32AtPosition(final boolean useBranch) { } } + public static Stream truncateShouldThrowWithInvalidPosition() { + return bufferProvidersWithBranches().flatMap(arguments -> { + Object[] args = arguments.get(); + boolean useBranch = (boolean) args[0]; + BufferProvider bufferProvider = (BufferProvider) args[1]; + return Stream.of( + Arguments.of(useBranch, -1, bufferProvider), + Arguments.of(useBranch, 5, bufferProvider) + ); + } + ); + } + @DisplayName("truncate should throw with invalid position") @ParameterizedTest - @CsvSource({"false, -1", "false, 5", "true, -1", "true, 5"}) + @MethodSource void truncateShouldThrowWithInvalidPosition(final boolean useBranch, final int position) { try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { byte[] v = {1, 2, 3, 4}; @@ -462,9 +604,9 @@ void truncateShouldThrowWithInvalidPosition(final boolean useBranch, final int p @DisplayName("should truncate to position") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldTruncateToPosition(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldTruncateToPosition(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { byte[] v = {1, 2, 3, 4}; byte[] v2 = new byte[1024]; if (useBranch) { @@ -486,15 +628,23 @@ void shouldTruncateToPosition(final boolean useBranch) { @DisplayName("should grow to maximum allowed size of byte buffer") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldGrowToMaximumAllowedSizeOfByteBuffer(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldGrowToMaximumAllowedSizeOfByteBuffer(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { byte[] v = new byte[0x2000000]; ThreadLocalRandom.current().nextBytes(v); - Consumer assertByteBuffers = effectiveOut -> assertEquals( - asList(1 << 10, 1 << 11, 1 << 12, 1 << 13, 1 << 14, 1 << 15, 1 << 16, 1 << 17, 1 << 18, 1 << 19, 1 << 20, - 1 << 21, 1 << 22, 1 << 23, 1 << 24, 1 << 24), - effectiveOut.getByteBuffers().stream().map(ByteBuf::capacity).collect(toList())); + Consumer assertByteBuffers = effectiveOut -> { + List byteBuffers = new ArrayList<>(); + try { + byteBuffers = effectiveOut.getByteBuffers(); + assertEquals( + asList(1 << 10, 1 << 11, 1 << 12, 1 << 13, 1 << 14, 1 << 15, 1 << 16, 1 << 17, 1 << 18, 1 << 19, 1 << 20, + 1 << 21, 1 << 22, 1 << 23, 1 << 24, 1 << 24), + byteBuffers.stream().map(ByteBuf::capacity).collect(toList())); + } finally { + byteBuffers.forEach(ByteBuf::release); + } + }; Consumer assertions = effectiveOut -> { effectiveOut.writeBytes(v); assertEquals(v.length, effectiveOut.size()); @@ -520,9 +670,9 @@ void shouldGrowToMaximumAllowedSizeOfByteBuffer(final boolean useBranch) { @DisplayName("should pipe") @ParameterizedTest - @ValueSource(booleans = {false, true}) - void shouldPipe(final boolean useBranch) throws IOException { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + @MethodSource("bufferProvidersWithBranches") + void shouldPipe(final boolean useBranch, final BufferProvider bufferProvider) throws IOException { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { byte[] v = new byte[1027]; BiConsumer assertions = (effectiveOut, baos) -> { assertArrayEquals(v, baos.toByteArray()); @@ -556,10 +706,10 @@ void shouldPipe(final boolean useBranch) throws IOException { @DisplayName("should close") @ParameterizedTest - @ValueSource(booleans = {false, true}) + @MethodSource("bufferProvidersWithBranches") @SuppressWarnings("try") - void shouldClose(final boolean useBranch) { - try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(new SimpleBufferProvider())) { + void shouldClose(final boolean useBranch, final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput out = new ByteBufferBsonOutput(bufferProvider)) { byte[] v = new byte[1027]; if (useBranch) { try (ByteBufferBsonOutput.Branch branch = out.branch()) { @@ -622,4 +772,828 @@ void shouldHandleMixedBranchingAndTruncating(final int reps) throws CharacterCod assertEquals(expected.toString(), StandardCharsets.UTF_8.newDecoder().decode(ByteBuffer.wrap(out.toByteArray())).toString()); } } + + @ParameterizedTest + @DisplayName("should throw exception when calling writeInt32 at absolute position where integer would not fit") + @MethodSource("bufferProviders") + void shouldThrowExceptionWhenIntegerDoesNotFitWriteInt32(final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput output = new ByteBufferBsonOutput(bufferProvider)) { + // Write 10 bytes (position becomes 10) + for (int i = 0; i < 10; i++) { + output.writeByte(0); + } + + // absolutePosition = 7 would require bytes at positions 7,8,9,10, but the last written element was at 9. + assertThrows(IllegalArgumentException.class, () -> + output.writeInt32(7, 5678) + ); + } + } + + @ParameterizedTest + @DisplayName("should throw exception when calling writeInt32 with negative absolute position") + @MethodSource("bufferProviders") + void shouldThrowExceptionWhenAbsolutePositionIsNegative(final BufferProvider bufferProvider) { + try (ByteBufferBsonOutput output = new ByteBufferBsonOutput(bufferProvider)) { + Assertions.assertThrows(IllegalArgumentException.class, () -> + output.writeInt32(-1, 5678) + ); + } + } + + static Stream shouldWriteInt32AbsoluteValueWithinSpanningBuffers() { + return bufferProviders().flatMap(bufferProvider -> Stream.of( + Arguments.of( + 0, // absolute position + 0x09080706, // int value + asList( + // initial data + new byte[]{0, 1, 2, 3}, + new byte[]{4, 5, 6, 7}), + asList( + // expected BsonByteBufferOutput data + new byte[]{0x06, 0x07, 0x08, 0x09}, + new byte[]{4, 5, 6, 7}), + bufferProvider // buffer to write data to + ), + Arguments.of(1, 0x09080706, + asList(new byte[]{0, 1, 2, 3}, new byte[]{4, 5, 6, 7}), + asList(new byte[]{0, 0x06, 0x07, 0x08}, new byte[]{0x09, 5, 6, 7}), + bufferProvider), + Arguments.of(2, 0x09080706, + asList(new byte[]{0, 1, 2, 3}, new byte[]{4, 5, 6, 7}), + asList(new byte[]{0, 1, 0x06, 0x07}, new byte[]{0x08, 0x09, 6, 7}), + bufferProvider + ), + Arguments.of(3, 0x09080706, + asList(new byte[]{0, 1, 2, 3}, new byte[]{4, 5, 6, 7}), + asList(new byte[]{0, 1, 2, 0x06}, new byte[]{0x07, 0x08, 0x09, 7}), + bufferProvider + ), + Arguments.of(4, 0x09080706, + asList(new byte[]{0, 1, 2, 3}, new byte[]{4, 5, 6, 7}), + asList(new byte[]{0, 1, 2, 3}, new byte[]{0x06, 0x07, 0x08, 0x09}), + bufferProvider + ))); + } + + @ParameterizedTest + @MethodSource + void shouldWriteInt32AbsoluteValueWithinSpanningBuffers( + final int absolutePosition, + final int intValue, + final List initialData, + final List expectedBuffers, + final BufferProvider bufferProvider) { + + List buffers = new ArrayList<>(); + try (ByteBufferBsonOutput output = new ByteBufferBsonOutput(size -> bufferProvider.getBuffer(Integer.BYTES))) { + + //given + initialData.forEach(output::writeBytes); + + //when + output.writeInt32(absolutePosition, intValue); + + //then + buffers = output.getByteBuffers(); + assertEquals(expectedBuffers.size(), buffers.size(), "Number of buffers mismatch"); + assertBufferContents(expectedBuffers, buffers); + } finally { + buffers.forEach(ByteBuf::release); + } + } + + static Stream int32SpanningBuffersData() { + return bufferProviders().flatMap(bufferProvider -> Stream.of( + // Test case 1: No initial data; entire int written into one buffer. + Arguments.of(0x09080706, + asList( + // No initial data + ), + asList( + // expected BsonByteBufferOutput data + new byte[]{0x06, 0x07, 0x08, 0x09}), + 4, // expected overall position after write (0 + 4) + 4, // expected last buffer position (buffer fully written) + bufferProvider //buffer to write data to + ), + Arguments.of(0x09080706, + asList(new byte[]{0}), + asList(new byte[]{0, 0x06, 0x07, 0x08}, new byte[]{0x09, 0, 0, 0}), 5, 1, + bufferProvider + ), + Arguments.of(0x09080706, + asList(new byte[]{0, 1}), + asList(new byte[]{0, 1, 0x06, 0x07}, new byte[]{0x08, 0x09, 0, 0}), 6, 2, + bufferProvider + ), + Arguments.of(0x09080706, + asList(new byte[]{0, 1, 2}), + asList(new byte[]{0, 1, 2, 0x06}, new byte[]{0x07, 0x08, 0x09, 0}), 7, 3, + bufferProvider + ), + Arguments.of(0x09080706, + asList(new byte[]{0, 1, 2, 3}), + asList(new byte[]{0, 1, 2, 3}, new byte[]{0x06, 0x07, 0x08, 0x09}), 8, 4, + bufferProvider + ))); + } + + static Stream int64SpanningBuffersData() { + return bufferProviders().flatMap(bufferProvider -> Stream.of( + // Test case 1: No initial data; entire long written into one buffer. + Arguments.of(0x0A0B0C0D0E0F1011L, + asList( + // No initial data + ), + asList( + // expected BsonByteBufferOutput data + new byte[]{0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A} + ), + 8, // expected overall position after write (0 + 8) + 8, // expected last buffer position (buffer fully written) + bufferProvider //buffer to write data to + ), + Arguments.of(0x0A0B0C0D0E0F1011L, + asList(new byte[]{0}), + asList(new byte[]{0, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B}, new byte[]{0x0A, 0, 0, 0, 0, 0, 0, 0}), + 9, 1, + bufferProvider + ), + Arguments.of(0x0A0B0C0D0E0F1011L, + asList(new byte[]{0, 1}), + asList(new byte[]{0, 1, 0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C}, new byte[]{0x0B, 0x0A, 0, 0, 0, 0, 0, 0}), + 10, 2, + bufferProvider + ), + Arguments.of(0x0A0B0C0D0E0F1011L, + asList(new byte[]{0, 1, 2}), + asList(new byte[]{0, 1, 2, 0x11, 0x10, 0x0F, 0x0E, 0x0D}, new byte[]{0x0C, 0x0B, 0x0A, 0, 0, 0, 0, 0}), + 11, 3, + bufferProvider + ), + Arguments.of(0x0A0B0C0D0E0F1011L, + asList(new byte[]{0, 1, 2, 3}), + asList(new byte[]{0, 1, 2, 3, 0x11, 0x10, 0x0F, 0x0E}, new byte[]{0x0D, 0x0C, 0x0B, 0x0A, 0, 0, 0, 0}), + 12, 4, + bufferProvider + ), + Arguments.of(0x0A0B0C0D0E0F1011L, + asList(new byte[]{0, 1, 2, 3, 4}), + asList(new byte[]{0, 1, 2, 3, 4, 0x11, 0x10, 0x0F}, new byte[]{0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0, 0, 0}), + 13, 5, + bufferProvider + ), + Arguments.of(0x0A0B0C0D0E0F1011L, + asList(new byte[]{0, 1, 2, 3, 4, 5}), + asList(new byte[]{0, 1, 2, 3, 4, 5, 0x11, 0x10}, new byte[]{0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0, 0}), + 14, 6, + bufferProvider + ), Arguments.of(0x0A0B0C0D0E0F1011L, + asList(new byte[]{0, 1, 2, 3, 4, 5, 6}), + asList(new byte[]{0, 1, 2, 3, 4, 5, 6, 0x11}, new byte[]{0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0}), + 15, 7, + bufferProvider + ), + Arguments.of(0x0A0B0C0D0E0F1011L, + asList(new byte[]{0, 1, 2, 3, 4, 5, 6, 7}), + asList(new byte[]{0, 1, 2, 3, 4, 5, 6, 7}, new byte[]{0x11, 0x10, 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A}), + 16, 8, + bufferProvider + ))); + } + + @ParameterizedTest + @MethodSource("int32SpanningBuffersData") + void shouldWriteInt32WithinSpanningBuffers( + final int intValue, + final List initialData, + final List expectedBuffers, + final int expectedOutputPosition, + final int expectedLastBufferPosition, + final BufferProvider bufferProvider) { + + try (ByteBufferBsonOutput output = + new ByteBufferBsonOutput(size -> bufferProvider.getBuffer(Integer.BYTES))) { + + //given + initialData.forEach(output::writeBytes); + + //when + output.writeInt32(intValue); + + //then + //getByteBuffers returns ByteBuffers with limit() set to position, position set to 0. + List buffers = output.getByteBuffers(); + assertEquals(expectedBuffers.size(), buffers.size(), "Number of buffers mismatch"); + assertBufferContents(expectedBuffers, buffers); + + assertEquals(expectedLastBufferPosition, buffers.get(buffers.size() - 1).limit()); + assertEquals(expectedOutputPosition, output.getPosition()); + } + } + + @ParameterizedTest + @MethodSource("int64SpanningBuffersData") + void shouldWriteInt64WithinSpanningBuffers( + final long intValue, + final List initialData, + final List expectedBuffers, + final int expectedOutputPosition, + final int expectedLastBufferPosition, + final BufferProvider bufferProvider) { + + try (ByteBufferBsonOutput output = + new ByteBufferBsonOutput(size -> bufferProvider.getBuffer(Long.BYTES))) { + + //given + initialData.forEach(output::writeBytes); + + //when + output.writeInt64(intValue); + + //then + //getByteBuffers returns ByteBuffers with limit() set to position, position set to 0. + List buffers = output.getByteBuffers(); + assertEquals(expectedBuffers.size(), buffers.size(), "Number of buffers mismatch"); + assertBufferContents(expectedBuffers, buffers); + + assertEquals(expectedLastBufferPosition, buffers.get(buffers.size() - 1).limit()); + assertEquals(expectedOutputPosition, output.getPosition()); + } + } + + @ParameterizedTest + @MethodSource("int64SpanningBuffersData") + void shouldWriteDoubleWithinSpanningBuffers( + final long intValue, + final List initialData, + final List expectedBuffers, + final int expectedOutputPosition, + final int expectedLastBufferPosition, + final BufferProvider bufferProvider) { + + try (ByteBufferBsonOutput output = + new ByteBufferBsonOutput(size -> bufferProvider.getBuffer(Long.BYTES))) { + + //given + initialData.forEach(output::writeBytes); + + //when + output.writeDouble(Double.longBitsToDouble(intValue)); + + //then + //getByteBuffers returns ByteBuffers with limit() set to position, position set to 0. + List buffers = output.getByteBuffers(); + assertEquals(expectedBuffers.size(), buffers.size(), "Number of buffers mismatch"); + assertBufferContents(expectedBuffers, buffers); + + assertEquals(expectedLastBufferPosition, buffers.get(buffers.size() - 1).limit()); + assertEquals(expectedOutputPosition, output.getPosition()); + } + } + + private static void assertBufferContents(final List expectedBuffersContent, + final List actualByteBuffers) { + for (int i = 0; i < expectedBuffersContent.size(); i++) { + ByteBuf byteBuf = actualByteBuffers.get(i); + byte[] expectedBufferBytes = expectedBuffersContent.get(i); + byte[] actualBufferBytes = + new byte[byteBuf.capacity()]; //capacity is used because we want to compare internal ByteBuffer arrays. + byteBuf.get(actualBufferBytes, 0, byteBuf.limit()); + + assertEquals(expectedBufferBytes.length, byteBuf.capacity()); + assertArrayEquals(expectedBufferBytes, actualBufferBytes, + "Buffer " + i + " contents mismatch"); + } + } + + /* + Tests that all Unicode code points are correctly encoded in UTF-8 when: + - The buffer has just enough capacity for the UTF-8 string plus a null terminator. + - The encoded string may span multiple buffers. + + To test edge conditions, the test writes a UTF-8 CString/String at various starting offsets. This simulates scenarios where data + doesn't start at index 0, forcing the string to span multiple buffers. + + For example, assume the encoded string requires N bytes and null terminator: + 1. startingOffset == 0: + [ S S S ... S NULL ] + + 2. startingOffset == 2: + ("X" represents dummy bytes written before the string.) + Buffer 1: [ X X | S S S ... ] (Buffer 1 runs out of space, the remaining bytes (including the NULL) are written in Buffer 2.) + Buffer 2: [ S NULL ...] + + 3. startingOffset == bufferAllocationSize: + Buffer 1: [ X X X ... X ] + Buffer 2: [ S S S ... S NULL ] + */ + @Nested + @DisplayName("UTF-8 String and CString Buffer Boundary Tests") + class Utf8StringTests { + + @DisplayName("should write UTF-8 CString across buffers") + @ParameterizedTest + @MethodSource("com.mongodb.internal.connection.ByteBufferBsonOutputTest#bufferProviders") + void shouldWriteCStringAcrossBuffersUTF8(final BufferProvider bufferProvider) throws IOException { + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + String stringToEncode = new String(Character.toChars(codePoint)) + "a"; + byte[] expectedStringEncoding = stringToEncode.getBytes(StandardCharsets.UTF_8); + int bufferAllocationSize = expectedStringEncoding.length + "\u0000".length(); + testWriteCStringAcrossBuffers(bufferProvider, codePoint, bufferAllocationSize, stringToEncode, expectedStringEncoding); + } + } + + @DisplayName("should write UTF-8 CString across buffers with a branch") + @ParameterizedTest + @MethodSource("com.mongodb.internal.connection.ByteBufferBsonOutputTest#bufferProviders") + void shouldWriteCStringAcrossBuffersUTF8WithBranch(final BufferProvider bufferProvider) throws IOException { + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + String stringToEncode = new String(Character.toChars(codePoint)) + "a"; + int bufferAllocationSize = stringToEncode.getBytes(StandardCharsets.UTF_8).length + "\u0000".length(); + byte[] expectedEncoding = stringToEncode.getBytes(StandardCharsets.UTF_8); + + testWriteCStringAcrossBufferWithBranch(bufferProvider, codePoint, bufferAllocationSize, stringToEncode, expectedEncoding); + } + } + + @DisplayName("should write UTF-8 String across buffers") + @ParameterizedTest + @MethodSource("com.mongodb.internal.connection.ByteBufferBsonOutputTest#bufferProviders") + void shouldWriteStringAcrossBuffersUTF8(final BufferProvider bufferProvider) throws IOException { + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + // given + String stringToEncode = new String(Character.toChars(codePoint)) + "a"; + //4 bytes for the length prefix, bytes for encoded String, and 1 byte for the null terminator + int bufferAllocationSize = Integer.BYTES + stringToEncode.getBytes(StandardCharsets.UTF_8).length + "\u0000".length(); + byte[] expectedEncoding = stringToEncode.getBytes(StandardCharsets.UTF_8); + testWriteStringAcrossBuffers(bufferProvider, + codePoint, + bufferAllocationSize, + stringToEncode, + expectedEncoding); + } + } + + @DisplayName("should write UTF-8 String across buffers with branch") + @ParameterizedTest + @MethodSource("com.mongodb.internal.connection.ByteBufferBsonOutputTest#bufferProviders") + void shouldWriteStringAcrossBuffersUTF8WithBranch(final BufferProvider bufferProvider) throws IOException { + for (Integer codePoint : ALL_CODE_POINTS_EXCLUDING_SURROGATES) { + String stringToEncode = new String(Character.toChars(codePoint)) + "a"; + //4 bytes for the length prefix, bytes for encoded String, and 1 byte for the null terminator + int bufferAllocationSize = Integer.BYTES + stringToEncode.getBytes(StandardCharsets.UTF_8).length + "\u0000".length(); + byte[] expectedEncoding = stringToEncode.getBytes(StandardCharsets.UTF_8); + testWriteStringAcrossBuffersWithBranch( + bufferProvider, + bufferAllocationSize, + stringToEncode, + codePoint, + expectedEncoding); + } + } + + /* + Tests that malformed surrogate pairs are encoded as-is without substituting any code point. + This known bug and corresponding test remain for backward compatibility. + Ticket: JAVA-5575 + */ + @DisplayName("should write malformed surrogate CString across buffers") + @ParameterizedTest + @MethodSource("com.mongodb.internal.connection.ByteBufferBsonOutputTest#bufferProviders") + void shouldWriteCStringWithMalformedSurrogates(final BufferProvider bufferProvider) throws IOException { + for (Integer surrogateCodePoint : ALL_SURROGATE_CODE_POINTS) { + byte[] expectedEncoding = new byte[]{ + (byte) (0xE0 | ((surrogateCodePoint >> 12) & 0x0F)), + (byte) (0x80 | ((surrogateCodePoint >> 6) & 0x3F)), + (byte) (0x80 | (surrogateCodePoint & 0x3F)) + }; + String str = new String(Character.toChars(surrogateCodePoint)); + int bufferAllocationSize = expectedEncoding.length + "\u0000".length(); + + testWriteCStringAcrossBuffers( + bufferProvider, + surrogateCodePoint, + bufferAllocationSize, + str, + expectedEncoding); + } + } + + /* + Tests that malformed surrogate pairs are encoded as-is without substituting any code point. + This known bug and corresponding test remain for backward compatibility. + Ticket: JAVA-5575 + */ + @DisplayName("should write malformed surrogate CString across buffers with branch") + @ParameterizedTest + @MethodSource("com.mongodb.internal.connection.ByteBufferBsonOutputTest#bufferProviders") + void shouldWriteCStringWithMalformedSurrogatesWithBranch(final BufferProvider bufferProvider) throws IOException { + for (Integer surrogateCodePoint : ALL_SURROGATE_CODE_POINTS) { + byte[] expectedEncoding = new byte[]{ + (byte) (0xE0 | ((surrogateCodePoint >> 12) & 0x0F)), + (byte) (0x80 | ((surrogateCodePoint >> 6) & 0x3F)), + (byte) (0x80 | (surrogateCodePoint & 0x3F)) + }; + String str = new String(Character.toChars(surrogateCodePoint)); + int bufferAllocationSize = expectedEncoding.length + "\u0000".length(); + + testWriteCStringAcrossBufferWithBranch( + bufferProvider, + surrogateCodePoint, + bufferAllocationSize, + str, + expectedEncoding); + } + } + + @DisplayName("should write surrogate CString across buffers") + @ParameterizedTest + @MethodSource("com.mongodb.internal.connection.ByteBufferBsonOutputTest#bufferProviders") + void shouldWriteCStringWithSurrogatePairs(final BufferProvider bufferProvider) throws IOException { + for (Integer surrogateCodePoint : ALL_UTF_16_CODE_POINTS_FORMED_BY_SURROGATE_PAIRS) { + String stringToEncode = new String(toSurrogatePair(surrogateCodePoint)); + byte[] expectedEncoding = stringToEncode.getBytes(StandardCharsets.UTF_8); + int bufferAllocationSize = expectedEncoding.length + "\u0000".length(); + + testWriteCStringAcrossBuffers( + bufferProvider, + surrogateCodePoint, + bufferAllocationSize, + stringToEncode, + expectedEncoding); + } + } + + @DisplayName("should write surrogate CString across buffers with branch") + @ParameterizedTest + @MethodSource("com.mongodb.internal.connection.ByteBufferBsonOutputTest#bufferProviders") + void shouldWriteCStringWithSurrogatePairsWithBranch(final BufferProvider bufferProvider) throws IOException { + for (Integer surrogateCodePoint : ALL_UTF_16_CODE_POINTS_FORMED_BY_SURROGATE_PAIRS) { + String stringToEncode = new String(toSurrogatePair(surrogateCodePoint)); + byte[] expectedEncoding = stringToEncode.getBytes(StandardCharsets.UTF_8); + int bufferAllocationSize = expectedEncoding.length + "\u0000".length(); + + testWriteCStringAcrossBufferWithBranch( + bufferProvider, + surrogateCodePoint, + bufferAllocationSize, + stringToEncode, + expectedEncoding); + } + } + + @DisplayName("should write surrogate String across buffers") + @ParameterizedTest + @MethodSource("com.mongodb.internal.connection.ByteBufferBsonOutputTest#bufferProviders") + void shouldWriteStringWithSurrogatePairs(final BufferProvider bufferProvider) throws IOException { + for (Integer surrogateCodePoint : ALL_UTF_16_CODE_POINTS_FORMED_BY_SURROGATE_PAIRS) { + String stringToEncode = new String(toSurrogatePair(surrogateCodePoint)); + byte[] expectedEncoding = stringToEncode.getBytes(StandardCharsets.UTF_8); + int bufferAllocationSize = expectedEncoding.length + "\u0000".length(); + + testWriteStringAcrossBuffers( + bufferProvider, + surrogateCodePoint, + bufferAllocationSize, + stringToEncode, + expectedEncoding); + } + } + + @DisplayName("should write surrogate String across buffers with branch") + @ParameterizedTest + @MethodSource("com.mongodb.internal.connection.ByteBufferBsonOutputTest#bufferProviders") + void shouldWriteStringWithSurrogatePairsWithBranch(final BufferProvider bufferProvider) throws IOException { + for (Integer surrogateCodePoint : ALL_UTF_16_CODE_POINTS_FORMED_BY_SURROGATE_PAIRS) { + String stringToEncode = new String(toSurrogatePair(surrogateCodePoint)); + byte[] expectedEncoding = stringToEncode.getBytes(StandardCharsets.UTF_8); + int bufferAllocationSize = expectedEncoding.length + "\u0000".length(); + + testWriteStringAcrossBuffersWithBranch( + bufferProvider, + bufferAllocationSize, + stringToEncode, + surrogateCodePoint, + expectedEncoding); + } + } + + /* + Tests that malformed surrogate pairs are encoded as-is without substituting any code point. + This known bug and corresponding test remain for backward compatibility. + Ticket: JAVA-5575 + */ + @DisplayName("should write malformed surrogate String across buffers") + @ParameterizedTest + @MethodSource("com.mongodb.internal.connection.ByteBufferBsonOutputTest#bufferProviders") + void shouldWriteStringWithMalformedSurrogates(final BufferProvider bufferProvider) throws IOException { + for (Integer surrogateCodePoint : ALL_SURROGATE_CODE_POINTS) { + byte[] expectedEncoding = new byte[]{ + (byte) (0xE0 | ((surrogateCodePoint >> 12) & 0x0F)), + (byte) (0x80 | ((surrogateCodePoint >> 6) & 0x3F)), + (byte) (0x80 | (surrogateCodePoint & 0x3F)) + }; + String stringToEncode = new String(Character.toChars(surrogateCodePoint)); + int bufferAllocationSize = expectedEncoding.length + "\u0000".length(); + + testWriteStringAcrossBuffers( + bufferProvider, + surrogateCodePoint, + bufferAllocationSize, + stringToEncode, + expectedEncoding); + } + } + + /* + Tests that malformed surrogate pairs are encoded as-is without substituting any code point. + This known bug and corresponding test remain for backward compatibility. + Ticket: JAVA-5575 + */ + @DisplayName("should write malformed surrogate String across buffers with branch") + @ParameterizedTest + @MethodSource("com.mongodb.internal.connection.ByteBufferBsonOutputTest#bufferProviders") + void shouldWriteStringWithMalformedSurrogatesWithBranch(final BufferProvider bufferProvider) throws IOException { + for (Integer surrogateCodePoint : ALL_SURROGATE_CODE_POINTS) { + byte[] expectedEncoding = new byte[]{ + (byte) (0xE0 | ((surrogateCodePoint >> 12) & 0x0F)), + (byte) (0x80 | ((surrogateCodePoint >> 6) & 0x3F)), + (byte) (0x80 | (surrogateCodePoint & 0x3F)) + }; + String stringToEncode = new String(Character.toChars(surrogateCodePoint)); + int bufferAllocationSize = expectedEncoding.length + "\u0000".length(); + + testWriteStringAcrossBuffersWithBranch( + bufferProvider, + bufferAllocationSize, + stringToEncode, + surrogateCodePoint, + expectedEncoding); + } + } + + private void testWriteCStringAcrossBuffers(final BufferProvider bufferProvider, + final Integer surrogateCodePoint, + final int bufferAllocationSize, + final String str, + final byte[] expectedEncoding) throws IOException { + for (int startingOffset = 0; startingOffset <= bufferAllocationSize; startingOffset++) { + //given + List actualByteBuffers = emptyList(); + + try (ByteBufferBsonOutput bsonOutput = new ByteBufferBsonOutput( + size -> bufferProvider.getBuffer(bufferAllocationSize))) { + // Write an initial startingOffset of empty bytes to shift the start position + bsonOutput.write(new byte[startingOffset]); + + // when + bsonOutput.writeCString(str); + + // then + actualByteBuffers = bsonOutput.getDuplicateByteBuffers(); + byte[] actualFlattenedByteBuffersBytes = getBytes(bsonOutput); + assertEncodedResult(surrogateCodePoint, + startingOffset, + expectedEncoding, + bufferAllocationSize, + actualByteBuffers, + actualFlattenedByteBuffersBytes); + } finally { + actualByteBuffers.forEach(ByteBuf::release); + } + } + } + + private void testWriteStringAcrossBuffers(final BufferProvider bufferProvider, + final Integer codePoint, + final int bufferAllocationSize, + final String stringToEncode, + final byte[] expectedEncoding) throws IOException { + for (int startingOffset = 0; startingOffset <= bufferAllocationSize; startingOffset++) { + //given + List actualByteBuffers = emptyList(); + + try (ByteBufferBsonOutput actualBsonOutput = new ByteBufferBsonOutput( + size -> bufferProvider.getBuffer(bufferAllocationSize))) { + // Write an initial startingOffset of empty bytes to shift the start position + actualBsonOutput.write(new byte[startingOffset]); + + // when + actualBsonOutput.writeString(stringToEncode); + + // then + actualByteBuffers = actualBsonOutput.getDuplicateByteBuffers(); + byte[] actualFlattenedByteBuffersBytes = getBytes(actualBsonOutput); + + assertEncodedStringSize(codePoint, + expectedEncoding, + actualFlattenedByteBuffersBytes, + startingOffset); + assertEncodedResult(codePoint, + startingOffset + Integer.BYTES, // +4 bytes for the length prefix + expectedEncoding, + bufferAllocationSize, + actualByteBuffers, + actualFlattenedByteBuffersBytes); + } finally { + actualByteBuffers.forEach(ByteBuf::release); + } + } + } + + private void testWriteStringAcrossBuffersWithBranch(final BufferProvider bufferProvider, + final int bufferAllocationSize, + final String stringToEncode, + final Integer codePoint, + final byte[] expectedEncoding) throws IOException { + for (int startingOffset = 0; startingOffset <= bufferAllocationSize; startingOffset++) { + //given + List actualByteBuffers = emptyList(); + List actualBranchByteBuffers = emptyList(); + + try (ByteBufferBsonOutput actualBsonOutput = new ByteBufferBsonOutput( + size -> bufferProvider.getBuffer(bufferAllocationSize))) { + + try (ByteBufferBsonOutput.Branch branchOutput = actualBsonOutput.branch()) { + // Write an initial startingOffset of empty bytes to shift the start position + branchOutput.write(new byte[startingOffset]); + + // when + branchOutput.writeString(stringToEncode); + + // then + actualBranchByteBuffers = branchOutput.getDuplicateByteBuffers(); + byte[] actualFlattenedByteBuffersBytes = getBytes(branchOutput); + assertEncodedStringSize( + codePoint, + expectedEncoding, + actualFlattenedByteBuffersBytes, + startingOffset); + assertEncodedResult(codePoint, + startingOffset + Integer.BYTES, // +4 bytes for the length prefix + expectedEncoding, + bufferAllocationSize, + actualBranchByteBuffers, + actualFlattenedByteBuffersBytes); + } + + // then + actualByteBuffers = actualBsonOutput.getDuplicateByteBuffers(); + byte[] actualFlattenedByteBuffersBytes = getBytes(actualBsonOutput); + assertEncodedStringSize( + codePoint, + expectedEncoding, + actualFlattenedByteBuffersBytes, + startingOffset); + assertEncodedResult(codePoint, + startingOffset + Integer.BYTES, // +4 bytes for the length prefix + expectedEncoding, + bufferAllocationSize, + actualByteBuffers, + actualFlattenedByteBuffersBytes); + + } finally { + actualByteBuffers.forEach(ByteBuf::release); + actualBranchByteBuffers.forEach(ByteBuf::release); + } + } + } + + // Verify that the resulting byte array (excluding the starting offset and null terminator) + // matches the expected UTF-8 encoded length of the test string. + private void assertEncodedStringSize(final Integer codePoint, + final byte[] expectedStringEncoding, + final byte[] actualFlattenedByteBuffersBytes, + final int startingOffset) { + int littleEndianLength = reverseBytes(expectedStringEncoding.length + "\u0000".length()); + byte[] expectedEncodedStringSize = Ints.toByteArray(littleEndianLength); + byte[] actualEncodedStringSize = copyOfRange( + actualFlattenedByteBuffersBytes, + startingOffset, + startingOffset + Integer.BYTES); + + assertArrayEquals( + expectedEncodedStringSize, + actualEncodedStringSize, + () -> format("Encoded String size before the test String does not match expected size. " + + "Failed with code point: %s, startingOffset: %s", + codePoint, + startingOffset)); + } + + private void testWriteCStringAcrossBufferWithBranch(final BufferProvider bufferProvider, + final Integer codePoint, + final int bufferAllocationSize, + final String str, final byte[] expectedEncoding) throws IOException { + for (int startingOffset = 0; startingOffset <= bufferAllocationSize; startingOffset++) { + List actualBranchByteBuffers = emptyList(); + List actualByteBuffers = emptyList(); + + try (ByteBufferBsonOutput bsonOutput = new ByteBufferBsonOutput( + size -> bufferProvider.getBuffer(bufferAllocationSize))) { + + try (ByteBufferBsonOutput.Branch branchOutput = bsonOutput.branch()) { + // Write an initial startingOffset of empty bytes to shift the start position + branchOutput.write(new byte[startingOffset]); + + // when + branchOutput.writeCString(str); + + // then + actualBranchByteBuffers = branchOutput.getDuplicateByteBuffers(); + byte[] actualFlattenedByteBuffersBytes = getBytes(branchOutput); + assertEncodedResult(codePoint, + startingOffset, + expectedEncoding, + bufferAllocationSize, + actualBranchByteBuffers, + actualFlattenedByteBuffersBytes); + } + + // then + actualByteBuffers = bsonOutput.getDuplicateByteBuffers(); + byte[] actualFlattenedByteBuffersBytes = getBytes(bsonOutput); + assertEncodedResult(codePoint, + startingOffset, + expectedEncoding, + bufferAllocationSize, + actualByteBuffers, + actualFlattenedByteBuffersBytes); + } finally { + actualByteBuffers.forEach(ByteBuf::release); + actualBranchByteBuffers.forEach(ByteBuf::release); + } + } + } + + private void assertEncodedResult(final int codePoint, + final int startingOffset, + final byte[] expectedEncoding, + final int expectedBufferAllocationSize, + final List actualByteBuffers, + final byte[] actualFlattenedByteBuffersBytes) { + int expectedCodeUnitCount = expectedEncoding.length; + int byteCount = startingOffset + expectedCodeUnitCount + 1; + int expectedBufferCount = (byteCount + expectedBufferAllocationSize - 1) / expectedBufferAllocationSize; + int expectedLastBufferPosition = (byteCount % expectedBufferAllocationSize) == 0 ? expectedBufferAllocationSize + : byteCount % expectedBufferAllocationSize; + + assertEquals( + expectedBufferCount, + actualByteBuffers.size(), + () -> format("expectedBufferCount failed with code point: %s, offset: %s", + codePoint, + startingOffset)); + assertEquals( + expectedLastBufferPosition, + actualByteBuffers.get(actualByteBuffers.size() - 1).position(), + () -> format("expectedLastBufferPosition failed with code point: %s, offset: %s", + codePoint, + startingOffset)); + + for (ByteBuf byteBuf : actualByteBuffers.subList(0, actualByteBuffers.size() - 1)) { + assertEquals( + byteBuf.position(), + byteBuf.limit(), + () -> format("All non-final buffers are not full. Code point: %s, offset: %s", + codePoint, + startingOffset)); + } + + // Verify that the final byte array (excluding the initial offset and null terminator) + // matches the expected UTF-8 encoding of the test string + assertArrayEquals( + expectedEncoding, + Arrays.copyOfRange(actualFlattenedByteBuffersBytes, startingOffset, actualFlattenedByteBuffersBytes.length - 1), + () -> format("Expected UTF-8 encoding of the test string does not match actual encoding. Code point: %s, offset: %s", + codePoint, + startingOffset)); + assertEquals( + 0, + actualFlattenedByteBuffersBytes[actualFlattenedByteBuffersBytes.length - 1], + () -> format("String does not end with null terminator. Code point: %s, offset: %s", + codePoint, + startingOffset)); + } + + public char[] toSurrogatePair(final int codePoint) { + if (!Character.isValidCodePoint(codePoint) || codePoint < 0x10000) { + throw new IllegalArgumentException("Invalid code point: " + codePoint); + } + char[] result = new char[2]; + result[0] = Character.highSurrogate(codePoint); + result[1] = Character.lowSurrogate(codePoint); + return result; + } + + } + + private static byte[] getBytes(final OutputBuffer basicOutputBuffer) throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(basicOutputBuffer.getSize()); + basicOutputBuffer.pipe(baos); + return baos.toByteArray(); + } } diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/CommandMessageSpecification.groovy b/driver-core/src/test/unit/com/mongodb/internal/connection/CommandMessageSpecification.groovy index e3351e2eb0f..921ec31a697 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/CommandMessageSpecification.groovy +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/CommandMessageSpecification.groovy @@ -16,7 +16,7 @@ package com.mongodb.internal.connection -import com.mongodb.MongoClientException + import com.mongodb.MongoNamespace import com.mongodb.ReadConcern import com.mongodb.ReadPreference @@ -43,7 +43,6 @@ import spock.lang.Specification import java.nio.ByteBuffer import static com.mongodb.internal.connection.SplittablePayload.Type.INSERT -import static com.mongodb.internal.operation.ServerVersionHelper.FOUR_DOT_ZERO_WIRE_VERSION import static com.mongodb.internal.operation.ServerVersionHelper.LATEST_WIRE_VERSION /** @@ -360,30 +359,6 @@ class CommandMessageSpecification extends Specification { output.close() } - def 'should throw if wire version and sharded cluster does not support transactions'() { - given: - def messageSettings = MessageSettings.builder().serverType(ServerType.SHARD_ROUTER) - .maxWireVersion(FOUR_DOT_ZERO_WIRE_VERSION).build() - def payload = new SplittablePayload(INSERT, [new BsonDocument('a', new BsonInt32(1))], true, fieldNameValidator) - def message = new CommandMessage(namespace, command, fieldNameValidator, ReadPreference.primary(), messageSettings, - false, payload, ClusterConnectionMode.MULTIPLE, null) - def output = new ByteBufferBsonOutput(new SimpleBufferProvider()) - def sessionContext = Stub(SessionContext) { - getReadConcern() >> ReadConcern.DEFAULT - hasActiveTransaction() >> true - } - - when: - message.encode(output, new OperationContext(IgnorableRequestContext.INSTANCE, sessionContext, - Stub(TimeoutContext), null)) - - then: - thrown(MongoClientException) - - cleanup: - output.close() - } - private static BsonDocument getCommandDocument(ByteBufNIO byteBuf, ReplyHeader replyHeader) { new ReplyMessage(new ResponseBuffers(replyHeader, byteBuf), new BsonDocumentCodec(), 0).document } diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/CommandMessageTest.java b/driver-core/src/test/unit/com/mongodb/internal/connection/CommandMessageTest.java index 1388ffcef22..533e74f0d23 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/CommandMessageTest.java +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/CommandMessageTest.java @@ -48,7 +48,6 @@ import static com.mongodb.MongoClientSettings.getDefaultCodecRegistry; import static com.mongodb.client.model.bulk.ClientBulkWriteOptions.clientBulkWriteOptions; import static com.mongodb.internal.mockito.MongoMockito.mock; -import static com.mongodb.internal.operation.ServerVersionHelper.FOUR_DOT_ZERO_WIRE_VERSION; import static com.mongodb.internal.operation.ServerVersionHelper.LATEST_WIRE_VERSION; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; @@ -69,7 +68,7 @@ void encodeShouldThrowTimeoutExceptionWhenTimeoutContextIsCalled() { //given CommandMessage commandMessage = new CommandMessage(NAMESPACE, COMMAND, NoOpFieldNameValidator.INSTANCE, ReadPreference.primary(), MessageSettings.builder() - .maxWireVersion(FOUR_DOT_ZERO_WIRE_VERSION) + .maxWireVersion(LATEST_WIRE_VERSION) .serverType(ServerType.REPLICA_SET_SECONDARY) .sessionSupported(true) .build(), @@ -96,7 +95,7 @@ void encodeShouldNotAddExtraElementsFromTimeoutContextWhenConnectedToMongoCrypt( //given CommandMessage commandMessage = new CommandMessage(NAMESPACE, COMMAND, NoOpFieldNameValidator.INSTANCE, ReadPreference.primary(), MessageSettings.builder() - .maxWireVersion(FOUR_DOT_ZERO_WIRE_VERSION) + .maxWireVersion(LATEST_WIRE_VERSION) .serverType(ServerType.REPLICA_SET_SECONDARY) .sessionSupported(true) .cryptd(true) diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/ConnectionPoolAsyncTest.java b/driver-core/src/test/unit/com/mongodb/internal/connection/ConnectionPoolAsyncTest.java index 1006b10665b..b3e1693ae03 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/ConnectionPoolAsyncTest.java +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/ConnectionPoolAsyncTest.java @@ -28,7 +28,7 @@ import java.util.concurrent.Callable; // Implementation of -// https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst +// https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md // specification tests @RunWith(Parameterized.class) public class ConnectionPoolAsyncTest extends AbstractConnectionPoolTest { diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/ConnectionPoolTest.java b/driver-core/src/test/unit/com/mongodb/internal/connection/ConnectionPoolTest.java index 425a5da0fcb..3fd06d9dcca 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/ConnectionPoolTest.java +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/ConnectionPoolTest.java @@ -27,7 +27,7 @@ import java.util.concurrent.Callable; // Implementation of -// https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.rst +// https://github.com/mongodb/specifications/blob/master/source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md // specification tests @RunWith(Parameterized.class) public class ConnectionPoolTest extends AbstractConnectionPoolTest { diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/DefaultConnectionPoolSpecification.groovy b/driver-core/src/test/unit/com/mongodb/internal/connection/DefaultConnectionPoolSpecification.groovy index fe251d34311..b3e78d2dc54 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/DefaultConnectionPoolSpecification.groovy +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/DefaultConnectionPoolSpecification.groovy @@ -34,7 +34,7 @@ import com.mongodb.logging.TestLoggingInterceptor import org.bson.types.ObjectId import spock.lang.Specification import spock.lang.Subject -import util.spock.annotations.Slow +import com.mongodb.spock.Slow import java.util.concurrent.CompletableFuture import java.util.concurrent.CountDownLatch diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/ReadConcernHelperSpecification.groovy b/driver-core/src/test/unit/com/mongodb/internal/connection/ReadConcernHelperSpecification.groovy index 3d52d7fff03..924f8dee4d6 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/ReadConcernHelperSpecification.groovy +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/ReadConcernHelperSpecification.groovy @@ -24,13 +24,13 @@ import org.bson.BsonTimestamp import spock.lang.Specification import static com.mongodb.internal.connection.ReadConcernHelper.getReadConcernDocument -import static com.mongodb.internal.operation.ServerVersionHelper.MIN_WIRE_VERSION +import static com.mongodb.internal.operation.ServerVersionHelper.UNKNOWN_WIRE_VERSION class ReadConcernHelperSpecification extends Specification { def 'should throw IllegalArgumentException if session context is null'() { when: - getReadConcernDocument(null, MIN_WIRE_VERSION) + getReadConcernDocument(null, UNKNOWN_WIRE_VERSION) then: thrown(IllegalArgumentException) @@ -46,7 +46,7 @@ class ReadConcernHelperSpecification extends Specification { } expect: - getReadConcernDocument(sessionContext, MIN_WIRE_VERSION) == new BsonDocument('level', new BsonString('majority')) + getReadConcernDocument(sessionContext, UNKNOWN_WIRE_VERSION) == new BsonDocument('level', new BsonString('majority')) .append('afterClusterTime', operationTime) } @@ -60,7 +60,8 @@ class ReadConcernHelperSpecification extends Specification { } expect: - getReadConcernDocument(sessionContext, MIN_WIRE_VERSION) == new BsonDocument(new BsonDocument('afterClusterTime', operationTime)) + getReadConcernDocument(sessionContext, UNKNOWN_WIRE_VERSION) == + new BsonDocument(new BsonDocument('afterClusterTime', operationTime)) } def 'should not add afterClusterTime to ReadConcern when session is not causally consistent'() { @@ -72,7 +73,7 @@ class ReadConcernHelperSpecification extends Specification { } expect: - getReadConcernDocument(sessionContext, MIN_WIRE_VERSION) == new BsonDocument('level', new BsonString('majority')) + getReadConcernDocument(sessionContext, UNKNOWN_WIRE_VERSION) == new BsonDocument('level', new BsonString('majority')) } def 'should not add afterClusterTime to ReadConcern when operation time is null'() { @@ -84,6 +85,6 @@ class ReadConcernHelperSpecification extends Specification { } expect: - getReadConcernDocument(sessionContext, MIN_WIRE_VERSION) == new BsonDocument('level', new BsonString('majority')) + getReadConcernDocument(sessionContext, UNKNOWN_WIRE_VERSION) == new BsonDocument('level', new BsonString('majority')) } } diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/ServerDiscoveryAndMonitoringMonitoringTest.java b/driver-core/src/test/unit/com/mongodb/internal/connection/ServerDiscoveryAndMonitoringMonitoringTest.java index c542fb29b1f..1a65534b526 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/ServerDiscoveryAndMonitoringMonitoringTest.java +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/ServerDiscoveryAndMonitoringMonitoringTest.java @@ -34,8 +34,6 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -78,8 +76,8 @@ public void shouldPassAllOutcomes() { } @Parameterized.Parameters(name = "{0}") - public static Collection data() throws URISyntaxException, IOException { - return data("/server-discovery-and-monitoring-monitoring"); + public static Collection data() { + return data("server-discovery-and-monitoring/tests/monitoring"); } private void assertEvents(final BsonArray events) { diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/ServerDiscoveryAndMonitoringTest.java b/driver-core/src/test/unit/com/mongodb/internal/connection/ServerDiscoveryAndMonitoringTest.java index 4a2e94c19a5..5957cfe3e1c 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/ServerDiscoveryAndMonitoringTest.java +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/ServerDiscoveryAndMonitoringTest.java @@ -23,13 +23,14 @@ import org.bson.BsonDocument; import org.bson.BsonNull; import org.bson.BsonValue; +import org.bson.assertions.Assertions; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; +import java.util.stream.Collectors; import static com.mongodb.ClusterFixture.OPERATION_CONTEXT; import static com.mongodb.ClusterFixture.getClusterDescription; @@ -41,16 +42,25 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import static org.junit.Assume.assumeFalse; // See https://github.com/mongodb/specifications/tree/master/source/server-discovery-and-monitoring/tests @RunWith(Parameterized.class) public class ServerDiscoveryAndMonitoringTest extends AbstractServerDiscoveryAndMonitoringTest { + private final String description; + public ServerDiscoveryAndMonitoringTest(final String description, final BsonDocument definition) { super(definition); + this.description = description; init(serverAddress -> NO_OP_SERVER_LISTENER, NO_OP_CLUSTER_LISTENER); } + @Before + public void setUp() { + assumeFalse(description.startsWith("pre-42")); + } + @Test public void shouldPassAllOutcomes() { for (BsonValue phase : getDefinition().getArray("phases")) { @@ -78,8 +88,16 @@ private void assertTopology(final BsonDocument outcome) { } @Parameterized.Parameters(name = "{0}") - public static Collection data() throws URISyntaxException, IOException { - return data("/server-discovery-and-monitoring"); + public static Collection data() { + // Unified and monitoring tests have their own test runners so filter them out. + return data("server-discovery-and-monitoring") + .stream().filter(i -> { + Object definition = i[1]; + Assertions.assertTrue("Expected a BsonDocument for definition", definition instanceof BsonDocument); + BsonDocument definitionDocument = (BsonDocument) definition; + String resourcePath = definitionDocument.getString("resourcePath").getValue(); + return !(resourcePath.contains("/tests/unified/") || resourcePath.contains("/tests/monitoring")); + }).collect(Collectors.toList()); } private void assertServers(final BsonDocument servers) { diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/ServerSelectionRttTest.java b/driver-core/src/test/unit/com/mongodb/internal/connection/ServerSelectionRttTest.java index 9a7a8492563..3f001c8b6a3 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/ServerSelectionRttTest.java +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/ServerSelectionRttTest.java @@ -23,9 +23,6 @@ import org.junit.runners.Parameterized; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -57,10 +54,10 @@ public void shouldPassAllOutcomes() { } @Parameterized.Parameters(name = "{0}") - public static Collection data() throws URISyntaxException, IOException { + public static Collection data() { List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/server-selection/rtt")) { - data.add(new Object[]{file.getName(), JsonPoweredTestHelper.getTestDocument(file)}); + for (BsonDocument testDocument : JsonPoweredTestHelper.getSpecTestDocuments("server-selection/tests/rtt")) { + data.add(new Object[]{testDocument.getString("fileName").getValue(), testDocument}); } return data; } diff --git a/driver-core/src/test/unit/com/mongodb/internal/connection/ServerSelectionWithinLatencyWindowTest.java b/driver-core/src/test/unit/com/mongodb/internal/connection/ServerSelectionWithinLatencyWindowTest.java index 878876d74bd..14d6c59b0c6 100644 --- a/driver-core/src/test/unit/com/mongodb/internal/connection/ServerSelectionWithinLatencyWindowTest.java +++ b/driver-core/src/test/unit/com/mongodb/internal/connection/ServerSelectionWithinLatencyWindowTest.java @@ -31,10 +31,11 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.mockito.Mockito; +import util.JsonPoweredTestHelper; import java.math.BigDecimal; import java.math.RoundingMode; -import java.nio.file.Path; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; @@ -44,12 +45,9 @@ import static com.mongodb.ClusterFixture.createOperationContext; import static com.mongodb.connection.ServerSelectionSelectionTest.buildClusterDescription; import static java.util.stream.Collectors.groupingBy; -import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toMap; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.when; -import static util.JsonPoweredTestHelper.testDir; -import static util.JsonPoweredTestHelper.testDocs; /** * A runner for @@ -64,7 +62,7 @@ public class ServerSelectionWithinLatencyWindowTest { private final Outcome outcome; public ServerSelectionWithinLatencyWindowTest( - @SuppressWarnings("unused") final Path fileName, + @SuppressWarnings("unused") final String fileName, @SuppressWarnings("unused") final String description, final BsonDocument definition) { clusterDescription = buildClusterDescription(definition.getDocument("topology_description"), null); @@ -93,14 +91,13 @@ public void shouldPassAllOutcomes() { @Parameterized.Parameters(name = "{0}: {1}") public static Collection data() { - return testDocs(testDir("/server-selection/in_window")) - .entrySet() - .stream() - .map(entry -> new Object[] { - entry.getKey().getFileName(), - entry.getValue().getString("description").getValue(), - entry.getValue()}) - .collect(toList()); + List data = new ArrayList<>(); + for (BsonDocument testDocument : JsonPoweredTestHelper.getSpecTestDocuments("server-selection/tests/in_window")) { + data.add(new Object[]{testDocument.getString("fileName").getValue(), + testDocument.getString("description").getValue(), + testDocument}); + } + return data; } private static Cluster.ServersSnapshot serverCatalog(final BsonArray mockedTopologyState) { diff --git a/driver-core/src/test/unit/com/mongodb/spock/Slow.java b/driver-core/src/test/unit/com/mongodb/spock/Slow.java new file mode 100644 index 00000000000..fba0029931d --- /dev/null +++ b/driver-core/src/test/unit/com/mongodb/spock/Slow.java @@ -0,0 +1,26 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.mongodb.spock; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE}) +public @interface Slow { +} diff --git a/driver-kotlin-coroutine/build.gradle.kts b/driver-kotlin-coroutine/build.gradle.kts index 96ac4cc31eb..02a2bf047aa 100644 --- a/driver-kotlin-coroutine/build.gradle.kts +++ b/driver-kotlin-coroutine/build.gradle.kts @@ -13,177 +13,41 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import io.gitlab.arturbosch.detekt.Detekt -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication plugins { - id("org.jetbrains.kotlin.jvm") - `java-library` - - // Test based plugins - id("com.diffplug.spotless") - id("org.jetbrains.dokka") - id("io.gitlab.arturbosch.detekt") -} - -repositories { - mavenCentral() - google() + id("project.kotlin") + id("conventions.test-artifacts") + id("conventions.test-artifacts-runtime-dependencies") } base.archivesName.set("mongodb-driver-kotlin-coroutine") -description = "The MongoDB Kotlin Coroutine Driver" - -ext.set("pomName", "MongoDB Kotlin Coroutine Driver") - -sourceSets { - create("integrationTest") { - kotlin.srcDir("$projectDir/src/integration/kotlin") - compileClasspath += sourceSets.main.get().output - runtimeClasspath += sourceSets.main.get().output - compileClasspath += project(":driver-sync").sourceSets.test.get().output - runtimeClasspath += project(":driver-sync").sourceSets.test.get().output - compileClasspath += project(":driver-core").sourceSets.test.get().output - runtimeClasspath += project(":driver-core").sourceSets.test.get().output - compileClasspath += project(":bson").sourceSets.test.get().output - runtimeClasspath += project(":bson").sourceSets.test.get().output - } -} - -val integrationTestImplementation: Configuration by - configurations.getting { extendsFrom(configurations.testImplementation.get()) } - dependencies { - // Align versions of all Kotlin components - implementation(platform("org.jetbrains.kotlin:kotlin-bom")) - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") - - implementation(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4")) - api("org.jetbrains.kotlinx:kotlinx-coroutines-core") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactive") - api(project(path = ":bson", configuration = "default")) api(project(path = ":driver-reactive-streams", configuration = "default")) - implementation(project(path = ":bson-kotlin", configuration = "default")) - - testImplementation("org.jetbrains.kotlin:kotlin-reflect") - testImplementation("org.jetbrains.kotlin:kotlin-test-junit") - testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0") - testImplementation("org.mockito:mockito-junit-jupiter:4.11.0") - testImplementation("org.assertj:assertj-core:3.24.2") - testImplementation("io.github.classgraph:classgraph:4.8.154") - - integrationTestImplementation("org.jetbrains.kotlin:kotlin-test-junit") - integrationTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test") - integrationTestImplementation(project(path = ":driver-sync")) - integrationTestImplementation(project(path = ":driver-core")) - integrationTestImplementation(project(path = ":bson")) -} - -kotlin { explicitApi() } - -tasks.withType { kotlinOptions.jvmTarget = "1.8" } - -// =========================== -// Code Quality checks -// =========================== -spotless { - kotlinGradle { - ktfmt("0.39").dropboxStyle().configure { it.setMaxWidth(120) } - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - licenseHeaderFile(rootProject.file("config/mongodb.license"), "(group|plugins|import|buildscript|rootProject)") - } - - kotlin { - target("**/*.kt") - ktfmt().dropboxStyle().configure { it.setMaxWidth(120) } - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - licenseHeaderFile(rootProject.file("config/mongodb.license")) - } - - format("extraneous") { - target("*.xml", "*.yml", "*.md") - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - } -} - -tasks.named("check") { dependsOn("spotlessApply") } - -detekt { - allRules = true // fail build on any finding - buildUponDefaultConfig = true // preconfigure defaults - config = rootProject.files("config/detekt/detekt.yml") // point to your custom config defining rules to run, - // overwriting default behavior - baseline = rootProject.file("config/detekt/baseline.xml") // a way of suppressing issues before introducing detekt - source = - files( - file("src/main/kotlin"), - file("src/test/kotlin"), - file("src/integrationTest/kotlin"), - ) -} - -tasks.withType().configureEach { - reports { - html.required.set(true) // observe findings in your browser with structure and code snippets - xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins - txt.required.set(false) // similar to the console output, contains issue signature to manually edit - } -} -spotbugs { - showProgress.set(true) + implementation(platform(libs.kotlinx.coroutines.bom)) + api(libs.kotlinx.coroutines.core) + implementation(libs.kotlinx.coroutines.reactive) + implementation(project(path = ":bson-kotlin", configuration = "default")) - tasks.getByName("spotbugsIntegrationTest") { enabled = false } + integrationTestImplementation(libs.kotlinx.coroutines.test) + integrationTestImplementation(project(path = ":driver-sync", configuration = "default")) + integrationTestImplementation(project(path = ":bson", configuration = "testArtifacts")) + integrationTestImplementation(project(path = ":driver-sync", configuration = "testArtifacts")) + integrationTestImplementation(project(path = ":driver-core", configuration = "testArtifacts")) } -// =========================== -// Test Configuration -// =========================== -val integrationTest = - tasks.create("integrationTest", Test::class) { - description = "Runs the integration tests." - group = "verification" - - testClassesDirs = sourceSets["integrationTest"].output.classesDirs - classpath = sourceSets["integrationTest"].runtimeClasspath +configureMavenPublication { + pom { + name.set("MongoDB Kotlin Coroutine Driver") + description.set("The MongoDB Kotlin Coroutine Driver") } - -tasks.test { useJUnitPlatform() } - -// =========================== -// Dokka Configuration -// =========================== -val dokkaOutputDir = "${rootProject.buildDir}/docs/${base.archivesName.get()}" - -tasks.dokkaHtml.configure { - outputDirectory.set(file(dokkaOutputDir)) - moduleName.set(base.archivesName.get()) } -val cleanDokka by tasks.register("cleanDokka") { delete(dokkaOutputDir) } - -project.parent?.tasks?.named("docs") { - dependsOn(tasks.dokkaHtml) - mustRunAfter(cleanDokka) -} - -tasks.javadocJar.configure { - dependsOn(cleanDokka, tasks.dokkaHtml) - archiveClassifier.set("javadoc") - from(dokkaOutputDir) +configureJarManifest { + attributes["Automatic-Module-Name"] = "org.mongodb.driver.kotlin.coroutine" + attributes["Bundle-SymbolicName"] = "org.mongodb.mongodb-driver-kotlin-coroutine" } - -// =========================== -// Sources publishing configuration -// =========================== -tasks.sourcesJar { from(project.sourceSets.main.map { it.kotlin }) } - -afterEvaluate { tasks.jar { manifest { attributes["Automatic-Module-Name"] = "org.mongodb.driver.kotlin.coroutine" } } } diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/SmokeTests.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/SmokeTests.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/SmokeTests.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/SmokeTests.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/UnifiedCrudTest.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/UnifiedCrudTest.kt similarity index 94% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/UnifiedCrudTest.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/UnifiedCrudTest.kt index 036ec5afcc4..73f6c0cf6fa 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/UnifiedCrudTest.kt +++ b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/UnifiedCrudTest.kt @@ -24,7 +24,7 @@ internal class UnifiedCrudTest() : UnifiedTest() { @JvmStatic @Throws(URISyntaxException::class, IOException::class) fun data(): Collection? { - return getTestData("unified-test-format/crud") + return getTestData("crud", true, Language.KOTLIN) } } } diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/UnifiedTest.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/UnifiedTest.kt similarity index 93% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/UnifiedTest.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/UnifiedTest.kt index b027b3946c5..f676f93956f 100644 --- a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/UnifiedTest.kt +++ b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/UnifiedTest.kt @@ -39,4 +39,8 @@ internal abstract class UnifiedTest() : JUnifiedTest() { ): ClientEncryption { TODO("Not yet implemented - JAVA-4896") } + + override fun isReactive(): Boolean = true + + override fun getLanguage(): Language = Language.KOTLIN } diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncAggregateIterable.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncAggregateIterable.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncAggregateIterable.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncAggregateIterable.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncChangeStreamIterable.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncChangeStreamIterable.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncChangeStreamIterable.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncChangeStreamIterable.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncClientSession.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncClientSession.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncClientSession.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncClientSession.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncDistinctIterable.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncDistinctIterable.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncDistinctIterable.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncDistinctIterable.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncFindIterable.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncFindIterable.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncFindIterable.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncFindIterable.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionNamesIterable.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionNamesIterable.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionNamesIterable.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionNamesIterable.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionsIterable.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionsIterable.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionsIterable.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListCollectionsIterable.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListDatabasesIterable.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListDatabasesIterable.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListDatabasesIterable.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListDatabasesIterable.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListIndexesIterable.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListIndexesIterable.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListIndexesIterable.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListIndexesIterable.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListSearchIndexesIterable.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListSearchIndexesIterable.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListSearchIndexesIterable.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncListSearchIndexesIterable.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMapReduceIterable.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMapReduceIterable.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMapReduceIterable.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMapReduceIterable.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoChangeStreamCursor.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoChangeStreamCursor.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoChangeStreamCursor.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoChangeStreamCursor.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoClient.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoClient.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoClient.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoClient.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoCluster.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoCluster.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoCluster.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoCluster.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoCollection.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoCollection.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoCollection.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoCollection.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoCursor.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoCursor.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoCursor.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoCursor.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoDatabase.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoDatabase.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoDatabase.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoDatabase.kt diff --git a/driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoIterable.kt b/driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoIterable.kt similarity index 100% rename from driver-kotlin-coroutine/src/integration/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoIterable.kt rename to driver-kotlin-coroutine/src/integrationTest/kotlin/com/mongodb/kotlin/client/coroutine/syncadapter/SyncMongoIterable.kt diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlow.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlow.kt index c8da59450ad..a1debfd812f 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlow.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlow.kt @@ -62,9 +62,11 @@ public class AggregateFlow(private val wrapped: AggregatePublisher) public fun timeoutMode(timeoutMode: TimeoutMode): AggregateFlow = apply { wrapped.timeoutMode(timeoutMode) } /** - * Aggregates documents according to the specified aggregation pipeline, which must end with a $out or $merge stage. + * Aggregates documents according to the specified aggregation pipeline, which must end with an `$out` or `$merge` + * stage. Calling this method is the preferred alternative to consuming this [AggregateFlow], because this method + * does what is explicitly requested without executing implicit operations. * - * @throws IllegalStateException if the pipeline does not end with a $out or $merge stage + * @throws IllegalStateException if the pipeline does not end with an `$out` or `$merge` stage * @see [$out stage](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out/) * @see [$merge stage](https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge/) */ @@ -214,5 +216,11 @@ public class AggregateFlow(private val wrapped: AggregatePublisher) public suspend inline fun explain(verbosity: ExplainVerbosity? = null): R = explain(R::class.java, verbosity) + /** + * Requests [AggregateFlow] to start streaming data according to the specified aggregation pipeline. + * - If the aggregation pipeline ends with an `$out` or `$merge` stage, then finds all documents in the affected + * namespace and emits them. You may want to use [toCollection] instead. + * - Otherwise, emits no values. + */ public override suspend fun collect(collector: FlowCollector): Unit = wrapped.asFlow().collect(collector) } diff --git a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MapReduceFlow.kt b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MapReduceFlow.kt index 407f1b8fe39..c43fe3842d5 100644 --- a/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MapReduceFlow.kt +++ b/driver-kotlin-coroutine/src/main/kotlin/com/mongodb/kotlin/client/coroutine/MapReduceFlow.kt @@ -33,6 +33,9 @@ import org.bson.conversions.Bson /** * Flow implementation for map reduce operations. * + * By default, the [MapReduceFlow] emits the results inline. You can write map-reduce output to a collection by using + * the [collectionName] and [toCollection] methods. + * * Note: Starting in MongoDB 5.0, map-reduce is deprecated, prefer Aggregation instead * * @param T The type of the result. @@ -65,9 +68,11 @@ public class MapReduceFlow(private val wrapped: MapReducePublisher) /** * Aggregates documents to a collection according to the specified map-reduce function with the given options, which - * must specify a non-inline result. + * must not emit results inline. Calling this method is the preferred alternative to consuming this [MapReduceFlow], + * because this method does what is explicitly requested without executing implicit operations. * * @throws IllegalStateException if a collection name to write the results to has not been specified + * @see collectionName */ public suspend fun toCollection() { wrapped.toCollection().awaitFirstOrNull() @@ -80,6 +85,7 @@ public class MapReduceFlow(private val wrapped: MapReducePublisher) * * @param collectionName the name of the collection that you want the map-reduce operation to write its output. * @return this + * @see toCollection */ public fun collectionName(collectionName: String): MapReduceFlow = apply { wrapped.collectionName(collectionName) @@ -205,5 +211,12 @@ public class MapReduceFlow(private val wrapped: MapReducePublisher) */ public fun collation(collation: Collation?): MapReduceFlow = apply { wrapped.collation(collation) } + /** + * Requests [MapReduceFlow] to start streaming data according to the specified map-reduce function with the given + * options. + * - If the aggregation produces results inline, then finds all documents in the affected namespace and emits them. + * You may want to use [toCollection] instead. + * - Otherwise, emits no values. + */ public override suspend fun collect(collector: FlowCollector): Unit = wrapped.asFlow().collect(collector) } diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlowTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlowTest.kt index 07953277d5a..ab4b9694986 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlowTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/AggregateFlowTest.kt @@ -39,7 +39,8 @@ class AggregateFlowTest { @Test fun shouldHaveTheSameMethods() { - val jAggregatePublisherFunctions = AggregatePublisher::class.declaredFunctions.map { it.name }.toSet() - "first" + val jAggregatePublisherFunctions = + AggregatePublisher::class.declaredFunctions.map { it.name }.toSet() - "first" - "subscribe" val kAggregateFlowFunctions = AggregateFlow::class.declaredFunctions.map { it.name }.toSet() - "collect" assertEquals(jAggregatePublisherFunctions, kAggregateFlowFunctions) diff --git a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/MapReduceFlowTest.kt b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/MapReduceFlowTest.kt index b9ef9133e87..3a38b7e6460 100644 --- a/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/MapReduceFlowTest.kt +++ b/driver-kotlin-coroutine/src/test/kotlin/com/mongodb/kotlin/client/coroutine/MapReduceFlowTest.kt @@ -38,7 +38,8 @@ import reactor.core.publisher.Mono class MapReduceFlowTest { @Test fun shouldHaveTheSameMethods() { - val jMapReducePublisherFunctions = MapReducePublisher::class.declaredFunctions.map { it.name }.toSet() - "first" + val jMapReducePublisherFunctions = + MapReducePublisher::class.declaredFunctions.map { it.name }.toSet() - "first" - "subscribe" val kMapReduceFlowFunctions = MapReduceFlow::class.declaredFunctions.map { it.name }.toSet() - "collect" assertEquals(jMapReducePublisherFunctions, kMapReduceFlowFunctions) diff --git a/driver-kotlin-extensions/build.gradle.kts b/driver-kotlin-extensions/build.gradle.kts index 76f36ca33b2..0bd9405f27e 100644 --- a/driver-kotlin-extensions/build.gradle.kts +++ b/driver-kotlin-extensions/build.gradle.kts @@ -13,56 +13,40 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import io.gitlab.arturbosch.detekt.Detekt +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -plugins { - id("org.jetbrains.kotlin.jvm") - `java-library` - - // Test based plugins - id("com.diffplug.spotless") - id("org.jetbrains.dokka") - id("io.gitlab.arturbosch.detekt") -} - -repositories { - mavenCentral() - google() -} +plugins { id("project.kotlin") } base.archivesName.set("mongodb-driver-kotlin-extensions") -description = "The MongoDB Kotlin Driver Extensions" - -ext.set("pomName", "MongoDB Kotlin Driver Extensions") - -java { registerFeature("kotlinDrivers") { usingSourceSet(sourceSets["main"]) } } - dependencies { - // Align versions of all Kotlin components - implementation(platform("org.jetbrains.kotlin:kotlin-bom")) - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") - api(project(path = ":driver-core", configuration = "default")) // Some extensions require higher API like MongoCollection which are defined in the sync & // coroutine Kotlin driver - "kotlinDriversImplementation"(project(path = ":driver-kotlin-sync", configuration = "default")) - "kotlinDriversImplementation"(project(path = ":driver-kotlin-coroutine", configuration = "default")) + optionalImplementation(project(path = ":driver-kotlin-sync", configuration = "default")) + optionalImplementation(project(path = ":driver-kotlin-coroutine", configuration = "default")) - testImplementation("org.jetbrains.kotlin:kotlin-reflect") - testImplementation("org.jetbrains.kotlin:kotlin-test-junit") - testImplementation("org.assertj:assertj-core:3.24.2") - testImplementation("io.github.classgraph:classgraph:4.8.154") - testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0") + testImplementation(platform(libs.kotlinx.serialization)) + testImplementation(libs.kotlinx.serialization.core) +} + +configureMavenPublication { + pom { + name.set("MongoDB Kotlin Driver Extensions") + description.set("The MongoDB Kotlin Driver Extensions") + } } -kotlin { explicitApi() } +configureJarManifest { + attributes["Automatic-Module-Name"] = "org.mongodb.driver.kotlin.extensions" + attributes["Bundle-SymbolicName"] = "org.mongodb.mongodb-driver-kotlin-extensions" +} tasks.withType { kotlinOptions { - jvmTarget = "1.8" freeCompilerArgs = listOf( // Adds OnlyInputTypes support @@ -70,101 +54,3 @@ tasks.withType { ) } } - -// =========================== -// Code Quality checks -// =========================== -val customLicenseHeader = "/^(?s)(?!.*@custom-license-header).*/" - -spotless { - kotlinGradle { - ktfmt("0.39").dropboxStyle().configure { it.setMaxWidth(120) } - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - licenseHeaderFile(rootProject.file("config/mongodb.license"), "(group|plugins|import|buildscript|rootProject)") - } - - kotlin { - target("**/*.kt") - ktfmt().dropboxStyle().configure { it.setMaxWidth(120) } - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - - licenseHeaderFile(rootProject.file("config/mongodb.license")) - .named("standard") - .onlyIfContentMatches(customLicenseHeader) - } - - format("extraneous") { - target("*.xml", "*.yml", "*.md") - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - } -} - -tasks.named("check") { dependsOn("spotlessApply") } - -detekt { - allRules = true // fail build on any finding - buildUponDefaultConfig = true // preconfigure defaults - config = rootProject.files("config/detekt/detekt.yml") // point to your custom config defining rules to run, - // overwriting default behavior - baseline = rootProject.file("config/detekt/baseline.xml") // a way of suppressing issues before introducing detekt - source = files(file("src/main/kotlin"), file("src/test/kotlin")) -} - -tasks.withType().configureEach { - reports { - html.required.set(true) // observe findings in your browser with structure and code snippets - xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins - txt.required.set(false) // similar to the console output, contains issue signature to manually edit - } -} - -spotbugs { showProgress.set(true) } - -tasks.spotbugsMain { - // we need the xml report to find out the "rank" (see config/spotbugs/exclude.xml) - reports.getByName("xml") { required.set(true) } -} - -// =========================== -// Test Configuration -// =========================== - -tasks.test { useJUnitPlatform() } - -// =========================== -// Dokka Configuration -// =========================== -val dokkaOutputDir = "${rootProject.buildDir}/docs/${base.archivesName.get()}" - -tasks.dokkaHtml.configure { - outputDirectory.set(file(dokkaOutputDir)) - moduleName.set(base.archivesName.get()) -} - -val cleanDokka by tasks.register("cleanDokka") { delete(dokkaOutputDir) } - -project.parent?.tasks?.named("docs") { - dependsOn(tasks.dokkaHtml) - mustRunAfter(cleanDokka) -} - -tasks.javadocJar.configure { - dependsOn(cleanDokka, tasks.dokkaHtml) - archiveClassifier.set("javadoc") - from(dokkaOutputDir) -} - -// =========================== -// Sources publishing configuration -// =========================== -tasks.sourcesJar { from(project.sourceSets.main.map { it.kotlin }) } - -afterEvaluate { - tasks.jar { manifest { attributes["Automatic-Module-Name"] = "org.mongodb.driver.kotlin.extensions" } } -} diff --git a/driver-kotlin-extensions/src/main/kotlin/com/mongodb/kotlin/client/model/Properties.kt b/driver-kotlin-extensions/src/main/kotlin/com/mongodb/kotlin/client/model/Properties.kt index b35b44d4d93..fc8a4e94e87 100644 --- a/driver-kotlin-extensions/src/main/kotlin/com/mongodb/kotlin/client/model/Properties.kt +++ b/driver-kotlin-extensions/src/main/kotlin/com/mongodb/kotlin/client/model/Properties.kt @@ -67,7 +67,7 @@ public operator fun KProperty1?>.div( * - BsonProperty annotation * - Property name */ -internal fun KProperty.path(): String { +public fun KProperty.path(): String { return if (this is KPropertyPath<*, T>) { this.name } else { diff --git a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/AggregatesTest.kt b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/AggregatesTest.kt index 50f369e50ec..f0fd6d7a1a4 100644 --- a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/AggregatesTest.kt +++ b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/AggregatesTest.kt @@ -61,11 +61,11 @@ import com.mongodb.kotlin.client.model.Aggregates.unwind import com.mongodb.kotlin.client.model.Projections.excludeId import com.mongodb.kotlin.client.model.Projections.projection import com.mongodb.kotlin.client.model.Sorts.ascending +import kotlin.test.Test import kotlin.test.assertEquals import org.bson.BsonDocument import org.bson.conversions.Bson import org.junit.jupiter.api.BeforeAll -import org.junit.jupiter.api.Test import org.mockito.Mock import org.mockito.Mockito.verify import org.mockito.kotlin.doReturn diff --git a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/ExtensionsApiTest.kt b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/ExtensionsApiTest.kt index e4455f9cfc6..5bad9104408 100644 --- a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/ExtensionsApiTest.kt +++ b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/ExtensionsApiTest.kt @@ -16,8 +16,8 @@ package com.mongodb.kotlin.client.model import io.github.classgraph.ClassGraph +import kotlin.test.Test import kotlin.test.assertTrue -import org.junit.jupiter.api.Test class ExtensionsApiTest { diff --git a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/FiltersTest.kt b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/FiltersTest.kt index da15d6ee5af..0ab3d83936a 100644 --- a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/FiltersTest.kt +++ b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/FiltersTest.kt @@ -58,11 +58,11 @@ import com.mongodb.kotlin.client.model.Filters.size import com.mongodb.kotlin.client.model.Filters.text import com.mongodb.kotlin.client.model.Filters.type import com.mongodb.kotlin.client.model.Filters.where +import kotlin.test.Test import kotlin.test.assertEquals import org.bson.BsonDocument import org.bson.BsonType import org.bson.conversions.Bson -import org.junit.Test class FiltersTest { diff --git a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/IndexesTest.kt b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/IndexesTest.kt index 00a819810fe..6c4646dd7f6 100644 --- a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/IndexesTest.kt +++ b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/IndexesTest.kt @@ -26,10 +26,10 @@ import com.mongodb.kotlin.client.model.Indexes.geo2d import com.mongodb.kotlin.client.model.Indexes.geo2dsphere import com.mongodb.kotlin.client.model.Indexes.hashed import com.mongodb.kotlin.client.model.Indexes.text +import kotlin.test.Test import kotlin.test.assertEquals import org.bson.BsonDocument import org.bson.conversions.Bson -import org.junit.Test class IndexesTest { diff --git a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/KPropertiesTest.kt b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/KPropertiesTest.kt index 9d27b86c7ef..0007c6251ea 100644 --- a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/KPropertiesTest.kt +++ b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/KPropertiesTest.kt @@ -17,11 +17,11 @@ package com.mongodb.kotlin.client.model import java.util.Locale +import kotlin.test.Test import kotlin.test.assertEquals import kotlinx.serialization.SerialName import org.bson.codecs.pojo.annotations.BsonId import org.bson.codecs.pojo.annotations.BsonProperty -import org.junit.Test import org.junit.jupiter.api.assertThrows class KPropertiesTest { diff --git a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/ProjectionTest.kt b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/ProjectionTest.kt index b4e49ee7dda..2033713d4dc 100644 --- a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/ProjectionTest.kt +++ b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/ProjectionTest.kt @@ -37,10 +37,10 @@ import com.mongodb.kotlin.client.model.Projections.metaVectorSearchScore import com.mongodb.kotlin.client.model.Projections.projection import com.mongodb.kotlin.client.model.Projections.projectionWith import com.mongodb.kotlin.client.model.Projections.slice +import kotlin.test.Test import kotlin.test.assertEquals import org.bson.BsonDocument import org.bson.conversions.Bson -import org.junit.Test class ProjectionTest { diff --git a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/SortsTest.kt b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/SortsTest.kt index f3740ede352..2a8ec84530f 100644 --- a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/SortsTest.kt +++ b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/SortsTest.kt @@ -22,10 +22,10 @@ import com.mongodb.client.model.Sorts.orderBy import com.mongodb.kotlin.client.model.Sorts.ascending import com.mongodb.kotlin.client.model.Sorts.descending import com.mongodb.kotlin.client.model.Sorts.metaTextScore +import kotlin.test.Test import kotlin.test.assertEquals import org.bson.BsonDocument import org.bson.conversions.Bson -import org.junit.Test class SortsTest { diff --git a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/UpdatesTest.kt b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/UpdatesTest.kt index aa51bc98921..9b07d6b8345 100644 --- a/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/UpdatesTest.kt +++ b/driver-kotlin-extensions/src/test/kotlin/com/mongodb/kotlin/client/model/UpdatesTest.kt @@ -45,6 +45,7 @@ import com.mongodb.kotlin.client.model.Updates.setOnInsert import com.mongodb.kotlin.client.model.Updates.unset import java.time.Instant import java.util.Date +import kotlin.test.Test import kotlin.test.assertEquals import org.bson.BsonDocument import org.bson.Document @@ -53,7 +54,6 @@ import org.bson.codecs.configuration.CodecRegistries.fromProviders import org.bson.codecs.configuration.CodecRegistry import org.bson.codecs.pojo.PojoCodecProvider import org.bson.conversions.Bson -import org.junit.Test class UpdatesTest { @Test diff --git a/driver-kotlin-sync/build.gradle.kts b/driver-kotlin-sync/build.gradle.kts index e7fb132cb36..5da1a5eec26 100644 --- a/driver-kotlin-sync/build.gradle.kts +++ b/driver-kotlin-sync/build.gradle.kts @@ -13,171 +13,35 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import io.gitlab.arturbosch.detekt.Detekt -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication plugins { - id("org.jetbrains.kotlin.jvm") - `java-library` - - // Test based plugins - id("com.diffplug.spotless") - id("org.jetbrains.dokka") - id("io.gitlab.arturbosch.detekt") -} - -repositories { - mavenCentral() - google() + id("project.kotlin") + id("conventions.test-artifacts") + id("conventions.test-artifacts-runtime-dependencies") } base.archivesName.set("mongodb-driver-kotlin-sync") -description = "The MongoDB Kotlin Driver" - -ext.set("pomName", "MongoDB Kotlin Driver") - -sourceSets { - create("integrationTest") { - kotlin.srcDir("$projectDir/src/integration/kotlin") - compileClasspath += sourceSets.main.get().output - runtimeClasspath += sourceSets.main.get().output - compileClasspath += project(":driver-sync").sourceSets.test.get().output - runtimeClasspath += project(":driver-sync").sourceSets.test.get().output - compileClasspath += project(":driver-core").sourceSets.test.get().output - runtimeClasspath += project(":driver-core").sourceSets.test.get().output - compileClasspath += project(":bson").sourceSets.test.get().output - runtimeClasspath += project(":bson").sourceSets.test.get().output - } -} - -val integrationTestImplementation: Configuration by - configurations.getting { extendsFrom(configurations.testImplementation.get()) } - dependencies { - // Align versions of all Kotlin components - implementation(platform("org.jetbrains.kotlin:kotlin-bom")) - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") - api(project(path = ":bson", configuration = "default")) api(project(path = ":driver-sync", configuration = "default")) implementation(project(path = ":bson-kotlin", configuration = "default")) - testImplementation("org.jetbrains.kotlin:kotlin-reflect") - testImplementation("org.jetbrains.kotlin:kotlin-test-junit") - testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0") - testImplementation("org.mockito:mockito-junit-jupiter:4.11.0") - testImplementation("org.assertj:assertj-core:3.24.2") - testImplementation("io.github.classgraph:classgraph:4.8.154") - - integrationTestImplementation("org.jetbrains.kotlin:kotlin-test-junit") - integrationTestImplementation(project(path = ":driver-sync")) - integrationTestImplementation(project(path = ":driver-core")) -} - -kotlin { explicitApi() } - -tasks.withType { kotlinOptions.jvmTarget = "1.8" } - -// =========================== -// Code Quality checks -// =========================== -spotless { - kotlinGradle { - ktfmt("0.39").dropboxStyle().configure { it.setMaxWidth(120) } - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - licenseHeaderFile(rootProject.file("config/mongodb.license"), "(group|plugins|import|buildscript|rootProject)") - } - - kotlin { - target("**/*.kt") - ktfmt().dropboxStyle().configure { it.setMaxWidth(120) } - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - licenseHeaderFile(rootProject.file("config/mongodb.license")) - } - - format("extraneous") { - target("*.xml", "*.yml", "*.md") - trimTrailingWhitespace() - indentWithSpaces() - endWithNewline() - } + integrationTestImplementation(project(path = ":bson", configuration = "testArtifacts")) + integrationTestImplementation(project(path = ":driver-sync", configuration = "testArtifacts")) + integrationTestImplementation(project(path = ":driver-core", configuration = "testArtifacts")) } -tasks.named("check") { dependsOn("spotlessApply") } - -detekt { - allRules = true // fail build on any finding - buildUponDefaultConfig = true // preconfigure defaults - config = rootProject.files("config/detekt/detekt.yml") // point to your custom config defining rules to run, - // overwriting default behavior - baseline = rootProject.file("config/detekt/baseline.xml") // a way of suppressing issues before introducing detekt - source = - files( - file("src/main/kotlin"), - file("src/test/kotlin"), - file("src/integrationTest/kotlin"), - ) -} - -tasks.withType().configureEach { - reports { - html.required.set(true) // observe findings in your browser with structure and code snippets - xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins - txt.required.set(false) // similar to the console output, contains issue signature to manually edit +configureMavenPublication { + pom { + name.set("MongoDB Kotlin Driver") + description.set("The MongoDB Kotlin Driver") } } -spotbugs { - showProgress.set(true) - - tasks.getByName("spotbugsIntegrationTest") { enabled = false } +configureJarManifest { + attributes["Automatic-Module-Name"] = "org.mongodb.driver.kotlin.sync" + attributes["Bundle-SymbolicName"] = "org.mongodb.mongodb-driver-kotlin-sync" } - -// =========================== -// Test Configuration -// =========================== -val integrationTest = - tasks.create("integrationTest", Test::class) { - description = "Runs the integration tests." - group = "verification" - - testClassesDirs = sourceSets["integrationTest"].output.classesDirs - classpath = sourceSets["integrationTest"].runtimeClasspath - } - -tasks.test { useJUnitPlatform() } - -// =========================== -// Dokka Configuration -// =========================== -val dokkaOutputDir = "${rootProject.buildDir}/docs/${base.archivesName.get()}" - -tasks.dokkaHtml.configure { - outputDirectory.set(file(dokkaOutputDir)) - moduleName.set(base.archivesName.get()) -} - -val cleanDokka by tasks.register("cleanDokka") { delete(dokkaOutputDir) } - -project.parent?.tasks?.named("docs") { - dependsOn(tasks.dokkaHtml) - mustRunAfter(cleanDokka) -} - -tasks.javadocJar.configure { - dependsOn(cleanDokka, tasks.dokkaHtml) - archiveClassifier.set("javadoc") - from(dokkaOutputDir) -} - -// =========================== -// Sources publishing configuration -// =========================== -tasks.sourcesJar { from(project.sourceSets.main.map { it.kotlin }) } - -afterEvaluate { tasks.jar { manifest { attributes["Automatic-Module-Name"] = "org.mongodb.driver.kotlin.sync" } } } diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/SmokeTests.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/SmokeTests.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/SmokeTests.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/SmokeTests.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/UnifiedCrudTest.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/UnifiedCrudTest.kt similarity index 93% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/UnifiedCrudTest.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/UnifiedCrudTest.kt index eb06f5c1875..7296ab204bb 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/UnifiedCrudTest.kt +++ b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/UnifiedCrudTest.kt @@ -24,7 +24,7 @@ internal class UnifiedCrudTest() : UnifiedTest() { @JvmStatic @Throws(URISyntaxException::class, IOException::class) fun data(): Collection? { - return getTestData("unified-test-format/crud") + return getTestData("crud", false, Language.KOTLIN) } } } diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/UnifiedTest.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/UnifiedTest.kt similarity index 96% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/UnifiedTest.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/UnifiedTest.kt index 4f4726bbb6f..7c115efc6f8 100644 --- a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/UnifiedTest.kt +++ b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/UnifiedTest.kt @@ -39,4 +39,6 @@ internal abstract class UnifiedTest() : JUnifiedTest() { ): ClientEncryption { TODO("Not yet implemented - JAVA-4896") } + + override fun getLanguage(): Language = Language.KOTLIN } diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncAggregateIterable.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncAggregateIterable.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncAggregateIterable.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncAggregateIterable.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncChangeStreamIterable.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncChangeStreamIterable.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncChangeStreamIterable.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncChangeStreamIterable.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncClientSession.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncClientSession.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncClientSession.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncClientSession.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncDistinctIterable.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncDistinctIterable.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncDistinctIterable.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncDistinctIterable.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncFindIterable.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncFindIterable.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncFindIterable.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncFindIterable.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionNamesIterable.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionNamesIterable.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionNamesIterable.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionNamesIterable.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionsIterable.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionsIterable.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionsIterable.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListCollectionsIterable.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListDatabasesIterable.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListDatabasesIterable.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListDatabasesIterable.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListDatabasesIterable.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListIndexesIterable.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListIndexesIterable.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListIndexesIterable.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListIndexesIterable.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListSearchIndexesIterable.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListSearchIndexesIterable.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListSearchIndexesIterable.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncListSearchIndexesIterable.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoChangeStreamCursor.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoChangeStreamCursor.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoChangeStreamCursor.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoChangeStreamCursor.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoClient.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoClient.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoClient.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoClient.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoCluster.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoCluster.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoCluster.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoCluster.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoCollection.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoCollection.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoCollection.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoCollection.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoCursor.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoCursor.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoCursor.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoCursor.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoDatabase.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoDatabase.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoDatabase.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoDatabase.kt diff --git a/driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoIterable.kt b/driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoIterable.kt similarity index 100% rename from driver-kotlin-sync/src/integration/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoIterable.kt rename to driver-kotlin-sync/src/integrationTest/kotlin/com/mongodb/kotlin/client/syncadapter/SyncMongoIterable.kt diff --git a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/AggregateIterable.kt b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/AggregateIterable.kt index b5449a14645..49130b82c60 100644 --- a/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/AggregateIterable.kt +++ b/driver-kotlin-sync/src/main/kotlin/com/mongodb/kotlin/client/AggregateIterable.kt @@ -61,14 +61,24 @@ public class AggregateIterable(private val wrapped: JAggregateIterable< } /** - * Aggregates documents according to the specified aggregation pipeline, which must end with a $out or $merge stage. + * Aggregates documents according to the specified aggregation pipeline, which must end with an `$out` or `$merge` + * stage. This method is the preferred alternative to [cursor], because this method does what is explicitly + * requested without executing implicit operations. * - * @throws IllegalStateException if the pipeline does not end with a $out or $merge stage + * @throws IllegalStateException if the pipeline does not end with an `$out` or `$merge` stage * @see [$out stage](https://www.mongodb.com/docs/manual/reference/operator/aggregation/out/) * @see [$merge stage](https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge/) */ public fun toCollection(): Unit = wrapped.toCollection() + /** + * Aggregates documents according to the specified aggregation pipeline. + * - If the aggregation pipeline ends with an `$out` or `$merge` stage, then finds all documents in the affected + * namespace and returns a [MongoCursor] over them. You may want to use [toCollection] instead. + * - Otherwise, returns a [MongoCursor] producing no elements. + */ + public override fun cursor(): MongoCursor = super.cursor() + /** * Enables writing to temporary files. A null value indicates that it's unspecified. * diff --git a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/AggregateIterableTest.kt b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/AggregateIterableTest.kt index 89cc8db421e..83ca9bce0ad 100644 --- a/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/AggregateIterableTest.kt +++ b/driver-kotlin-sync/src/test/kotlin/com/mongodb/kotlin/client/AggregateIterableTest.kt @@ -37,7 +37,8 @@ class AggregateIterableTest { @Test fun shouldHaveTheSameMethods() { - val jAggregateIterableFunctions = JAggregateIterable::class.declaredFunctions.map { it.name }.toSet() + val jAggregateIterableFunctions = + JAggregateIterable::class.declaredFunctions.map { it.name }.toSet() - "iterator" val kAggregateIterableFunctions = AggregateIterable::class.declaredFunctions.map { it.name }.toSet() assertEquals(jAggregateIterableFunctions, kAggregateIterableFunctions) diff --git a/driver-lambda/build.gradle b/driver-lambda/build.gradle deleted file mode 100644 index d7b9928e8f7..00000000000 --- a/driver-lambda/build.gradle +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -buildscript { - repositories { - maven { url "https://plugins.gradle.org/m2/" } - } - dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0' - } -} - -plugins { - id("application") -} - -apply plugin: 'application' -apply plugin: 'com.github.johnrengelman.shadow' -apply plugin: 'java' - -compileJava { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 -} - -mainClassName = "com.mongodb.workload.WorkloadExecutor" - -sourceSets { - main { - java { - srcDir 'src/main' - } - resources { - srcDir 'src/resources' - } - } -} - -dependencies { - implementation project(':driver-sync') - implementation project(':bson') - - implementation('com.amazonaws:aws-lambda-java-core:1.2.2') - implementation('com.amazonaws:aws-lambda-java-events:3.11.1') - implementation(platform("org.junit:junit-bom:$junitBomVersion")) - implementation('org.junit.jupiter:junit-jupiter-api') -} - - -javadoc { - enabled = false -} - -jar { - manifest { - attributes "Main-Class": "com.mongodb.lambdatest.LambdaTestApp" - } -} - -shadowJar { - archiveBaseName.set('lambdatest') - archiveVersion.set('') -} diff --git a/driver-lambda/build.gradle.kts b/driver-lambda/build.gradle.kts new file mode 100644 index 00000000000..d5cd57cfaa9 --- /dev/null +++ b/driver-lambda/build.gradle.kts @@ -0,0 +1,64 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + +plugins { + id("application") + id("java-library") + id("project.base") + alias(libs.plugins.shadow) +} + +application { + mainClass = "com.mongodb.lambdatest.LambdaTestApp" +} + +sourceSets { + main { + java { setSrcDirs(listOf("src/main")) } + resources { setSrcDirs(listOf("src/resources")) } + } +} + +dependencies { + implementation(project(":driver-sync")) + implementation(project(":bson")) + + implementation(libs.aws.lambda.core) + implementation(libs.aws.lambda.events) + implementation(platform(libs.junit.bom)) + implementation(libs.bundles.junit) +} + +tasks.withType().configureEach { + enabled = false +} + +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + +tasks.withType { + manifest { + attributes["Main-Class"] = "com.mongodb.lambdatest.LambdaTestApp" + } +} +tasks.withType { + archiveBaseName.set("lambdatest") + archiveVersion.set("") +} diff --git a/driver-lambda/template.yaml b/driver-lambda/template.yaml index 7a53bb20272..9441f804f20 100644 --- a/driver-lambda/template.yaml +++ b/driver-lambda/template.yaml @@ -37,26 +37,6 @@ Resources: Properties: Path: /mongodb Method: get - ApplicationResourceGroup: - Type: AWS::ResourceGroups::Group - Properties: - Name: - Fn::Join: - - '' - - - ApplicationInsights-SAM- - - Ref: AWS::StackName - ResourceQuery: - Type: CLOUDFORMATION_STACK_1_0 - ApplicationInsightsMonitoring: - Type: AWS::ApplicationInsights::Application - Properties: - ResourceGroupName: - Fn::Join: - - '' - - - ApplicationInsights-SAM- - - Ref: AWS::StackName - AutoConfigurationEnabled: true - DependsOn: ApplicationResourceGroup Outputs: LambdaTestApi: Description: API Gateway endpoint URL for Prod stage for Lambda Test function diff --git a/driver-legacy/build.gradle.kts b/driver-legacy/build.gradle.kts new file mode 100644 index 00000000000..2855bce4cdf --- /dev/null +++ b/driver-legacy/build.gradle.kts @@ -0,0 +1,48 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication + +plugins { + id("project.java") + id("conventions.test-artifacts") + id("conventions.test-artifacts-runtime-dependencies") + id("conventions.test-include-optionals") + id("conventions.testing-junit") + id("conventions.testing-spock-exclude-slow") +} + +base.archivesName.set("mongodb-driver-legacy") + +dependencies { + api(project(path = ":bson", configuration = "default")) + api(project(path = ":driver-core", configuration = "default")) + api(project(path = ":driver-sync", configuration = "default")) + + testImplementation(project(path = ":bson", configuration = "testArtifacts")) + testImplementation(project(path = ":driver-core", configuration = "testArtifacts")) + testImplementation(project(path = ":driver-sync", configuration = "testArtifacts")) +} + +configureMavenPublication { + pom { + name.set("The Legacy MongoDB Driver") + description.set("The Legacy MongoDB Driver") + } +} + +// Disable the manifest for driver-legacy as its not a valid OSGI package +configureJarManifest { attributes["-nomanifest"] = true } diff --git a/driver-legacy/src/main/com/mongodb/MongoClient.java b/driver-legacy/src/main/com/mongodb/MongoClient.java index 1d888988aca..21323a40604 100644 --- a/driver-legacy/src/main/com/mongodb/MongoClient.java +++ b/driver-legacy/src/main/com/mongodb/MongoClient.java @@ -21,6 +21,7 @@ import com.mongodb.client.ListDatabasesIterable; import com.mongodb.client.MongoDatabase; import com.mongodb.client.MongoIterable; +import com.mongodb.client.internal.Clusters; import com.mongodb.client.internal.MongoClientImpl; import com.mongodb.client.internal.OperationExecutor; import com.mongodb.connection.ClusterConnectionMode; @@ -37,6 +38,7 @@ import com.mongodb.internal.connection.Connection; import com.mongodb.internal.connection.NoOpSessionContext; import com.mongodb.internal.connection.OperationContext; +import com.mongodb.internal.connection.StreamFactoryFactory; import com.mongodb.internal.diagnostics.logging.Logger; import com.mongodb.internal.diagnostics.logging.Loggers; import com.mongodb.internal.session.ServerSessionPool; @@ -63,8 +65,11 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; +import static com.mongodb.assertions.Assertions.notNull; import static com.mongodb.internal.connection.ClientMetadataHelper.createClientMetadataDocument; import static com.mongodb.internal.connection.ServerAddressHelper.createServerAddress; +import static com.mongodb.internal.connection.ServerAddressHelper.getInetAddressResolver; +import static com.mongodb.internal.connection.StreamFactoryHelper.getSyncStreamFactoryFactory; import static java.lang.String.format; import static java.util.Collections.singletonList; import static java.util.concurrent.TimeUnit.SECONDS; @@ -244,8 +249,20 @@ public MongoClient(final MongoClientSettings settings, @Nullable final MongoDriv private MongoClient(final MongoClientSettings settings, @Nullable final MongoClientOptions options, @Nullable final MongoDriverInformation mongoDriverInformation) { + notNull("settings", settings); + MongoDriverInformation wrappedMongoDriverInformation = wrapMongoDriverInformation(mongoDriverInformation); - delegate = new MongoClientImpl(settings, wrappedMongoDriverInformation); + + StreamFactoryFactory syncStreamFactoryFactory = getSyncStreamFactoryFactory( + settings.getTransportSettings(), + getInetAddressResolver(settings)); + + Cluster cluster = Clusters.createCluster( + settings, + wrappedMongoDriverInformation, + syncStreamFactoryFactory); + + delegate = new MongoClientImpl(cluster, settings, wrappedMongoDriverInformation, syncStreamFactoryFactory); this.options = options != null ? options : MongoClientOptions.builder(settings).build(); cursorCleaningService = this.options.isCursorFinalizerEnabled() ? createCursorCleaningService() : null; this.closed = new AtomicBoolean(); diff --git a/driver-legacy/src/test/functional/com/mongodb/MongoClientSessionSpecification.groovy b/driver-legacy/src/test/functional/com/mongodb/MongoClientSessionSpecification.groovy index e6929fa4020..b76872c3d81 100644 --- a/driver-legacy/src/test/functional/com/mongodb/MongoClientSessionSpecification.groovy +++ b/driver-legacy/src/test/functional/com/mongodb/MongoClientSessionSpecification.groovy @@ -28,7 +28,7 @@ import org.bson.Document import org.bson.types.ObjectId import org.junit.Assert import spock.lang.IgnoreIf -import util.spock.annotations.Slow +import com.mongodb.spock.Slow import java.util.concurrent.TimeUnit diff --git a/driver-legacy/src/test/unit/com/mongodb/MongoClientSpecification.groovy b/driver-legacy/src/test/unit/com/mongodb/MongoClientSpecification.groovy index c007e504ae6..0816dc83a87 100644 --- a/driver-legacy/src/test/unit/com/mongodb/MongoClientSpecification.groovy +++ b/driver-legacy/src/test/unit/com/mongodb/MongoClientSpecification.groovy @@ -309,7 +309,7 @@ class MongoClientSpecification extends Specification { def 'should validate the ChangeStreamIterable pipeline data correctly'() { given: def executor = new TestOperationExecutor([]) - def client = new MongoClientImpl(Stub(Cluster), null, MongoClientSettings.builder().build(), executor) + def client = new MongoClientImpl(Stub(Cluster), null, MongoClientSettings.builder().build(), null, executor) when: client.watch((Class) null) diff --git a/driver-reactive-streams/build.gradle b/driver-reactive-streams/build.gradle deleted file mode 100644 index 7b86f010484..00000000000 --- a/driver-reactive-streams/build.gradle +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -description = "A Reactive Streams implementation of the MongoDB Java driver" -archivesBaseName = 'mongodb-driver-reactivestreams' - -dependencies { - api project(path: ':bson', configuration: 'default') - api project(path: ':driver-core', configuration: 'default') - - api 'org.reactivestreams:reactive-streams:1.0.4' - implementation platform("io.projectreactor:reactor-bom:$projectReactorVersion") - implementation 'io.projectreactor:reactor-core' - - testImplementation project(':bson').sourceSets.test.output - testImplementation project(':driver-sync') - testImplementation project(':driver-sync').sourceSets.test.output - testImplementation project(':driver-core').sourceSets.test.output - testImplementation 'org.reactivestreams:reactive-streams-tck:1.0.4' - testImplementation 'io.projectreactor:reactor-test' - if ('8'.equals(findProperty("javaVersion"))) { - testImplementation 'org.mockito:mockito-junit-jupiter:4.6.1' - } else { - testImplementation 'org.mockito:mockito-junit-jupiter:5.11.0' - } - - testRuntimeOnly project(path: ':driver-core', configuration: 'consumableTestRuntimeOnly') -} - -sourceSets { - test.groovy.srcDirs += ['src/examples'] - test.java.srcDirs += ['src/test/tck'] -} - -test { - exclude 'tour/**' -} - -// Reactive Streams TCK uses TestNG, and Gradle can't run TestNG and JUnit in the same run. -task tckTest(type: Test) { - useTestNG() - scanForTestClasses = false - - classpath = sourceSets.test.runtimeClasspath - testClassesDirs = sourceSets.test.output.classesDirs - - binaryResultsDirectory.set(file("$buildDir/$name-results/binary")) - reports { - html.destination = file("$buildDir/reports/$name") - junitXml.destination = file("$buildDir/$name-results") - } - - maxParallelForks = 1 -} - -ext { - pomName = 'The MongoDB Reactive Streams Driver' -} - -afterEvaluate { - jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.driver.reactivestreams' - jar.manifest.attributes['Bundle-SymbolicName'] = 'org.mongodb.driver-reactivestreams' - jar.manifest.attributes['Import-Package'] = [ - 'com.mongodb.crypt.capi.*;resolution:=optional', - 'com.mongodb.internal.crypt.capi.*;resolution:=optional', - '*', - ].join(',') -} diff --git a/driver-reactive-streams/build.gradle.kts b/driver-reactive-streams/build.gradle.kts new file mode 100644 index 00000000000..f1c758b31da --- /dev/null +++ b/driver-reactive-streams/build.gradle.kts @@ -0,0 +1,79 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication + +plugins { + id("project.java") + id("conventions.test-artifacts") + id("conventions.test-artifacts-runtime-dependencies") + id("conventions.test-include-optionals") + id("conventions.testing-mockito") + id("conventions.testing-junit") + id("conventions.testing-spock-exclude-slow") +} + +base.archivesName.set("mongodb-driver-reactivestreams") + +dependencies { + api(project(path = ":bson", configuration = "default")) + api(project(path = ":driver-core", configuration = "default")) + api(libs.reactive.streams) + implementation(platform(libs.project.reactor.bom)) + implementation(libs.project.reactor.core) + compileOnly(project(path = ":mongodb-crypt", configuration = "default")) + + testImplementation(libs.project.reactor.test) + testImplementation(project(path = ":driver-sync", configuration = "default")) + testImplementation(project(path = ":bson", configuration = "testArtifacts")) + testImplementation(project(path = ":driver-core", configuration = "testArtifacts")) + testImplementation(project(path = ":driver-sync", configuration = "testArtifacts")) + + // Reactive Streams TCK testing + testImplementation(libs.reactive.streams.tck) +} + +configureMavenPublication { + pom { + name.set("The MongoDB Reactive Streams Driver") + description.set("A Reactive Streams implementation of the MongoDB Java driver") + } +} + +configureJarManifest { + attributes["Automatic-Module-Name"] = "org.mongodb.driver.reactivestreams" + attributes["Bundle-SymbolicName"] = "org.mongodb.driver-reactivestreams" + attributes["Import-Package"] = + listOf( + "com.mongodb.crypt.capi.*;resolution:=optional", + "com.mongodb.internal.crypt.capi.*;resolution:=optional", + "*" // import all that is not excluded or modified before + ) + .joinToString(",") +} + +sourceSets { test { java { setSrcDirs(listOf("src/test/tck")) } } } + +// Reactive Streams TCK uses TestNG +tasks.register("tckTest", Test::class) { + useTestNG() + maxParallelForks = 1 + isScanForTestClasses = false + + binaryResultsDirectory.set(layout.buildDirectory.dir("$name-results/binary")) + reports.html.outputLocation.set(layout.buildDirectory.dir("reports/$name")) + reports.junitXml.outputLocation.set(layout.buildDirectory.dir("reports/$name-results")) +} diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java index 0642d0fc8f9..4f18fe272bc 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/AggregatePublisher.java @@ -17,15 +17,19 @@ package com.mongodb.reactivestreams.client; import com.mongodb.ExplainVerbosity; +import com.mongodb.MongoNamespace; import com.mongodb.annotations.Alpha; import com.mongodb.annotations.Reason; import com.mongodb.client.cursor.TimeoutMode; +import com.mongodb.client.model.Aggregates; import com.mongodb.client.model.Collation; +import com.mongodb.client.model.MergeOptions; import com.mongodb.lang.Nullable; import org.bson.BsonValue; import org.bson.Document; import org.bson.conversions.Bson; import org.reactivestreams.Publisher; +import org.reactivestreams.Subscriber; import java.util.concurrent.TimeUnit; @@ -83,13 +87,32 @@ public interface AggregatePublisher extends Publisher { AggregatePublisher bypassDocumentValidation(@Nullable Boolean bypassDocumentValidation); /** - * Aggregates documents according to the specified aggregation pipeline, which must end with a $out stage. + * Aggregates documents according to the specified aggregation pipeline, which must end with an + * {@link Aggregates#out(String, String) $out} or {@link Aggregates#merge(MongoNamespace, MergeOptions) $merge} stage. + * Calling this method and then {@linkplain Publisher#subscribe(Subscriber) subscribing} to the returned {@link Publisher} + * is the preferred alternative to {@linkplain #subscribe(Subscriber) subscribing} to this {@link AggregatePublisher}, + * because this method does what is explicitly requested without executing implicit operations. * + * @throws IllegalStateException if the pipeline does not end with an {@code $out} or {@code $merge} stage * @return an empty publisher that indicates when the operation has completed * @mongodb.driver.manual aggregation/ Aggregation */ Publisher toCollection(); + /** + * Requests {@link AggregatePublisher} to start streaming data according to the specified aggregation pipeline. + *

    + *
  • + * If the aggregation pipeline ends with an {@link Aggregates#out(String, String) $out} or + * {@link Aggregates#merge(MongoNamespace, MergeOptions) $merge} stage, + * then {@linkplain MongoCollection#find() finds all} documents in the affected namespace and produces them. + * You may want to use {@link #toCollection()} instead.
  • + *
  • + * Otherwise, produces no elements.
  • + *
+ */ + void subscribe(Subscriber s); + /** * Sets the collation options * diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/MapReducePublisher.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/MapReducePublisher.java index 2add0f33691..d104f77ee5f 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/MapReducePublisher.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/MapReducePublisher.java @@ -16,7 +16,6 @@ package com.mongodb.reactivestreams.client; - import com.mongodb.annotations.Alpha; import com.mongodb.annotations.Reason; import com.mongodb.client.cursor.TimeoutMode; @@ -24,11 +23,15 @@ import com.mongodb.lang.Nullable; import org.bson.conversions.Bson; import org.reactivestreams.Publisher; +import org.reactivestreams.Subscriber; import java.util.concurrent.TimeUnit; /** * Publisher for map reduce. + *

+ * By default, the {@code MapReducePublisher} produces the results inline. You can write map-reduce output to a collection by using the + * {@link #collectionName(String)} and {@link #toCollection()} methods.

* * @param The type of the result. * @since 1.0 @@ -44,6 +47,7 @@ public interface MapReducePublisher extends Publisher { * * @param collectionName the name of the collection that you want the map-reduce operation to write its output. * @return this + * @see #toCollection() */ MapReducePublisher collectionName(String collectionName); @@ -152,14 +156,30 @@ public interface MapReducePublisher extends Publisher { MapReducePublisher bypassDocumentValidation(@Nullable Boolean bypassDocumentValidation); /** - * Aggregates documents to a collection according to the specified map-reduce function with the given options, which must specify a - * non-inline result. + * Aggregates documents to a collection according to the specified map-reduce function with the given options, which must not produce + * results inline. Calling this method and then {@linkplain Publisher#subscribe(Subscriber) subscribing} to the returned + * {@link Publisher} is the preferred alternative to {@linkplain #subscribe(Subscriber) subscribing} to this {@link MapReducePublisher}, + * because this method does what is explicitly requested without executing implicit operations. * * @return an empty publisher that indicates when the operation has completed + * @throws IllegalStateException if a {@linkplain #collectionName(String) collection name} to write the results to has not been specified + * @see #collectionName(String) * @mongodb.driver.manual aggregation/ Aggregation */ Publisher toCollection(); + /** + * Requests {@link MapReducePublisher} to start streaming data according to the specified map-reduce function with the given options. + *
    + *
  • + * If the aggregation produces results inline, then {@linkplain MongoCollection#find() finds all} documents in the + * affected namespace and produces them. You may want to use {@link #toCollection()} instead.
  • + *
  • + * Otherwise, produces no elements.
  • + *
+ */ + void subscribe(Subscriber s); + /** * Sets the collation options * diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/CryptConnection.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/CryptConnection.java index 23c6a060749..c05bfb663f2 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/CryptConnection.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/CryptConnection.java @@ -16,15 +16,14 @@ package com.mongodb.reactivestreams.client.internal.crypt; -import com.mongodb.MongoClientException; import com.mongodb.ReadPreference; import com.mongodb.connection.ConnectionDescription; import com.mongodb.internal.async.SingleResultCallback; import com.mongodb.internal.connection.AsyncConnection; import com.mongodb.internal.connection.Connection; -import com.mongodb.internal.connection.MessageSettings; import com.mongodb.internal.connection.MessageSequences; import com.mongodb.internal.connection.MessageSequences.EmptyMessageSequences; +import com.mongodb.internal.connection.MessageSettings; import com.mongodb.internal.connection.OperationContext; import com.mongodb.internal.connection.SplittablePayload; import com.mongodb.internal.connection.SplittablePayloadBsonWriter; @@ -54,7 +53,6 @@ import java.util.function.Function; import static com.mongodb.assertions.Assertions.fail; -import static com.mongodb.internal.operation.ServerVersionHelper.serverIsLessThanVersionFourDotTwo; import static com.mongodb.reactivestreams.client.internal.MongoOperationPublisher.sinkToCallback; import static org.bson.codecs.configuration.CodecRegistries.fromProviders; @@ -105,11 +103,6 @@ public void commandAsync(final String database, final BsonDocument command, final OperationContext operationContext, final boolean responseExpected, final MessageSequences sequences, final SingleResultCallback callback) { - if (serverIsLessThanVersionFourDotTwo(wrapped.getDescription())) { - callback.onResult(null, new MongoClientException("Auto-encryption requires a minimum MongoDB version of 4.2")); - return; - } - try { SplittablePayload payload = null; FieldNameValidator payloadFieldNameValidator = null; diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/KeyManagementService.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/KeyManagementService.java index 019445e6cde..b82dd590618 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/KeyManagementService.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/crypt/KeyManagementService.java @@ -39,7 +39,7 @@ import com.mongodb.lang.Nullable; import org.bson.ByteBuf; import org.bson.ByteBufNIO; -import org.jetbrains.annotations.NotNull; +import com.mongodb.lang.NonNull; import reactor.core.publisher.Mono; import reactor.core.publisher.MonoSink; @@ -179,7 +179,7 @@ private OperationContext createOperationContext(@Nullable final Timeout operatio return OperationContext.simpleOperationContext(new TimeoutContext(timeoutSettings)); } - @NotNull + @NonNull private static TimeoutSettings createTimeoutSettings(final SocketSettings socketSettings, @Nullable final Long ms) { return new TimeoutSettings( diff --git a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/package-info.java b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/package-info.java index bedf55f98e5..80d98a2346a 100644 --- a/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/package-info.java +++ b/driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/package-info.java @@ -18,7 +18,7 @@ * This packages contains classes for the reactive stream client implementation. *

* All API {@link org.reactivestreams.Publisher}s are - * cold, + * cold, * meaning that nothing happens until they are subscribed to. * So just creating a {@link org.reactivestreams.Publisher} won’t cause any network IO. * It’s not until {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)} is called that the driver executes the diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/AtlasSearchIndexManagementProseTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/AtlasSearchIndexManagementProseTest.java index 9c7870d1952..d2db1b57ffc 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/AtlasSearchIndexManagementProseTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/AtlasSearchIndexManagementProseTest.java @@ -23,7 +23,7 @@ import com.mongodb.reactivestreams.client.syncadapter.SyncMongoClient; /** - * See Search Index Management Tests + * See Search Index Management Tests */ public class AtlasSearchIndexManagementProseTest extends AbstractAtlasSearchIndexManagementProseTest { protected MongoClient createMongoClient(final MongoClientSettings settings) { diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionBsonSizeLimitsSpecification.groovy b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionBsonSizeLimitsSpecification.groovy index c044e8e1f56..17805e5f2a0 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionBsonSizeLimitsSpecification.groovy +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionBsonSizeLimitsSpecification.groovy @@ -58,7 +58,7 @@ class ClientSideEncryptionBsonSizeLimitsSpecification extends FunctionalSpecific drop(autoEncryptingCollectionNamespace) new CollectionHelper<>(new BsonDocumentCodec(), keyVaultNamespace).insertDocuments( - [getTestDocument('/client-side-encryption-limits/limits-key.json')], + [getTestDocument('client-side-encryption/limits/limits-key.json')], WriteConcern.MAJORITY) def providerProperties = @@ -71,7 +71,7 @@ class ClientSideEncryptionBsonSizeLimitsSpecification extends FunctionalSpecific .keyVaultNamespace(keyVaultNamespace.fullName) .kmsProviders(providerProperties) .schemaMap(singletonMap(autoEncryptingCollectionNamespace.fullName, - getTestDocument('/client-side-encryption-limits/limits-schema.json'))) + getTestDocument('client-side-encryption/limits/limits-schema.json'))) .build()) .addCommandListener(commandListener) .build()) @@ -96,7 +96,7 @@ class ClientSideEncryptionBsonSizeLimitsSpecification extends FunctionalSpecific noExceptionThrown() when: - Mono.from(autoEncryptingDataCollection.insertOne(getTestDocument('/client-side-encryption-limits/limits-doc.json') + Mono.from(autoEncryptingDataCollection.insertOne(getTestDocument('client-side-encryption/limits/limits-doc.json') .append('_id', new BsonString('encryption_exceeds_2mib')) .append('unencrypted', new BsonString('a' * (2097152 - 2000)))) ).block(TIMEOUT_DURATION) @@ -122,10 +122,10 @@ class ClientSideEncryptionBsonSizeLimitsSpecification extends FunctionalSpecific commandListener.reset() Mono.from(autoEncryptingDataCollection.insertMany( [ - getTestDocument('/client-side-encryption-limits/limits-doc.json') + getTestDocument('client-side-encryption/limits/limits-doc.json') .append('_id', new BsonString('encryption_exceeds_2mib_1')) .append('unencrypted', new BsonString('a' * (2097152 - 2000))), - getTestDocument('/client-side-encryption-limits/limits-doc.json') + getTestDocument('client-side-encryption/limits/limits-doc.json') .append('_id', new BsonString('encryption_exceeds_2mib_2')) .append('unencrypted', new BsonString('a' * (2097152 - 2000))), ])).block(TIMEOUT_DURATION) @@ -143,7 +143,7 @@ class ClientSideEncryptionBsonSizeLimitsSpecification extends FunctionalSpecific noExceptionThrown() when: - Mono.from(autoEncryptingDataCollection.insertOne(getTestDocument('/client-side-encryption-limits/limits-doc.json') + Mono.from(autoEncryptingDataCollection.insertOne(getTestDocument('client-side-encryption/limits/limits-doc.json') .append('_id', new BsonString('encryption_exceeds_16mib')) .append('unencrypted', new BsonString('a' * (16777216 - 2000))))).block(TIMEOUT_DURATION) diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionCorpusTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionCorpusTest.java index 9a44252b938..d709999f712 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionCorpusTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionCorpusTest.java @@ -38,7 +38,6 @@ import org.junit.runners.Parameterized; import reactor.core.publisher.Mono; -import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import java.util.Arrays; @@ -283,9 +282,8 @@ public void testCorpus() throws IOException, URISyntaxException { } } - private static BsonDocument bsonDocumentFromPath(final String path) throws IOException, URISyntaxException { - return getTestDocument(new File(ClientSideEncryptionCorpusTest.class - .getResource("/client-side-encryption-corpus/" + path).toURI())); + private static BsonDocument bsonDocumentFromPath(final String path) { + return getTestDocument("client-side-encryption/corpus/" + path); } @Parameterized.Parameters(name = "useLocalSchema: {0}") diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionExternalKeyVaultTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionExternalKeyVaultTest.java index bc43222239f..745f901c5c1 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionExternalKeyVaultTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionExternalKeyVaultTest.java @@ -36,9 +36,6 @@ import org.junit.runners.Parameterized; import reactor.core.publisher.Mono; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Arrays; import java.util.Base64; import java.util.Collection; @@ -146,9 +143,8 @@ public void testExternal() { assertEquals(authExceptionThrown, withExternalKeyVault); } - private static BsonDocument bsonDocumentFromPath(final String path) throws IOException, URISyntaxException { - return getTestDocument(new File(ClientSideEncryptionExternalKeyVaultTest.class - .getResource("/client-side-encryption-external/" + path).toURI())); + private static BsonDocument bsonDocumentFromPath(final String path) { + return getTestDocument("client-side-encryption/external/" + path); } @Parameterized.Parameters(name = "withExternalKeyVault: {0}") diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionSessionTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionSessionTest.java index f6814013779..86f0db51a38 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionSessionTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ClientSideEncryptionSessionTest.java @@ -31,9 +31,6 @@ import org.junit.runners.Parameterized; import reactor.core.publisher.Mono; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Arrays; import java.util.Base64; import java.util.Collection; @@ -152,8 +149,7 @@ public void testWithExplicitSession() throws Throwable { assertEquals(6, encryptedDocument.getBinary("encrypted").getType()); } - private static BsonDocument bsonDocumentFromPath(final String path) throws IOException, URISyntaxException { - return getTestDocument(new File(ClientSideEncryptionSessionTest.class - .getResource("/client-side-encryption-external/" + path).toURI())); + private static BsonDocument bsonDocumentFromPath(final String path) { + return getTestDocument("client-side-encryption/external/" + path); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/MongoClientSessionSpecification.groovy b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/MongoClientSessionSpecification.groovy index 64c1386e0e7..5fda2f76319 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/MongoClientSessionSpecification.groovy +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/MongoClientSessionSpecification.groovy @@ -32,7 +32,7 @@ import org.bson.Document import org.junit.Assert import reactor.core.publisher.Mono import spock.lang.IgnoreIf -import util.spock.annotations.Slow +import com.mongodb.spock.Slow import java.util.concurrent.TimeUnit diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ReactiveInitialDnsSeedlistDiscoveryTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ReactiveInitialDnsSeedlistDiscoveryTest.java index cdc30a80cdc..834bf6ddf35 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ReactiveInitialDnsSeedlistDiscoveryTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/ReactiveInitialDnsSeedlistDiscoveryTest.java @@ -24,14 +24,13 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import java.nio.file.Path; import java.util.List; // See https://github.com/mongodb/specifications/tree/master/source/initial-dns-seedlist-discovery/tests @RunWith(Parameterized.class) public class ReactiveInitialDnsSeedlistDiscoveryTest extends InitialDnsSeedlistDiscoveryTest { - public ReactiveInitialDnsSeedlistDiscoveryTest(final String filename, final Path parentDirectory, final String uri, + public ReactiveInitialDnsSeedlistDiscoveryTest(final String filename, final String parentDirectory, final String uri, final List seeds, final Integer numSeeds, final List hosts, final Integer numHosts, final BsonDocument options, final BsonDocument parsedOptions, final boolean isError, final boolean executePingCommand) { diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/RetryableWritesProseTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/RetryableWritesProseTest.java index 11b26d9d28a..39178750bd4 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/RetryableWritesProseTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/RetryableWritesProseTest.java @@ -40,7 +40,7 @@ /** * See - * Retryable Write Prose Tests. + * Retryable Write Prose Tests. */ public class RetryableWritesProseTest extends DatabaseTestCase { private CollectionHelper collectionHelper; diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/WriteConcernProseTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/WriteConcernProseTest.java index 127290cc60b..d06dece28a7 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/WriteConcernProseTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/WriteConcernProseTest.java @@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assumptions.assumeTrue; -// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.rst#prose-tests +// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.md#prose-tests public class WriteConcernProseTest extends DatabaseTestCase { private BsonDocument failPointDocument; private CollectionHelper collectionHelper; diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ChangeStreamsTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ChangeStreamsTest.java index 6775cc8570e..8555e312db9 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ChangeStreamsTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ChangeStreamsTest.java @@ -18,12 +18,11 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class ChangeStreamsTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/change-streams"); + + private static Collection data() { + return getTestData("change-streams"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ClientSideEncryptionTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ClientSideEncryptionTest.java index 8169a300e0e..084974481e9 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ClientSideEncryptionTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ClientSideEncryptionTest.java @@ -18,12 +18,11 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class ClientSideEncryptionTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/client-side-encryption"); + + private static Collection data() { + return getTestData("client-side-encryption/tests/unified"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ClientSideOperationTimeoutTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ClientSideOperationTimeoutTest.java index 168ff4b8f81..c6d9c13964f 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ClientSideOperationTimeoutTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ClientSideOperationTimeoutTest.java @@ -31,8 +31,6 @@ import org.junit.jupiter.params.provider.MethodSource; import reactor.core.publisher.Hooks; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; import java.util.List; import java.util.concurrent.atomic.AtomicReference; @@ -50,8 +48,8 @@ public class ClientSideOperationTimeoutTest extends UnifiedReactiveStreamsTest { private final AtomicReference atomicReferenceThrowable = new AtomicReference<>(); - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/client-side-operation-timeout"); + private static Collection data() { + return getTestData("client-side-operations-timeout"); } @Override @@ -81,6 +79,10 @@ The Reactive Streams specification prevents us from allowing a subsequent next c // No withTransaction support assumeFalse(fileDescription.contains("withTransaction") || testDescription.contains("withTransaction")); + assumeFalse(fileDescription.equals("operations ignore deprecated timeout options if timeoutMS is set") + && (testDescription.startsWith("abortTransaction ignores") || testDescription.startsWith("commitTransaction ignores")), + "No operation session based overrides"); + if (testDescription.equals("timeoutMS is refreshed for close")) { enableSleepAfterCursorError(256); } @@ -99,18 +101,25 @@ The Reactive Streams specification prevents us from allowing a subsequent next c @MethodSource("data") @Override public void shouldPassAllOutcomes( + final String testName, @Nullable final String fileDescription, @Nullable final String testDescription, @Nullable final String directoryName, + final int attemptNumber, + final int totalAttempts, final String schemaVersion, @Nullable final BsonArray runOnRequirements, final BsonArray entitiesArray, final BsonArray initialData, final BsonDocument definition) { try { - super.shouldPassAllOutcomes(fileDescription, + super.shouldPassAllOutcomes( + testName, + fileDescription, testDescription, directoryName, + attemptNumber, + totalAttempts, schemaVersion, runOnRequirements, entitiesArray, diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/CollectionManagementTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/CollectionManagementTest.java index 5e3038a06c8..98267aefaa8 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/CollectionManagementTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/CollectionManagementTest.java @@ -18,12 +18,11 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class CollectionManagementTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/collection-management"); + + private static Collection data() { + return getTestData("collection-management"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/CommandLoggingTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/CommandLoggingTest.java index 10d563cb928..2e05b73ea26 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/CommandLoggingTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/CommandLoggingTest.java @@ -18,12 +18,11 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class CommandLoggingTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/command-logging"); + + private static Collection data() { + return getTestData("command-logging-and-monitoring/tests/logging"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/CommandMonitoringTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/CommandMonitoringTest.java index c30ca720b46..2bddcbe8e45 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/CommandMonitoringTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/CommandMonitoringTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class CommandMonitoringTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/command-monitoring"); + private static Collection data() { + return getTestData("command-logging-and-monitoring/tests/monitoring"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ConnectionPoolLoggingTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ConnectionPoolLoggingTest.java index 12db392686f..92beec1e28b 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ConnectionPoolLoggingTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ConnectionPoolLoggingTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class ConnectionPoolLoggingTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/connection-monitoring-and-pooling/logging"); + private static Collection data() { + return getTestData("connection-monitoring-and-pooling/tests/logging"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/IndexManagmentTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/IndexManagementTest.java similarity index 72% rename from driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/IndexManagmentTest.java rename to driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/IndexManagementTest.java index 931a53dba40..df6bf08cea8 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/IndexManagmentTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/IndexManagementTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; -final class IndexManagmentTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/index-management"); +final class IndexManagementTest extends UnifiedReactiveStreamsTest { + private static Collection data() { + return getTestData("index-management"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/LoadBalancerTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/LoadBalancerTest.java index f60f42139b4..cf6bb04c2de 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/LoadBalancerTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/LoadBalancerTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class LoadBalancerTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/load-balancers"); + private static Collection data() { + return getTestData("load-balancers"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ServerSelectionLoggingTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ServerSelectionLoggingTest.java index d78522fb75c..9491ee604a7 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ServerSelectionLoggingTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ServerSelectionLoggingTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class ServerSelectionLoggingTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/server-selection/logging"); + private static Collection data() { + return getTestData("server-selection/tests/logging"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/SessionsTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/SessionsTest.java index 81cd47637a0..61e775d6458 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/SessionsTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/SessionsTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class SessionsTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/sessions"); + private static Collection data() { + return getTestData("sessions"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedCrudTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedCrudTest.java index b8fd81ac7c7..d602af5cd5e 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedCrudTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedCrudTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedCrudTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/crud"); + private static Collection data() { + return getTestData("crud"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedGridFSTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedGridFSTest.java index eefc6839d17..242bcdef72c 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedGridFSTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedGridFSTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedGridFSTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/gridfs"); + private static Collection data() { + return getTestData("gridfs"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedReactiveStreamsTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedReactiveStreamsTest.java index 62c1315e240..640d88964ce 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedReactiveStreamsTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedReactiveStreamsTest.java @@ -24,6 +24,7 @@ import com.mongodb.client.unified.UnifiedTest; import com.mongodb.client.unified.UnifiedTestModifications; import com.mongodb.client.vault.ClientEncryption; +import com.mongodb.lang.NonNull; import com.mongodb.reactivestreams.client.MongoClients; import com.mongodb.reactivestreams.client.gridfs.GridFSBuckets; import com.mongodb.reactivestreams.client.internal.vault.ClientEncryptionImpl; @@ -31,6 +32,9 @@ import com.mongodb.reactivestreams.client.syncadapter.SyncGridFSBucket; import com.mongodb.reactivestreams.client.syncadapter.SyncMongoClient; import com.mongodb.reactivestreams.client.syncadapter.SyncMongoDatabase; +import org.junit.jupiter.params.provider.Arguments; + +import java.util.Collection; import static com.mongodb.client.unified.UnifiedTestModifications.Modifier; import static com.mongodb.client.unified.UnifiedTestModifications.TestDef; @@ -94,4 +98,9 @@ protected void postCleanUp(final TestDef testDef) { disableSleep(); } } + + @NonNull + protected static Collection getTestData(final String directory) { + return getTestData(directory, true, Language.JAVA); + } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedRetryableReadsTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedRetryableReadsTest.java index 4f2336f4173..854ad88e092 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedRetryableReadsTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedRetryableReadsTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedRetryableReadsTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/retryable-reads"); + private static Collection data() { + return getTestData("retryable-reads"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedRetryableWritesTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedRetryableWritesTest.java index 8fbfb43d92d..132dec7a07b 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedRetryableWritesTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedRetryableWritesTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedRetryableWritesTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/retryable-writes"); + private static Collection data() { + return getTestData("retryable-writes"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedServerDiscoveryAndMonitoringTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedServerDiscoveryAndMonitoringTest.java index e4fb6da3627..40d607bb706 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedServerDiscoveryAndMonitoringTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedServerDiscoveryAndMonitoringTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedServerDiscoveryAndMonitoringTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/server-discovery-and-monitoring"); + private static Collection data() { + return getTestData("server-discovery-and-monitoring"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedTransactionsTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedTransactionsTest.java index c1990e5d830..2da185c390e 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedTransactionsTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedTransactionsTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedTransactionsTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/transactions"); + private static Collection data() { + return getTestData("transactions"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedWriteConcernTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedWriteConcernTest.java index 3b7fa4afb00..fc10247c349 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedWriteConcernTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedWriteConcernTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedWriteConcernTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/write-concern"); + private static Collection data() { + return getTestData("read-write-concern"); } } diff --git a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/VersionedApiTest.java b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/VersionedApiTest.java index 5a0d4b69dcd..8378fb00482 100644 --- a/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/VersionedApiTest.java +++ b/driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/VersionedApiTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class VersionedApiTest extends UnifiedReactiveStreamsTest { - private static Collection data() throws URISyntaxException, IOException { + private static Collection data() { return getTestData("versioned-api"); } } diff --git a/driver-scala/build.gradle b/driver-scala/build.gradle deleted file mode 100644 index e9e9e15040e..00000000000 --- a/driver-scala/build.gradle +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -description = "A Scala wrapper of the MongoDB Reactive Streams Java driver" -archivesBaseName = 'mongo-scala-driver' - - -dependencies { - api project(path: ':bson-scala', configuration: 'default') - api project(path: ':driver-reactive-streams', configuration: 'default') - compileOnly 'com.google.code.findbugs:jsr305:1.3.9' - - testImplementation project(':driver-sync') - testImplementation project(':bson').sourceSets.test.output - testImplementation project(':driver-sync').sourceSets.test.output - testImplementation project(':driver-core').sourceSets.test.output - testImplementation project(':driver-reactive-streams').sourceSets.test.output - testRuntimeOnly project(path: ':driver-core', configuration: 'consumableTestRuntimeOnly') -} - -sourceSets { - integrationTest { - scala.srcDir file('src/integration/scala') - scala { - compileClasspath += main.output - runtimeClasspath += main.output - } - } -} - -test { - maxParallelForks = 1 -} - -tasks.withType(Test) { - doFirst { - println("Running Test task using scala version: $scalaVersion") - } -} - -tasks.withType(ScalaCompile) { - if(scalaVersion.startsWith("2.11")) { - // Better support SAM style closures in scala 2.11 - scalaCompileOptions.additionalParameters.addAll([ - // Better support SAM style closures in scala 2.11 - "-Xexperimental" - ]) - } -} - -task integrationTest(type: Test) { - delete 'build/test-integration' - testClassesDirs = sourceSets.integrationTest.output.classesDirs - classpath = sourceSets.integrationTest.runtimeClasspath - mustRunAfter test -} - -check.dependsOn integrationTest - -// =================== -// Scala checks -// =================== -tasks.register("scalaCheck") { - description = "Runs all the Scala checks" - group = "verification" - - dependsOn("clean", "compileTestScala", "compileIntegrationTestScala", "check") - tasks.findByName("check").mustRunAfter("clean") -} - - -task aggregatedScalaDoc(type: ScalaDoc) { - description('Unified Scaladoc for bson-scala and driver-scala') - group('documentation') - ext.fromProjects = [ - project(':bson-scala'), - project(':driver-scala') - ] - destinationDir = file("${rootProject.buildDir.path}/docs/${project.archivesBaseName}") - classpath = project.sourceSets.main.compileClasspath - source = fromProjects.collect { it.sourceSets.main.allSource } - - scalaDocOptions.additionalParameters = ["-doc-root-content", "${project.rootDir}/driver-scala/rootdoc.txt" as String] -} -project.parent.tasks.named("docs"){ it.dependsOn(aggregatedScalaDoc) } - -configurations { - integrationTestImplementation { - extendsFrom testImplementation - canBeResolved = true - } -} - -idea { - module { - testSourceDirs += sourceSets.integrationTest.scala.srcDirs - testResourceDirs += sourceSets.integrationTest.resources.srcDirs - scopes.TEST.plus += [ configurations.integrationTestImplementation ] - } -} - - -ext { - pomName = 'Mongo Scala Driver' -} - -afterEvaluate { - jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.driver.scala' - jar.manifest.attributes['Import-Package'] = [ - '!scala.*', - '*' - ].join(',') -} diff --git a/driver-scala/build.gradle.kts b/driver-scala/build.gradle.kts new file mode 100644 index 00000000000..68187889629 --- /dev/null +++ b/driver-scala/build.gradle.kts @@ -0,0 +1,61 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication +import ProjectExtensions.scalaVersion + +plugins { id("project.scala") } + +base.archivesName.set("mongo-scala-driver") + +val scalaVersion: String = project.scalaVersion() + +dependencies { + api(project(path = ":bson-scala", configuration = "default")) + api(project(path = ":driver-reactive-streams", configuration = "default")) + compileOnly(libs.findbugs.jsr) + + testImplementation(project(path = ":driver-sync", configuration = "default")) + testImplementation(project(path = ":bson", configuration = "testArtifacts")) + testImplementation(project(path = ":driver-core", configuration = "testArtifacts")) + testImplementation(project(path = ":driver-sync", configuration = "testArtifacts")) + testImplementation(project(path = ":driver-reactive-streams", configuration = "testArtifacts")) + + // Encryption testing + integrationTestImplementation(project(path = ":mongodb-crypt", configuration = "default")) +} + +configureMavenPublication { + pom { + name.set("Mongo Scala Driver") + description.set("A Scala wrapper of the MongoDB Reactive Streams Java driver") + } +} + +configureJarManifest { + attributes["Automatic-Module-Name"] = "org.mongodb.driver.scala" + attributes["Bundle-SymbolicName"] = "org.mongodb.scala.mongo-scala-driver" + attributes["Import-Package"] = "!scala.*,*" +} + +// =================== +// Scala docs +// =================== +tasks.withType().forEach { + // Include bson-scala source for main scaladoc + project(":bson-scala").tasks.withType().forEach { bsonScala -> it.source += bsonScala.source } + it.scalaDocOptions.additionalParameters = listOf("-doc-root-content", "${project.rootDir}/driver-scala/rootdoc.txt") +} diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/BaseSpec.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/BaseSpec.scala similarity index 88% rename from driver-scala/src/integration/scala/org/mongodb/scala/BaseSpec.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/BaseSpec.scala index 98ce89a88fe..9d59b8f55e6 100644 --- a/driver-scala/src/integration/scala/org/mongodb/scala/BaseSpec.scala +++ b/driver-scala/src/integrationTest/scala/org/mongodb/scala/BaseSpec.scala @@ -15,10 +15,7 @@ */ package org.mongodb.scala -import org.junit.runner.RunWith import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers -import org.scalatestplus.junit.JUnitRunner -@RunWith(classOf[JUnitRunner]) abstract class BaseSpec extends AnyFlatSpec with Matchers {} diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/ClientSideEncryptionBypassAutoEncryptionSpec.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/ClientSideEncryptionBypassAutoEncryptionSpec.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/ClientSideEncryptionBypassAutoEncryptionSpec.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/ClientSideEncryptionBypassAutoEncryptionSpec.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/ClientSideEncryptionTest.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/ClientSideEncryptionTest.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/ClientSideEncryptionTest.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/ClientSideEncryptionTest.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/FuturesSpec.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/FuturesSpec.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/FuturesSpec.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/FuturesSpec.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/MongoCollectionCaseClassSpec.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/MongoCollectionCaseClassSpec.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/MongoCollectionCaseClassSpec.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/MongoCollectionCaseClassSpec.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/RequiresMongoDBISpec.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/RequiresMongoDBISpec.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/RequiresMongoDBISpec.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/RequiresMongoDBISpec.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/TestMongoClientHelper.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/TestMongoClientHelper.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/TestMongoClientHelper.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/TestMongoClientHelper.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/documentation/DocumentationChangeStreamExampleSpec.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/documentation/DocumentationChangeStreamExampleSpec.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/documentation/DocumentationChangeStreamExampleSpec.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/documentation/DocumentationChangeStreamExampleSpec.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/documentation/DocumentationExampleSpec.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/documentation/DocumentationExampleSpec.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/documentation/DocumentationExampleSpec.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/documentation/DocumentationExampleSpec.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/documentation/DocumentationTransactionsExampleSpec.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/documentation/DocumentationTransactionsExampleSpec.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/documentation/DocumentationTransactionsExampleSpec.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/documentation/DocumentationTransactionsExampleSpec.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/gridfs/GridFSObservableSpec.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/gridfs/GridFSObservableSpec.scala similarity index 98% rename from driver-scala/src/integration/scala/org/mongodb/scala/gridfs/GridFSObservableSpec.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/gridfs/GridFSObservableSpec.scala index 55f943a9402..e6ca96183e6 100644 --- a/driver-scala/src/integration/scala/org/mongodb/scala/gridfs/GridFSObservableSpec.scala +++ b/driver-scala/src/integrationTest/scala/org/mongodb/scala/gridfs/GridFSObservableSpec.scala @@ -20,7 +20,6 @@ import java.io.ByteArrayOutputStream import java.nio.ByteBuffer import java.nio.channels.Channels import java.util.UUID - import org.bson.UuidRepresentation import org.bson.codecs.UuidCodec import org.bson.codecs.configuration.CodecRegistries @@ -31,6 +30,7 @@ import org.scalatest.BeforeAndAfterEach import org.scalatest.exceptions.TestFailedException import scala.annotation.tailrec +import scala.concurrent.Await class GridFSObservableSpec extends RequiresMongoDBISpec with FuturesSpec with BeforeAndAfterEach { private val filesCollectionName = "fs.files" @@ -45,13 +45,13 @@ class GridFSObservableSpec extends RequiresMongoDBISpec with FuturesSpec with Be val mongoDatabase = mongoClient().getDatabase(databaseName) _filesCollection = Some(mongoDatabase.getCollection[GridFSFile](filesCollectionName)) _chunksCollection = Some(mongoDatabase.getCollection(chunksCollectionName)) - _filesCollection.map(_.drop()) - _chunksCollection.map(_.drop()) + _filesCollection.foreach(coll => Await.result(coll.drop().toFuture(), WAIT_DURATION)) + _chunksCollection.foreach(coll => Await.result(coll.drop().toFuture(), WAIT_DURATION)) _gridFSBucket = Some(GridFSBucket(mongoDatabase)) } override def afterEach(): Unit = { - withDatabase(db => db.drop()) + withDatabase(db => Await.result(db.drop().toFuture(), WAIT_DURATION)) } private def gridFSBucket = _gridFSBucket.get diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncAggregateIterable.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncAggregateIterable.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncAggregateIterable.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncAggregateIterable.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncChangeStreamIterable.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncChangeStreamIterable.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncChangeStreamIterable.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncChangeStreamIterable.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncClientSession.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncClientSession.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncClientSession.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncClientSession.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncDistinctIterable.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncDistinctIterable.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncDistinctIterable.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncDistinctIterable.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncFindIterable.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncFindIterable.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncFindIterable.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncFindIterable.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncListCollectionsIterable.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncListCollectionsIterable.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncListCollectionsIterable.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncListCollectionsIterable.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncListDatabasesIterable.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncListDatabasesIterable.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncListDatabasesIterable.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncListDatabasesIterable.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncListIndexesIterable.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncListIndexesIterable.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncListIndexesIterable.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncListIndexesIterable.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncListSearchIndexesIterable.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncListSearchIndexesIterable.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncListSearchIndexesIterable.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncListSearchIndexesIterable.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMapReduceIterable.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMapReduceIterable.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMapReduceIterable.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMapReduceIterable.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoClient.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoClient.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoClient.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoClient.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoCluster.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoCluster.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoCluster.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoCluster.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoCollection.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoCollection.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoCollection.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoCollection.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoCursor.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoCursor.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoCursor.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoCursor.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoDatabase.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoDatabase.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoDatabase.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoDatabase.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoIterable.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoIterable.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/SyncMongoIterable.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/SyncMongoIterable.scala diff --git a/driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/package.scala b/driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/package.scala similarity index 100% rename from driver-scala/src/integration/scala/org/mongodb/scala/syncadapter/package.scala rename to driver-scala/src/integrationTest/scala/org/mongodb/scala/syncadapter/package.scala diff --git a/driver-scala/src/integration/scala/tour/ClientSideEncryptionAutoEncryptionSettingsTour.scala b/driver-scala/src/integrationTest/scala/tour/ClientSideEncryptionAutoEncryptionSettingsTour.scala similarity index 100% rename from driver-scala/src/integration/scala/tour/ClientSideEncryptionAutoEncryptionSettingsTour.scala rename to driver-scala/src/integrationTest/scala/tour/ClientSideEncryptionAutoEncryptionSettingsTour.scala diff --git a/driver-scala/src/integration/scala/tour/ClientSideEncryptionExplicitEncryptionAndDecryptionTour.scala b/driver-scala/src/integrationTest/scala/tour/ClientSideEncryptionExplicitEncryptionAndDecryptionTour.scala similarity index 100% rename from driver-scala/src/integration/scala/tour/ClientSideEncryptionExplicitEncryptionAndDecryptionTour.scala rename to driver-scala/src/integrationTest/scala/tour/ClientSideEncryptionExplicitEncryptionAndDecryptionTour.scala diff --git a/driver-scala/src/integration/scala/tour/ClientSideEncryptionExplicitEncryptionOnlyTour.scala b/driver-scala/src/integrationTest/scala/tour/ClientSideEncryptionExplicitEncryptionOnlyTour.scala similarity index 100% rename from driver-scala/src/integration/scala/tour/ClientSideEncryptionExplicitEncryptionOnlyTour.scala rename to driver-scala/src/integrationTest/scala/tour/ClientSideEncryptionExplicitEncryptionOnlyTour.scala diff --git a/driver-scala/src/integration/scala/tour/ClientSideEncryptionSimpleTour.scala b/driver-scala/src/integrationTest/scala/tour/ClientSideEncryptionSimpleTour.scala similarity index 100% rename from driver-scala/src/integration/scala/tour/ClientSideEncryptionSimpleTour.scala rename to driver-scala/src/integrationTest/scala/tour/ClientSideEncryptionSimpleTour.scala diff --git a/driver-scala/src/integration/scala/tour/GridFSTour.scala b/driver-scala/src/integrationTest/scala/tour/GridFSTour.scala similarity index 100% rename from driver-scala/src/integration/scala/tour/GridFSTour.scala rename to driver-scala/src/integrationTest/scala/tour/GridFSTour.scala diff --git a/driver-scala/src/integration/scala/tour/Helpers.scala b/driver-scala/src/integrationTest/scala/tour/Helpers.scala similarity index 100% rename from driver-scala/src/integration/scala/tour/Helpers.scala rename to driver-scala/src/integrationTest/scala/tour/Helpers.scala diff --git a/driver-scala/src/integration/scala/tour/QuickTour.scala b/driver-scala/src/integrationTest/scala/tour/QuickTour.scala similarity index 100% rename from driver-scala/src/integration/scala/tour/QuickTour.scala rename to driver-scala/src/integrationTest/scala/tour/QuickTour.scala diff --git a/driver-scala/src/integration/scala/tour/QuickTourCaseClass.scala b/driver-scala/src/integrationTest/scala/tour/QuickTourCaseClass.scala similarity index 100% rename from driver-scala/src/integration/scala/tour/QuickTourCaseClass.scala rename to driver-scala/src/integrationTest/scala/tour/QuickTourCaseClass.scala diff --git a/driver-scala/src/main/scala/org/mongodb/scala/AggregateObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/AggregateObservable.scala index d496a4ab8a2..a363ee21662 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/AggregateObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/AggregateObservable.scala @@ -25,6 +25,7 @@ import org.mongodb.scala.bson.BsonValue import org.mongodb.scala.bson.DefaultHelper.DefaultsTo import org.mongodb.scala.bson.conversions.Bson import org.mongodb.scala.model.Collation +import org.reactivestreams.Subscriber import scala.concurrent.duration.Duration import scala.reflect.ClassTag @@ -192,9 +193,14 @@ case class AggregateObservable[TResult](private val wrapped: AggregatePublisher[ } /** - * Aggregates documents according to the specified aggregation pipeline, which must end with a `\$out` stage. + * Aggregates documents according to the specified aggregation pipeline, which must end with an `\$out` or `\$merge` stage. + * Calling this method and then `subscribing` to the returned [[SingleObservable]] + * is the preferred alternative to subscribing to this [[AggregateObservable]], + * because this method does what is explicitly requested without executing implicit operations. * * [[https://www.mongodb.com/docs/manual/aggregation/ Aggregation]] + * + * @throws java.lang.IllegalStateException if the pipeline does not end with an `\$out` or `\$merge` stage * @return an Observable that indicates when the operation has completed. */ def toCollection(): SingleObservable[Unit] = wrapped.toCollection() @@ -257,5 +263,23 @@ case class AggregateObservable[TResult](private val wrapped: AggregatePublisher[ )(implicit e: ExplainResult DefaultsTo Document, ct: ClassTag[ExplainResult]): SingleObservable[ExplainResult] = wrapped.explain[ExplainResult](ct, verbosity) + /** + * Requests [[AggregateObservable]] to start streaming data according to the specified aggregation pipeline. + * + * - If the aggregation pipeline ends with an `\$out` or `\$merge` stage, + * then finds all documents in the affected namespace and produces them. + * You may want to use [[toCollection]] instead. + * - Otherwise, produces no elements. + */ override def subscribe(observer: Observer[_ >: TResult]): Unit = wrapped.subscribe(observer) + + /** + * Requests [[AggregateObservable]] to start streaming data according to the specified aggregation pipeline. + * + * - If the aggregation pipeline ends with an `\$out` or `\$merge` stage, + * then finds all documents in the affected namespace and produces them. + * You may want to use [[toCollection]] instead. + * - Otherwise, produces no elements. + */ + override def subscribe(observer: Subscriber[_ >: TResult]): Unit = wrapped.subscribe(observer) } diff --git a/driver-scala/src/main/scala/org/mongodb/scala/MapReduceObservable.scala b/driver-scala/src/main/scala/org/mongodb/scala/MapReduceObservable.scala index 0ed78bb775b..a7f08258cd7 100644 --- a/driver-scala/src/main/scala/org/mongodb/scala/MapReduceObservable.scala +++ b/driver-scala/src/main/scala/org/mongodb/scala/MapReduceObservable.scala @@ -23,12 +23,16 @@ import com.mongodb.client.model.MapReduceAction import com.mongodb.reactivestreams.client.MapReducePublisher import org.mongodb.scala.bson.conversions.Bson import org.mongodb.scala.model.Collation +import org.reactivestreams.Subscriber import scala.concurrent.duration.Duration /** * Observable for map reduce. * + * By default, the [[MapReduceObservable]] produces the results inline. You can write map-reduce output to a collection by using the + * [[collectionName]] and [[toCollection]] methods. + * * @define docsRef https://www.mongodb.com/docs/manual/reference * * @tparam TResult The type of the result. @@ -44,6 +48,7 @@ case class MapReduceObservable[TResult](wrapped: MapReducePublisher[TResult]) ex * * @param collectionName the name of the collection that you want the map-reduce operation to write its output. * @return this + * @see [[toCollection]] */ def collectionName(collectionName: String): MapReduceObservable[TResult] = { wrapped.collectionName(collectionName) @@ -214,11 +219,15 @@ case class MapReduceObservable[TResult](wrapped: MapReducePublisher[TResult]) ex } /** - * Aggregates documents to a collection according to the specified map-reduce function with the given options, which must specify a - * non-inline result. + * Aggregates documents to a collection according to the specified map-reduce function with the given options, which must not produce + * results inline. Calling this method and then subscribing to the returned [[SingleObservable]] is the preferred alternative to + * subscribing to this [[MapReduceObservable]], + * because this method does what is explicitly requested without executing implicit operations. * * @return an Observable that indicates when the operation has completed * [[https://www.mongodb.com/docs/manual/aggregation/ Aggregation]] + * @throws java.lang.IllegalStateException if a collection name to write the results to has not been specified + * @see [[collectionName]] */ def toCollection(): SingleObservable[Unit] = wrapped.toCollection() @@ -246,5 +255,21 @@ case class MapReduceObservable[TResult](wrapped: MapReducePublisher[TResult]) ex */ def first(): SingleObservable[TResult] = wrapped.first() + /** + * Requests [[MapReduceObservable]] to start streaming data according to the specified map-reduce function with the given options. + * + * - If the aggregation produces results inline, then finds all documents in the + * affected namespace and produces them. You may want to use [[toCollection]] instead. + * - Otherwise, produces no elements. + */ override def subscribe(observer: Observer[_ >: TResult]): Unit = wrapped.subscribe(observer) + + /** + * Requests [[MapReduceObservable]] to start streaming data according to the specified map-reduce function with the given options. + * + * - If the aggregation produces results inline, then finds all documents in the + * affected namespace and produces them. You may want to use [[toCollection]] instead. + * - Otherwise, produces no elements. + */ + override def subscribe(observer: Subscriber[_ >: TResult]): Unit = wrapped.subscribe(observer) } diff --git a/driver-scala/src/test/scala/org/mongodb/scala/ApiAliasAndCompanionSpec.scala b/driver-scala/src/test/scala/org/mongodb/scala/ApiAliasAndCompanionSpec.scala index 2e21d30526a..a5b76965651 100644 --- a/driver-scala/src/test/scala/org/mongodb/scala/ApiAliasAndCompanionSpec.scala +++ b/driver-scala/src/test/scala/org/mongodb/scala/ApiAliasAndCompanionSpec.scala @@ -73,6 +73,7 @@ class ApiAliasAndCompanionSpec extends BaseSpec { "ServerSession", "SessionContext", "SingleResultCallback", + "Slow", "SubjectProvider", "TransactionExample", "UnixServerAddress", diff --git a/driver-scala/src/test/scala/org/mongodb/scala/BaseSpec.scala b/driver-scala/src/test/scala/org/mongodb/scala/BaseSpec.scala index 98ce89a88fe..9d59b8f55e6 100644 --- a/driver-scala/src/test/scala/org/mongodb/scala/BaseSpec.scala +++ b/driver-scala/src/test/scala/org/mongodb/scala/BaseSpec.scala @@ -15,10 +15,7 @@ */ package org.mongodb.scala -import org.junit.runner.RunWith import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers -import org.scalatestplus.junit.JUnitRunner -@RunWith(classOf[JUnitRunner]) abstract class BaseSpec extends AnyFlatSpec with Matchers {} diff --git a/driver-sync/build.gradle b/driver-sync/build.gradle deleted file mode 100644 index 1c2f3ac6c59..00000000000 --- a/driver-sync/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -archivesBaseName = 'mongodb-driver-sync' -description = 'The MongoDB Synchronous Driver' -ext { - pomName = 'MongoDB Driver' -} - -dependencies { - api project(path: ':bson', configuration: 'default') - api project(path: ':driver-core', configuration: 'default') - - testImplementation project(':bson').sourceSets.test.output - testImplementation project(':driver-core').sourceSets.test.output - testRuntimeOnly project(path: ':driver-core', configuration: 'consumableTestRuntimeOnly') - - testImplementation('com.amazonaws:aws-lambda-java-core:1.2.1') -} - -sourceSets { - test.groovy.srcDirs += ['src/examples'] -} - -test { - exclude 'tour/**' -} - -tasks.withType(Checkstyle) { - // needed so the Javadoc checks can find the code in other modules - classpath = files(project(':driver-core').sourceSets.main.output, sourceSets.main.output) -} - -afterEvaluate { - jar.manifest.attributes['Automatic-Module-Name'] = 'org.mongodb.driver.sync.client' - jar.manifest.attributes['Bundle-SymbolicName'] = 'org.mongodb.driver-sync' - jar.manifest.attributes['Import-Package'] = [ - 'com.mongodb.crypt.capi.*;resolution:=optional', - 'com.mongodb.internal.crypt.capi.*;resolution:=optional', - '*', - ].join(',') -} diff --git a/driver-sync/build.gradle.kts b/driver-sync/build.gradle.kts new file mode 100644 index 00000000000..95cd0979973 --- /dev/null +++ b/driver-sync/build.gradle.kts @@ -0,0 +1,60 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication + +plugins { + id("project.java") + id("conventions.test-artifacts") + id("conventions.test-artifacts-runtime-dependencies") + id("conventions.test-include-optionals") + id("conventions.testing-mockito") + id("conventions.testing-junit") + id("conventions.testing-spock-exclude-slow") +} + +base.archivesName.set("mongodb-driver-sync") + +dependencies { + api(project(path = ":bson", configuration = "default")) + api(project(path = ":driver-core", configuration = "default")) + compileOnly(project(path = ":mongodb-crypt", configuration = "default")) + + testImplementation(project(path = ":bson", configuration = "testArtifacts")) + testImplementation(project(path = ":driver-core", configuration = "testArtifacts")) + + // lambda testing + testImplementation(libs.aws.lambda.core) +} + +configureMavenPublication { + pom { + name.set("MongoDB Driver") + description.set("The MongoDB Synchronous Driver") + } +} + +configureJarManifest { + attributes["Automatic-Module-Name"] = "org.mongodb.driver.sync.client" + attributes["Bundle-SymbolicName"] = "org.mongodb.driver-sync" + attributes["Import-Package"] = + listOf( + "com.mongodb.crypt.capi.*;resolution:=optional", + "com.mongodb.internal.crypt.capi.*;resolution:=optional", + "*", + ) + .joinToString(",") +} diff --git a/driver-sync/src/main/com/mongodb/client/AggregateIterable.java b/driver-sync/src/main/com/mongodb/client/AggregateIterable.java index 5f7a0dc2aff..032e1860244 100644 --- a/driver-sync/src/main/com/mongodb/client/AggregateIterable.java +++ b/driver-sync/src/main/com/mongodb/client/AggregateIterable.java @@ -17,10 +17,13 @@ package com.mongodb.client; import com.mongodb.ExplainVerbosity; +import com.mongodb.MongoNamespace; import com.mongodb.annotations.Alpha; import com.mongodb.annotations.Reason; import com.mongodb.client.cursor.TimeoutMode; +import com.mongodb.client.model.Aggregates; import com.mongodb.client.model.Collation; +import com.mongodb.client.model.MergeOptions; import com.mongodb.lang.Nullable; import org.bson.BsonValue; import org.bson.Document; @@ -38,15 +41,48 @@ public interface AggregateIterable extends MongoIterable { /** - * Aggregates documents according to the specified aggregation pipeline, which must end with a $out or $merge stage. + * Aggregates documents according to the specified aggregation pipeline, which must end with an + * {@link Aggregates#out(String, String) $out} or {@link Aggregates#merge(MongoNamespace, MergeOptions) $merge} stage. + * This method is the preferred alternative to {@link #iterator()}, {@link #cursor()}, + * because this method does what is explicitly requested without executing implicit operations. * - * @throws IllegalStateException if the pipeline does not end with a $out or $merge stage + * @throws IllegalStateException if the pipeline does not end with an {@code $out} or {@code $merge} stage * @mongodb.driver.manual reference/operator/aggregation/out/ $out stage * @mongodb.driver.manual reference/operator/aggregation/merge/ $merge stage * @since 3.4 */ void toCollection(); + /** + * Aggregates documents according to the specified aggregation pipeline. + *

    + *
  • + * If the aggregation pipeline ends with an {@link Aggregates#out(String, String) $out} or + * {@link Aggregates#merge(MongoNamespace, MergeOptions) $merge} stage, + * then {@linkplain MongoCollection#find() finds all} documents in the affected namespace and returns a {@link MongoCursor} + * over them. You may want to use {@link #toCollection()} instead.
  • + *
  • + * Otherwise, returns a {@link MongoCursor} producing no elements.
  • + *
+ */ + @Override + MongoCursor iterator(); + + /** + * Aggregates documents according to the specified aggregation pipeline. + *
    + *
  • + * If the aggregation pipeline ends with an {@link Aggregates#out(String, String) $out} or + * {@link Aggregates#merge(MongoNamespace, MergeOptions) $merge} stage, + * then {@linkplain MongoCollection#find() finds all} documents in the affected namespace and returns a {@link MongoCursor} + * over them. You may want to use {@link #toCollection()} instead.
  • + *
  • + * Otherwise, returns a {@link MongoCursor} producing no elements.
  • + *
+ */ + @Override + MongoCursor cursor(); + /** * Enables writing to temporary files. A null value indicates that it's unspecified. * diff --git a/driver-sync/src/main/com/mongodb/client/MapReduceIterable.java b/driver-sync/src/main/com/mongodb/client/MapReduceIterable.java index d406e785da7..13d029155f9 100644 --- a/driver-sync/src/main/com/mongodb/client/MapReduceIterable.java +++ b/driver-sync/src/main/com/mongodb/client/MapReduceIterable.java @@ -27,9 +27,9 @@ /** * Iterable for map-reduce. - * - *

By default the {@code MapReduceIterable} returns the results inline. You can write map-reduce output to a collection by using the - * {@link MapReduceIterable#collectionName(String)} method.

+ *

+ * By default, the {@code MapReduceIterable} produces the results inline. You can write map-reduce output to a collection by using the + * {@link #collectionName(String)} and {@link #toCollection()} methods.

* * @param The type of the result. * @since 3.0 @@ -39,15 +39,42 @@ public interface MapReduceIterable extends MongoIterable { /** - * Aggregates documents to a collection according to the specified map-reduce function with the given options, which must specify a - * non-inline result. + * Aggregates documents to a collection according to the specified map-reduce function with the given options, which must not produce + * results inline. This method is the preferred alternative to {@link #iterator()}, {@link #cursor()}, + * because this method does what is explicitly requested without executing implicit operations. * - * @throws IllegalStateException if a collection name to write the results to has not been specified + * @throws IllegalStateException if a {@linkplain #collectionName(String) collection name} to write the results to has not been specified * @see #collectionName(String) * @since 3.4 */ void toCollection(); + /** + * Aggregates documents according to the specified map-reduce function with the given options. + *
    + *
  • + * If the aggregation produces results inline, then {@linkplain MongoCollection#find() finds all} documents in the + * affected namespace and returns a {@link MongoCursor} over them. You may want to use {@link #toCollection()} instead.
  • + *
  • + * Otherwise, returns a {@link MongoCursor} producing no elements.
  • + *
+ */ + @Override + MongoCursor iterator(); + + /** + * Aggregates documents according to the specified map-reduce function with the given options. + *
    + *
  • + * If the aggregation produces results inline, then {@linkplain MongoCollection#find() finds all} documents in the + * affected namespace and returns a {@link MongoCursor} over them. You may want to use {@link #toCollection()} instead.
  • + *
  • + * Otherwise, returns a {@link MongoCursor} producing no elements.
  • + *
+ */ + @Override + MongoCursor cursor(); + /** * Sets the collectionName for the output of the MapReduce * @@ -55,6 +82,7 @@ public interface MapReduceIterable extends MongoIterable { * * @param collectionName the name of the collection that you want the map-reduce operation to write its output. * @return this + * @see #toCollection() */ MapReduceIterable collectionName(String collectionName); diff --git a/driver-sync/src/main/com/mongodb/client/MongoClients.java b/driver-sync/src/main/com/mongodb/client/MongoClients.java index f9f87001d31..e0e59ba5f78 100644 --- a/driver-sync/src/main/com/mongodb/client/MongoClients.java +++ b/driver-sync/src/main/com/mongodb/client/MongoClients.java @@ -19,9 +19,16 @@ import com.mongodb.ConnectionString; import com.mongodb.MongoClientSettings; import com.mongodb.MongoDriverInformation; +import com.mongodb.client.internal.Clusters; import com.mongodb.client.internal.MongoClientImpl; +import com.mongodb.internal.connection.Cluster; +import com.mongodb.internal.connection.StreamFactoryFactory; import com.mongodb.lang.Nullable; +import static com.mongodb.assertions.Assertions.notNull; +import static com.mongodb.internal.connection.ServerAddressHelper.getInetAddressResolver; +import static com.mongodb.internal.connection.StreamFactoryHelper.getSyncStreamFactoryFactory; + /** * A factory for {@link MongoClient} instances. Use of this class is now the recommended way to connect to MongoDB via the Java driver. @@ -103,9 +110,23 @@ public static MongoClient create(final ConnectionString connectionString, * @return the client */ public static MongoClient create(final MongoClientSettings settings, @Nullable final MongoDriverInformation mongoDriverInformation) { + notNull("settings", settings); + MongoDriverInformation.Builder builder = mongoDriverInformation == null ? MongoDriverInformation.builder() : MongoDriverInformation.builder(mongoDriverInformation); - return new MongoClientImpl(settings, builder.driverName("sync").build()); + + MongoDriverInformation driverInfo = builder.driverName("sync").build(); + + StreamFactoryFactory syncStreamFactoryFactory = getSyncStreamFactoryFactory( + settings.getTransportSettings(), + getInetAddressResolver(settings)); + + Cluster cluster = Clusters.createCluster( + settings, + driverInfo, + syncStreamFactoryFactory); + + return new MongoClientImpl(cluster, settings, driverInfo, syncStreamFactoryFactory); } private MongoClients() { diff --git a/driver-sync/src/main/com/mongodb/client/MongoIterable.java b/driver-sync/src/main/com/mongodb/client/MongoIterable.java index 06bec548c77..e69d499c8f7 100644 --- a/driver-sync/src/main/com/mongodb/client/MongoIterable.java +++ b/driver-sync/src/main/com/mongodb/client/MongoIterable.java @@ -29,13 +29,16 @@ */ public interface MongoIterable extends Iterable { + /** + * @return A {@link MongoCursor} that must be {@linkplain MongoCursor#close() closed}. + */ @Override MongoCursor iterator(); /** * Returns a cursor used for iterating over elements of type {@code TResult}. The cursor is primarily used for change streams. * - * @return a cursor + * @return a cursor equivalent to that returned from {@link #iterator()}. * @since 3.11 */ MongoCursor cursor(); diff --git a/driver-sync/src/main/com/mongodb/client/internal/Clusters.java b/driver-sync/src/main/com/mongodb/client/internal/Clusters.java new file mode 100644 index 00000000000..6c57505e090 --- /dev/null +++ b/driver-sync/src/main/com/mongodb/client/internal/Clusters.java @@ -0,0 +1,63 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.mongodb.client.internal; + +import com.mongodb.MongoClientSettings; +import com.mongodb.MongoDriverInformation; +import com.mongodb.connection.SocketSettings; +import com.mongodb.internal.TimeoutSettings; +import com.mongodb.internal.connection.Cluster; +import com.mongodb.internal.connection.DefaultClusterFactory; +import com.mongodb.internal.connection.InternalConnectionPoolSettings; +import com.mongodb.internal.connection.StreamFactory; +import com.mongodb.internal.connection.StreamFactoryFactory; +import com.mongodb.lang.Nullable; + +import static com.mongodb.assertions.Assertions.assertNotNull; +import static com.mongodb.internal.event.EventListenerHelper.getCommandListener; + +public final class Clusters { + + private Clusters() { + //NOP + } + + public static Cluster createCluster(final MongoClientSettings settings, + @Nullable final MongoDriverInformation mongoDriverInformation, + final StreamFactoryFactory streamFactoryFactory) { + assertNotNull(streamFactoryFactory); + assertNotNull(settings); + + StreamFactory streamFactory = getStreamFactory(streamFactoryFactory, settings, false); + StreamFactory heartbeatStreamFactory = getStreamFactory(streamFactoryFactory, settings, true); + + return new DefaultClusterFactory().createCluster(settings.getClusterSettings(), settings.getServerSettings(), + settings.getConnectionPoolSettings(), InternalConnectionPoolSettings.builder().build(), + TimeoutSettings.create(settings), streamFactory, + TimeoutSettings.createHeartbeatSettings(settings), heartbeatStreamFactory, + settings.getCredential(), settings.getLoggerSettings(), getCommandListener(settings.getCommandListeners()), + settings.getApplicationName(), mongoDriverInformation, settings.getCompressorList(), settings.getServerApi(), + settings.getDnsClient()); + } + + private static StreamFactory getStreamFactory( + final StreamFactoryFactory streamFactoryFactory, + final MongoClientSettings settings, + final boolean isHeartbeat) { + SocketSettings socketSettings = isHeartbeat ? settings.getHeartbeatSocketSettings() : settings.getSocketSettings(); + return streamFactoryFactory.create(socketSettings, settings.getSslSettings()); + } +} diff --git a/driver-sync/src/main/com/mongodb/client/internal/CryptConnection.java b/driver-sync/src/main/com/mongodb/client/internal/CryptConnection.java index a62aa68783e..803df89a6b6 100644 --- a/driver-sync/src/main/com/mongodb/client/internal/CryptConnection.java +++ b/driver-sync/src/main/com/mongodb/client/internal/CryptConnection.java @@ -16,13 +16,12 @@ package com.mongodb.client.internal; -import com.mongodb.MongoClientException; import com.mongodb.ReadPreference; import com.mongodb.connection.ConnectionDescription; import com.mongodb.internal.connection.Connection; -import com.mongodb.internal.connection.MessageSettings; import com.mongodb.internal.connection.MessageSequences; import com.mongodb.internal.connection.MessageSequences.EmptyMessageSequences; +import com.mongodb.internal.connection.MessageSettings; import com.mongodb.internal.connection.OperationContext; import com.mongodb.internal.connection.SplittablePayload; import com.mongodb.internal.connection.SplittablePayloadBsonWriter; @@ -50,7 +49,6 @@ import java.util.Map; import static com.mongodb.assertions.Assertions.fail; -import static com.mongodb.internal.operation.ServerVersionHelper.serverIsLessThanVersionFourDotTwo; import static org.bson.codecs.configuration.CodecRegistries.fromProviders; /** @@ -95,10 +93,6 @@ public T command(final String database, final BsonDocument command, final Fi @Nullable final ReadPreference readPreference, final Decoder commandResultDecoder, final OperationContext operationContext, final boolean responseExpected, final MessageSequences sequences) { - if (serverIsLessThanVersionFourDotTwo(wrapped.getDescription())) { - throw new MongoClientException("Auto-encryption requires a minimum MongoDB version of 4.2"); - } - SplittablePayload payload = null; FieldNameValidator payloadFieldNameValidator = null; if (sequences instanceof SplittablePayload) { diff --git a/driver-sync/src/main/com/mongodb/client/internal/KeyManagementService.java b/driver-sync/src/main/com/mongodb/client/internal/KeyManagementService.java index fee5ddac729..806f768a923 100644 --- a/driver-sync/src/main/com/mongodb/client/internal/KeyManagementService.java +++ b/driver-sync/src/main/com/mongodb/client/internal/KeyManagementService.java @@ -23,7 +23,7 @@ import com.mongodb.internal.diagnostics.logging.Loggers; import com.mongodb.internal.time.Timeout; import com.mongodb.lang.Nullable; -import org.jetbrains.annotations.NotNull; +import com.mongodb.lang.NonNull; import javax.net.SocketFactory; import javax.net.ssl.SSLContext; @@ -149,13 +149,13 @@ public int read() throws IOException { } @Override - public int read(@NotNull final byte[] b) throws IOException { + public int read(@NonNull final byte[] b) throws IOException { setSocketSoTimeoutToOperationTimeout(); return wrapped.read(b); } @Override - public int read(@NotNull final byte[] b, final int off, final int len) throws IOException { + public int read(@NonNull final byte[] b, final int off, final int len) throws IOException { setSocketSoTimeoutToOperationTimeout(); return wrapped.read(b, off, len); } diff --git a/driver-sync/src/main/com/mongodb/client/internal/MongoClientImpl.java b/driver-sync/src/main/com/mongodb/client/internal/MongoClientImpl.java index 17b132bc978..cf9ca2a3b7d 100644 --- a/driver-sync/src/main/com/mongodb/client/internal/MongoClientImpl.java +++ b/driver-sync/src/main/com/mongodb/client/internal/MongoClientImpl.java @@ -33,8 +33,8 @@ import com.mongodb.client.MongoIterable; import com.mongodb.client.SynchronousContextProvider; import com.mongodb.client.model.bulk.ClientBulkWriteOptions; -import com.mongodb.client.model.bulk.ClientNamespacedWriteModel; import com.mongodb.client.model.bulk.ClientBulkWriteResult; +import com.mongodb.client.model.bulk.ClientNamespacedWriteModel; import com.mongodb.connection.ClusterDescription; import com.mongodb.connection.SocketSettings; import com.mongodb.internal.TimeoutSettings; @@ -42,11 +42,11 @@ import com.mongodb.internal.connection.DefaultClusterFactory; import com.mongodb.internal.connection.InternalConnectionPoolSettings; import com.mongodb.internal.connection.StreamFactory; +import com.mongodb.internal.connection.StreamFactoryFactory; import com.mongodb.internal.diagnostics.logging.Logger; import com.mongodb.internal.diagnostics.logging.Loggers; import com.mongodb.internal.session.ServerSessionPool; import com.mongodb.lang.Nullable; -import com.mongodb.spi.dns.InetAddressResolver; import org.bson.BsonDocument; import org.bson.Document; import org.bson.codecs.configuration.CodecRegistry; @@ -59,8 +59,6 @@ import static com.mongodb.assertions.Assertions.notNull; import static com.mongodb.client.internal.Crypts.createCrypt; import static com.mongodb.internal.connection.ClientMetadataHelper.createClientMetadataDocument; -import static com.mongodb.internal.connection.ServerAddressHelper.getInetAddressResolver; -import static com.mongodb.internal.connection.StreamFactoryHelper.getSyncStreamFactory; import static com.mongodb.internal.event.EventListenerHelper.getCommandListener; import static java.lang.String.format; import static org.bson.codecs.configuration.CodecRegistries.withUuidRepresentation; @@ -75,14 +73,22 @@ public final class MongoClientImpl implements MongoClient { private final MongoDriverInformation mongoDriverInformation; private final MongoClusterImpl delegate; private final AtomicBoolean closed; + private final AutoCloseable externalResourceCloser; - public MongoClientImpl(final MongoClientSettings settings, final MongoDriverInformation mongoDriverInformation) { - this(createCluster(settings, mongoDriverInformation), mongoDriverInformation, settings, null); + public MongoClientImpl(final Cluster cluster, + final MongoClientSettings settings, + final MongoDriverInformation mongoDriverInformation, + @Nullable final AutoCloseable externalResourceCloser) { + this(cluster, mongoDriverInformation, settings, externalResourceCloser, null); } - public MongoClientImpl(final Cluster cluster, final MongoDriverInformation mongoDriverInformation, + private MongoClientImpl(final Cluster cluster, + final MongoDriverInformation mongoDriverInformation, final MongoClientSettings settings, - @Nullable final OperationExecutor operationExecutor) { + @Nullable final AutoCloseable externalResourceCloser, + @Nullable final OperationExecutor operationExecutor) { + + this.externalResourceCloser = externalResourceCloser; this.settings = notNull("settings", settings); this.mongoDriverInformation = mongoDriverInformation; AutoEncryptionSettings autoEncryptionSettings = settings.getAutoEncryptionSettings(); @@ -114,6 +120,13 @@ public void close() { } delegate.getServerSessionPool().close(); delegate.getCluster().close(); + if (externalResourceCloser != null) { + try { + externalResourceCloser.close(); + } catch (Exception e) { + LOGGER.warn("Exception closing resource", e); + } + } } } @@ -287,21 +300,24 @@ public ClientBulkWriteResult bulkWrite( } private static Cluster createCluster(final MongoClientSettings settings, - @Nullable final MongoDriverInformation mongoDriverInformation) { + @Nullable final MongoDriverInformation mongoDriverInformation, + final StreamFactory streamFactory, final StreamFactory heartbeatStreamFactory) { notNull("settings", settings); return new DefaultClusterFactory().createCluster(settings.getClusterSettings(), settings.getServerSettings(), settings.getConnectionPoolSettings(), InternalConnectionPoolSettings.builder().build(), - TimeoutSettings.create(settings), getStreamFactory(settings, false), - TimeoutSettings.createHeartbeatSettings(settings), getStreamFactory(settings, true), + TimeoutSettings.create(settings), streamFactory, + TimeoutSettings.createHeartbeatSettings(settings), heartbeatStreamFactory, settings.getCredential(), settings.getLoggerSettings(), getCommandListener(settings.getCommandListeners()), settings.getApplicationName(), mongoDriverInformation, settings.getCompressorList(), settings.getServerApi(), settings.getDnsClient()); } - private static StreamFactory getStreamFactory(final MongoClientSettings settings, final boolean isHeartbeat) { + private static StreamFactory getStreamFactory( + final StreamFactoryFactory streamFactoryFactory, + final MongoClientSettings settings, + final boolean isHeartbeat) { SocketSettings socketSettings = isHeartbeat ? settings.getHeartbeatSocketSettings() : settings.getSocketSettings(); - InetAddressResolver inetAddressResolver = getInetAddressResolver(settings); - return getSyncStreamFactory(settings, inetAddressResolver, socketSettings); + return streamFactoryFactory.create(socketSettings, settings.getSslSettings()); } public Cluster getCluster() { diff --git a/driver-sync/src/test/functional/com/mongodb/client/AbstractClientEncryptionCustomEndpointTest.java b/driver-sync/src/test/functional/com/mongodb/client/AbstractClientEncryptionCustomEndpointTest.java index 9826c592190..f16d1f59855 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/AbstractClientEncryptionCustomEndpointTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/AbstractClientEncryptionCustomEndpointTest.java @@ -120,7 +120,7 @@ public void setUp() { put("endpoint", "doesnotexist.invalid:443"); }}); put("kmip", new HashMap() {{ - put("endpoint", "doesnotexist.local:5698"); + put("endpoint", "doesnotexist.invalid:5698"); }}); }}; @@ -189,12 +189,11 @@ public static Collection data() { + " endpoint: \"kms.us-east-1.amazonaws.com:443\"" + "}"), false, null, null, null}); - data.add(new Object[]{"4. [aws] invalid amazon region in endpoint", - "aws", + data.add(new Object[]{"4. [kmip] Call client_encryption.createDataKey() and the following masterKey", + "kmip", BsonDocument.parse("{\n" - + " region: \"us-east-1\",\n" - + " key: \"arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0\",\n" - + " endpoint: \"kms.us-east-1.amazonaws.com:12345\"\n" + + " \"keyId\": \"1\",\n" + + " \"endpoint\": \"localhost:12345\"" + "}"), false, MongoClientException.class, ConnectException.class, "Connection refused"}); data.add(new Object[]{"5. [aws] invalid endpoint host", @@ -260,7 +259,7 @@ public static Collection data() { "kmip", BsonDocument.parse("{\n" + " \"keyId\": \"1\",\n" - + " \"endpoint\": \"doesnotexist.local:5698\"\n" + + " \"endpoint\": \"doesnotexist.invalid:5698\"\n" + "}"), false, MongoClientException.class, UnknownHostException.class, null}); return data; diff --git a/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionDeadlockTest.java b/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionDeadlockTest.java index 2a83b328298..10b7698100b 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionDeadlockTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionDeadlockTest.java @@ -44,7 +44,6 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import java.util.HashSet; @@ -225,9 +224,8 @@ private static MongoClientSettings getClientSettings(final int maxPoolSize, .build(); } - private static BsonDocument bsonDocumentFromPath(final String path) throws URISyntaxException, IOException { - return getTestDocument(new File(ClientSideEncryptionExternalKeyVaultTest.class - .getResource("/client-side-encryption-external/" + path).toURI())); + private static BsonDocument bsonDocumentFromPath(final String path) { + return getTestDocument("client-side-encryption/external/" + path); } private static final class ExpectedEvent { diff --git a/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionExplicitEncryptionTest.java b/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionExplicitEncryptionTest.java index 068a9079dad..c44a7cbfae0 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionExplicitEncryptionTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionExplicitEncryptionTest.java @@ -37,7 +37,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -54,7 +53,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assumptions.assumeFalse; import static org.junit.jupiter.api.Assumptions.assumeTrue; import static util.JsonPoweredTestHelper.getTestDocument; @@ -207,12 +205,6 @@ public void canRoundtripEncryptedUnindexed() { } private static BsonDocument bsonDocumentFromPath(final String path) { - try { - return getTestDocument(new File(AbstractClientSideEncryptionExplicitEncryptionTest.class - .getResource("/client-side-encryption-data/" + path).toURI())); - } catch (Exception e) { - fail("Unable to load resource", e); - return null; - } + return getTestDocument("client-side-encryption/etc/data/" + path); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionNotSpawnMongocryptdTest.java b/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionNotSpawnMongocryptdTest.java index 3ec814ba704..fc11b006404 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionNotSpawnMongocryptdTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionNotSpawnMongocryptdTest.java @@ -23,7 +23,6 @@ import com.mongodb.MongoTimeoutException; import com.mongodb.ServerAddress; import com.mongodb.WriteConcern; -import com.mongodb.assertions.Assertions; import com.mongodb.lang.Nullable; import org.bson.BsonDocument; import org.bson.Document; @@ -31,7 +30,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.io.File; import java.net.InetAddress; import java.net.InetSocketAddress; import java.time.Duration; @@ -43,6 +41,7 @@ import java.util.function.BiConsumer; import java.util.stream.Collectors; import java.util.stream.Stream; + import static com.mongodb.ClusterFixture.serverVersionAtLeast; import static com.mongodb.client.AbstractClientSideEncryptionNotCreateMongocryptdClientTest.findAvailableMongocryptdLoopbackPort; import static com.mongodb.client.AbstractClientSideEncryptionTest.cryptSharedLibPathSysPropValue; @@ -216,21 +215,11 @@ private void assertMongocryptdNotSpawned() { } private static BsonDocument externalSchema() { - try { - return getTestDocument(new File(Assertions.assertNotNull(AbstractClientSideEncryptionNotSpawnMongocryptdTest.class - .getResource("/client-side-encryption-external/external-schema.json")).toURI())); - } catch (Exception e) { - throw new RuntimeException(e); - } + return getTestDocument("client-side-encryption/external/external-schema.json"); } private static BsonDocument externalKey() { - try { - return getTestDocument(new File(Assertions.assertNotNull(AbstractClientSideEncryptionNotSpawnMongocryptdTest.class - .getResource("/client-side-encryption-external/external-key.json")).toURI())); - } catch (Exception e) { - throw new RuntimeException(e); - } + return getTestDocument("client-side-encryption/external/external-key.json"); } @SafeVarargs diff --git a/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionRangeExplicitEncryptionTest.java b/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionRangeExplicitEncryptionTest.java index be667c9b64c..0dda406f5e9 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionRangeExplicitEncryptionTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionRangeExplicitEncryptionTest.java @@ -51,7 +51,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; -import java.io.File; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -70,7 +69,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertIterableEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assumptions.assumeFalse; import static org.junit.jupiter.api.Assumptions.assumeTrue; import static util.JsonPoweredTestHelper.getTestDocument; @@ -96,8 +94,8 @@ public void setUp(final Type type) { assumeFalse(isServerlessTest()); MongoNamespace dataKeysNamespace = new MongoNamespace("keyvault.datakeys"); - BsonDocument encryptedFields = bsonDocumentFromPath("range-encryptedFields-" + type.value + ".json"); - BsonDocument key1Document = bsonDocumentFromPath("keys/key1-document.json"); + BsonDocument encryptedFields = getTestDocument("client-side-encryption/etc/data/range-encryptedFields-" + type.value + ".json"); + BsonDocument key1Document = getTestDocument("client-side-encryption/etc/data/keys/key1-document.json"); key1Id = key1Document.getBinary("_id"); MongoDatabase explicitEncryptionDatabase = getDefaultDatabase(); @@ -354,15 +352,4 @@ BsonValue convertNumber(final int number) { } } } - - private static BsonDocument bsonDocumentFromPath(final String path) { - try { - return getTestDocument(new File(AbstractClientSideEncryptionRangeExplicitEncryptionTest.class - .getResource("/client-side-encryption-data/" + path).toURI())); - } catch (Exception e) { - fail("Unable to load resource", e); - return null; - } - } - } diff --git a/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionTest.java b/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionTest.java index dca25078b7c..f7089755d91 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/AbstractClientSideEncryptionTest.java @@ -44,9 +44,6 @@ import org.junit.runners.Parameterized; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -134,6 +131,8 @@ private String getErrorCodeNameField(@Nullable final BsonValue expectedResult) { @Before public void setUp() { assumeTrue("Client side encryption tests disabled", hasEncryptionTestsEnabled()); + assumeFalse("blockTimeMS and timeoutMS too small", + description.equals("timeoutMS applied to listCollections to get collection schema")); assumeFalse("runOn requirements not satisfied", skipTest); assumeFalse("Skipping count tests", filename.startsWith("count.")); @@ -185,6 +184,8 @@ public void setUp() { BsonDocument kmsProviders = cryptOptions.getDocument("kmsProviders", new BsonDocument()); boolean bypassAutoEncryption = cryptOptions.getBoolean("bypassAutoEncryption", BsonBoolean.FALSE).getValue(); boolean bypassQueryAnalysis = cryptOptions.getBoolean("bypassQueryAnalysis", BsonBoolean.FALSE).getValue(); + Long keyExpirationMS = cryptOptions.containsKey("keyExpirationMS") + ? cryptOptions.getNumber("keyExpirationMS").longValue() : null; Map namespaceToSchemaMap = new HashMap<>(); @@ -285,6 +286,7 @@ public void setUp() { .bypassQueryAnalysis(bypassQueryAnalysis) .bypassAutoEncryption(bypassAutoEncryption) .extraOptions(extraOptions) + .keyExpiration(keyExpirationMS, TimeUnit.MILLISECONDS) .build()); } createMongoClient(mongoClientSettingsBuilder.build()); @@ -403,14 +405,15 @@ private void assertBsonValue(final String message, final BsonValue expectedResul } @Parameterized.Parameters(name = "{0}: {1}") - public static Collection data() throws URISyntaxException, IOException { + public static Collection data() { List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/client-side-encryption/legacy")) { - BsonDocument specDocument = JsonPoweredTestHelper.getTestDocument(file); + for (BsonDocument specDocument : JsonPoweredTestHelper.getSpecTestDocuments("client-side-encryption/tests/legacy")) { for (BsonValue test : specDocument.getArray("tests")) { - data.add(new Object[]{file.getName(), test.asDocument().getString("description").getValue(), specDocument, - specDocument.getArray("data", new BsonArray()), test.asDocument(), - skipTest(specDocument, test.asDocument())}); + BsonDocument testDocument = test.asDocument(); + data.add(new Object[]{specDocument.getString("fileName").getValue(), + testDocument.getString("description").getValue(), specDocument, + specDocument.getArray("data", new BsonArray()), testDocument, + skipTest(specDocument, testDocument)}); } } return data; diff --git a/driver-sync/src/test/functional/com/mongodb/client/AbstractServerSelectionProseTest.java b/driver-sync/src/test/functional/com/mongodb/client/AbstractServerSelectionProseTest.java index 0aa2ff28536..506a40d8bd6 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/AbstractServerSelectionProseTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/AbstractServerSelectionProseTest.java @@ -53,12 +53,12 @@ /** * See prose tests in - * + * * "Server Selection Test Plan". */ public abstract class AbstractServerSelectionProseTest { /** - * + * * {@code operationCount}-based Selection Within Latency Window. */ @Test diff --git a/driver-sync/src/test/functional/com/mongodb/client/AbstractSessionsProseTest.java b/driver-sync/src/test/functional/com/mongodb/client/AbstractSessionsProseTest.java index db3cb497543..8303e88056a 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/AbstractSessionsProseTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/AbstractSessionsProseTest.java @@ -53,7 +53,7 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue; // Prose tests for Sessions specification: https://github.com/mongodb/specifications/tree/master/source/sessions -// Prose test README: https://github.com/mongodb/specifications/tree/master/source/sessions/tests/README.rst +// Prose test README: https://github.com/mongodb/specifications/tree/master/source/sessions/tests/README.md public abstract class AbstractSessionsProseTest { private static final int MONGOCRYPTD_PORT = 47017; diff --git a/driver-sync/src/test/functional/com/mongodb/client/AtlasSearchIndexManagementProseTest.java b/driver-sync/src/test/functional/com/mongodb/client/AtlasSearchIndexManagementProseTest.java index a7142278222..d9b60a3b0f7 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/AtlasSearchIndexManagementProseTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/AtlasSearchIndexManagementProseTest.java @@ -19,7 +19,7 @@ import com.mongodb.MongoClientSettings; /** - * See Search Index Management Tests + * See Search Index Management Tests */ public class AtlasSearchIndexManagementProseTest extends AbstractAtlasSearchIndexManagementProseTest { protected MongoClient createMongoClient(final MongoClientSettings settings) { diff --git a/driver-sync/src/test/functional/com/mongodb/client/ChangeStreamProseTest.java b/driver-sync/src/test/functional/com/mongodb/client/ChangeStreamProseTest.java index adbc442c4f9..4474e4b0fd2 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/ChangeStreamProseTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/ChangeStreamProseTest.java @@ -53,7 +53,7 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue; -// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.rst#prose-tests +// See https://github.com/mongodb/specifications/tree/master/source/change-streams/tests/README.md#prose-tests public class ChangeStreamProseTest extends DatabaseTestCase { private BsonDocument failPointDocument; diff --git a/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryption25LookupProseTests.java b/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryption25LookupProseTests.java index f7c672b289b..4324fab484c 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryption25LookupProseTests.java +++ b/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryption25LookupProseTests.java @@ -37,7 +37,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; -import java.io.File; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -52,7 +51,6 @@ import static com.mongodb.testing.MongoAssertions.assertCause; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.fail; import static org.junit.jupiter.api.Assumptions.assumeFalse; import static org.junit.jupiter.api.Assumptions.assumeTrue; import static util.JsonPoweredTestHelper.getTestDocument; @@ -244,12 +242,6 @@ void testCase9() { } public static BsonDocument bsonDocumentFromPath(final String path) { - try { - return getTestDocument(new File(ClientSideEncryption25LookupProseTests.class - .getResource("/client-side-encryption-data/lookup/" + path).toURI())); - } catch (Exception e) { - fail("Unable to load resource", e); - return null; - } + return getTestDocument("client-side-encryption/etc/data/lookup/" + path); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionBsonSizeLimitsSpecification.groovy b/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionBsonSizeLimitsSpecification.groovy index 0e2e4ed02d7..d15e6d92a38 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionBsonSizeLimitsSpecification.groovy +++ b/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionBsonSizeLimitsSpecification.groovy @@ -61,7 +61,7 @@ class ClientSideEncryptionBsonSizeLimitsSpecification extends FunctionalSpecific dataKeyCollection.drop() dataCollection.drop() - dataKeyCollection.insertOne(getTestDocument('/client-side-encryption-limits/limits-key.json')) + dataKeyCollection.insertOne(getTestDocument('client-side-encryption/limits/limits-key.json')) def providerProperties = ['local': ['key': Base64.getDecoder().decode('Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN' @@ -73,7 +73,7 @@ class ClientSideEncryptionBsonSizeLimitsSpecification extends FunctionalSpecific .keyVaultNamespace(keyVaultNamespace.fullName) .kmsProviders(providerProperties) .schemaMap(singletonMap(autoEncryptingCollectionNamespace.fullName, - getTestDocument('/client-side-encryption-limits/limits-schema.json'))) + getTestDocument('client-side-encryption/limits/limits-schema.json'))) .build()) .addCommandListener(commandListener) .build()) @@ -97,7 +97,7 @@ class ClientSideEncryptionBsonSizeLimitsSpecification extends FunctionalSpecific noExceptionThrown() when: - autoEncryptingDataCollection.insertOne(getTestDocument('/client-side-encryption-limits/limits-doc.json') + autoEncryptingDataCollection.insertOne(getTestDocument('client-side-encryption/limits/limits-doc.json') .append('_id', new BsonString('encryption_exceeds_2mib')) .append('unencrypted', new BsonString('a' * (2097152 - 2000)))) @@ -122,10 +122,10 @@ class ClientSideEncryptionBsonSizeLimitsSpecification extends FunctionalSpecific commandListener.reset() autoEncryptingDataCollection.insertMany( [ - getTestDocument('/client-side-encryption-limits/limits-doc.json') + getTestDocument('client-side-encryption/limits/limits-doc.json') .append('_id', new BsonString('encryption_exceeds_2mib_1')) .append('unencrypted', new BsonString('a' * (2097152 - 2000))), - getTestDocument('/client-side-encryption-limits/limits-doc.json') + getTestDocument('client-side-encryption/limits/limits-doc.json') .append('_id', new BsonString('encryption_exceeds_2mib_2')) .append('unencrypted', new BsonString('a' * (2097152 - 2000))), ]) @@ -143,7 +143,7 @@ class ClientSideEncryptionBsonSizeLimitsSpecification extends FunctionalSpecific noExceptionThrown() when: - autoEncryptingDataCollection.insertOne(getTestDocument('/client-side-encryption-limits/limits-doc.json') + autoEncryptingDataCollection.insertOne(getTestDocument('client-side-encryption/limits/limits-doc.json') .append('_id', new BsonString('encryption_exceeds_16mib')) .append('unencrypted', new BsonString('a' * (16777216 - 2000)))) diff --git a/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionCorpusTest.java b/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionCorpusTest.java index a812e174047..ce17db8d092 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionCorpusTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionCorpusTest.java @@ -38,7 +38,6 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import java.util.Base64; @@ -261,9 +260,8 @@ public void testCorpus() throws IOException, URISyntaxException { } } - private static BsonDocument bsonDocumentFromPath(final String path) throws IOException, URISyntaxException { - return getTestDocument(new File(ClientSideEncryptionTest.class - .getResource("/client-side-encryption-corpus/" + path).toURI())); + private static BsonDocument bsonDocumentFromPath(final String path) { + return getTestDocument("client-side-encryption/corpus/" + path); } @Parameterized.Parameters(name = "useLocalSchema: {0}") diff --git a/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionExternalKeyVaultTest.java b/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionExternalKeyVaultTest.java index da513bb2a9e..7a4755b5017 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionExternalKeyVaultTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionExternalKeyVaultTest.java @@ -37,7 +37,6 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import java.util.Arrays; @@ -146,9 +145,8 @@ public void testExternal() { assertEquals(authExceptionThrown, withExternalKeyVault); } - private static BsonDocument bsonDocumentFromPath(final String path) throws IOException, URISyntaxException { - return getTestDocument(new File(ClientSideEncryptionExternalKeyVaultTest.class - .getResource("/client-side-encryption-external/" + path).toURI())); + private static BsonDocument bsonDocumentFromPath(final String path) { + return getTestDocument("client-side-encryption/external/" + path); } @Parameterized.Parameters(name = "withExternalKeyVault: {0}") diff --git a/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionSessionTest.java b/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionSessionTest.java index f2c51988bd7..a72a156e252 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionSessionTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/ClientSideEncryptionSessionTest.java @@ -30,7 +30,6 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import java.io.File; import java.io.IOException; import java.net.URISyntaxException; import java.util.Arrays; @@ -143,9 +142,7 @@ public void testWithExplicitSession() { assertEquals(6, encryptedDocument.getBinary("encrypted").getType()); } - - private static BsonDocument bsonDocumentFromPath(final String path) throws IOException, URISyntaxException { - return getTestDocument(new File(ClientSideEncryptionSessionTest.class - .getResource("/client-side-encryption-external/" + path).toURI())); + private static BsonDocument bsonDocumentFromPath(final String path) { + return getTestDocument("client-side-encryption/external/" + path); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/ClientSideOperationTimeoutProseTest.java b/driver-sync/src/test/functional/com/mongodb/client/ClientSideOperationTimeoutProseTest.java index fc80e2f1139..4dcbc4d1a0f 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/ClientSideOperationTimeoutProseTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/ClientSideOperationTimeoutProseTest.java @@ -22,7 +22,7 @@ /** - * See https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/tests/README.rst#prose-tests + * See https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/tests/README.md#prose-tests */ public final class ClientSideOperationTimeoutProseTest extends AbstractClientSideOperationsTimeoutProseTest { diff --git a/driver-sync/src/test/functional/com/mongodb/client/ClientSideOperationTimeoutTest.java b/driver-sync/src/test/functional/com/mongodb/client/ClientSideOperationTimeoutTest.java index c4068375f9f..61da62147ae 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/ClientSideOperationTimeoutTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/ClientSideOperationTimeoutTest.java @@ -20,8 +20,6 @@ import com.mongodb.client.unified.UnifiedSyncTest; import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; import static org.junit.jupiter.api.Assumptions.assumeFalse; @@ -30,13 +28,18 @@ // See https://github.com/mongodb/specifications/tree/master/source/client-side-operation-timeout/tests public class ClientSideOperationTimeoutTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/client-side-operation-timeout"); + private static Collection data() { + return getTestData("client-side-operations-timeout"); } @Override protected void skips(final String fileDescription, final String testDescription) { skipOperationTimeoutTests(fileDescription, testDescription); + + /* + * The test is occasionally racy. Sometimes multiple getMores can be triggered. + */ + ignoreExtraCommandEvents(testDescription.contains("timeoutMS is refreshed for getMore if maxAwaitTimeMS is set")); } public static void skipOperationTimeoutTests(final String fileDescription, final String testDescription) { @@ -63,8 +66,13 @@ public static void skipOperationTimeoutTests(final String fileDescription, final assumeFalse(testDescription.endsWith("count on collection"), "No count command helper"); assumeFalse(fileDescription.equals("timeoutMS can be overridden for an operation"), "No operation based overrides"); assumeFalse(testDescription.equals("timeoutMS can be overridden for commitTransaction") - || testDescription.equals("timeoutMS applied to abortTransaction"), + || testDescription.equals("timeoutMS applied to abortTransaction"), + "No operation session based overrides"); + + assumeFalse(fileDescription.equals("operations ignore deprecated timeout options if timeoutMS is set") + && (testDescription.startsWith("abortTransaction ignores") || testDescription.startsWith("commitTransaction ignores")), "No operation session based overrides"); + assumeFalse(fileDescription.equals("timeoutMS behaves correctly when closing cursors") && testDescription.equals("timeoutMS can be overridden for close"), "No operation based overrides"); } diff --git a/driver-sync/src/test/functional/com/mongodb/client/InitialDnsSeedlistDiscoveryTest.java b/driver-sync/src/test/functional/com/mongodb/client/InitialDnsSeedlistDiscoveryTest.java index a51f6e3624d..bba17073f4e 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/InitialDnsSeedlistDiscoveryTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/InitialDnsSeedlistDiscoveryTest.java @@ -41,10 +41,6 @@ import org.junit.runners.Parameterized; import util.JsonPoweredTestHelper; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; -import java.nio.file.Path; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -69,7 +65,8 @@ // See https://github.com/mongodb/specifications/tree/master/source/initial-dns-seedlist-discovery/tests @RunWith(Parameterized.class) public abstract class InitialDnsSeedlistDiscoveryTest { - private final Path parentDirectory; + private final String filename; + private final String parentDirectory; private final String uri; @Nullable private final List seeds; @@ -84,11 +81,12 @@ public abstract class InitialDnsSeedlistDiscoveryTest { private final boolean isError; private final boolean executePingCommand; - public InitialDnsSeedlistDiscoveryTest(@SuppressWarnings("unused") final String filename, final Path parentDirectory, final String uri, + public InitialDnsSeedlistDiscoveryTest(final String filename, final String parentDirectory, final String uri, @Nullable final List seeds, @Nullable final Integer numSeeds, @Nullable final List hosts, @Nullable final Integer numHosts, final BsonDocument options, final BsonDocument parsedOptions, final boolean isError, final boolean executePingCommand) { + this.filename = filename; this.parentDirectory = parentDirectory; this.uri = uri; this.seeds = seeds; @@ -106,6 +104,7 @@ public InitialDnsSeedlistDiscoveryTest(@SuppressWarnings("unused") final String @Before public void setUp() { assumeFalse(isServerlessTest()); + assumeFalse("https://jira.mongodb.org/browse/JAVA-5064", filename.equals("uri-with-uppercase-hostname.json")); if (parentDirectory.endsWith("replica-set")) { assumeTrue(isDiscoverableReplicaSet()); @@ -306,13 +305,13 @@ private void assertParsedOptions(final ConnectionString connectionString) { @Parameterized.Parameters(name = "{0}") - public static Collection data() throws URISyntaxException, IOException { + public static Collection data() { List data = new ArrayList<>(); - for (File file : JsonPoweredTestHelper.getTestFiles("/initial-dns-seedlist-discovery")) { - BsonDocument testDocument = JsonPoweredTestHelper.getTestDocument(file); + for (BsonDocument testDocument : JsonPoweredTestHelper.getSpecTestDocuments("initial-dns-seedlist-discovery")) { + String resourcePath = testDocument.getString("resourcePath").getValue(); data.add(new Object[]{ - file.getName(), - file.toPath().getParent(), + testDocument.getString("fileName").getValue(), + resourcePath.substring(0, resourcePath.lastIndexOf("/")), testDocument.getString("uri").getValue(), toStringList(testDocument.getArray("seeds", null)), toInteger(testDocument.getNumber("numSeeds", null)), @@ -323,7 +322,6 @@ public static Collection data() throws URISyntaxException, IOException testDocument.getBoolean("error", BsonBoolean.FALSE).getValue(), testDocument.getBoolean("ping", BsonBoolean.TRUE).getValue() }); - } return data; } diff --git a/driver-sync/src/test/functional/com/mongodb/client/JsonPoweredCrudTestHelper.java b/driver-sync/src/test/functional/com/mongodb/client/JsonPoweredCrudTestHelper.java index f2859247a70..7e0225e8c51 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/JsonPoweredCrudTestHelper.java +++ b/driver-sync/src/test/functional/com/mongodb/client/JsonPoweredCrudTestHelper.java @@ -139,6 +139,8 @@ BsonDocument getOperationResults(final BsonDocument operation, @Nullable final C case "assertIndexNotExists": assertIndexExists(operation, false); return new BsonDocument(); + case "wait": + return executeWait(operation); default: try { Method method = getClass().getDeclaredMethod(methodName, BsonDocument.class, BsonDocument.class, ClientSession.class); @@ -246,6 +248,15 @@ BsonDocument toResult(@Nullable final BsonValue results) { return new BsonDocument("result", results != null ? results : BsonNull.VALUE); } + private BsonDocument executeWait(final BsonDocument operation) { + try { + Thread.sleep(operation.getDocument("arguments").getNumber("ms").longValue()); + return new BsonDocument(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + private void assertCollectionExists(final BsonDocument operation, final boolean shouldExist) { BsonDocument arguments = operation.getDocument("arguments", new BsonDocument()); String databaseName = arguments.getString("database").getValue(); @@ -1187,6 +1198,15 @@ BsonDocument getDatabaseWatchResult(final BsonDocument collectionOptions, final } } + BsonDocument wait(final BsonDocument options, final BsonDocument rawArguments, @Nullable final ClientSession clientSession) { + try { + Thread.sleep(rawArguments.getNumber("ms").longValue()); + return new BsonDocument(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + Collation getCollation(final BsonDocument bsonCollation) { Collation.Builder builder = Collation.builder(); if (bsonCollation.containsKey("locale")) { diff --git a/driver-sync/src/test/functional/com/mongodb/client/MongoClientSessionSpecification.groovy b/driver-sync/src/test/functional/com/mongodb/client/MongoClientSessionSpecification.groovy index fc688fec5df..a8596536e8e 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/MongoClientSessionSpecification.groovy +++ b/driver-sync/src/test/functional/com/mongodb/client/MongoClientSessionSpecification.groovy @@ -35,7 +35,7 @@ import org.bson.Document import org.bson.types.ObjectId import org.junit.Assert import spock.lang.IgnoreIf -import util.spock.annotations.Slow +import com.mongodb.spock.Slow import java.util.concurrent.TimeUnit diff --git a/driver-sync/src/test/functional/com/mongodb/client/MongoClientTest.java b/driver-sync/src/test/functional/com/mongodb/client/MongoClientTest.java index 70a753a0a8b..fb8db8c2ceb 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/MongoClientTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/MongoClientTest.java @@ -17,10 +17,16 @@ package com.mongodb.client; import com.mongodb.ClusterFixture; +import com.mongodb.MongoClientSettings; +import com.mongodb.MongoDriverInformation; +import com.mongodb.client.internal.MongoClientImpl; import com.mongodb.connection.ClusterId; import com.mongodb.event.ClusterListener; import com.mongodb.event.ClusterOpeningEvent; +import com.mongodb.internal.connection.Cluster; +import com.mongodb.internal.mockito.MongoMockito; import org.junit.jupiter.api.Test; +import org.mockito.Mockito; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; @@ -29,12 +35,13 @@ import static com.mongodb.client.Fixture.getMongoClientSettingsBuilder; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.doNothing; -public class MongoClientTest { +class MongoClientTest { @SuppressWarnings("try") @Test - public void shouldIncludeApplicationNameInClusterId() throws InterruptedException, + void shouldIncludeApplicationNameInClusterId() throws InterruptedException, ExecutionException, TimeoutException { CompletableFuture clusterIdFuture = new CompletableFuture<>(); ClusterListener clusterListener = new ClusterListener() { @@ -52,4 +59,37 @@ public void clusterOpening(final ClusterOpeningEvent event) { assertEquals(applicationName, clusterId.getDescription()); } } + + @Test + void shouldCloseExternalResources() throws Exception { + + //given + Cluster cluster = MongoMockito.mock( + Cluster.class, + mockedCluster -> { + doNothing().when(mockedCluster).close(); + }); + AutoCloseable externalResource = MongoMockito.mock( + AutoCloseable.class, + mockedExternalResource -> { + try { + doNothing().when(mockedExternalResource).close(); + } catch (Exception e) { + throw new RuntimeException(e); + } + }); + + MongoClientImpl mongoClient = new MongoClientImpl( + cluster, + MongoClientSettings.builder().build(), + MongoDriverInformation.builder().build(), + externalResource); + + //when + mongoClient.close(); + + //then + Mockito.verify(externalResource).close(); + Mockito.verify(cluster).close(); + } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/RetryableWritesProseTest.java b/driver-sync/src/test/functional/com/mongodb/client/RetryableWritesProseTest.java index 289efb7287b..c18b6995156 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/RetryableWritesProseTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/RetryableWritesProseTest.java @@ -85,7 +85,7 @@ /** * See - * Retryable Write Prose Tests. + * Retryable Write Prose Tests. */ public class RetryableWritesProseTest extends DatabaseTestCase { @@ -158,7 +158,7 @@ public static void poolClearedExceptionMustBeRetryable( .applyToServerSettings(builder -> builder /* We fake server's state by configuring a fail point. This breaks the mechanism of the * streaming server monitoring protocol - * (https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-monitoring.rst#streaming-protocol) + * (https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-monitoring.md#streaming-protocol) * that allows the server to determine whether or not it needs to send a new state to the client. * As a result, the client has to wait for at least its heartbeat delay until it hears back from a server * (while it waits for a response, calling `ServerMonitor.connect` has no effect). diff --git a/driver-sync/src/test/functional/com/mongodb/client/ServerDiscoveryAndMonitoringProseTests.java b/driver-sync/src/test/functional/com/mongodb/client/ServerDiscoveryAndMonitoringProseTests.java index cf8c3bfc292..1887b2006cd 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/ServerDiscoveryAndMonitoringProseTests.java +++ b/driver-sync/src/test/functional/com/mongodb/client/ServerDiscoveryAndMonitoringProseTests.java @@ -75,7 +75,7 @@ /** * See - * Server Discovery And Monitoring—Test Plan + * Server Discovery And Monitoring—Test Plan * and * Prose Tests. */ @@ -163,7 +163,7 @@ public void serverDescriptionChanged(final ServerDescriptionChangedEvent event) /** * See - * Connection Pool Management. + * Connection Pool Management. */ @Test @Ignore @@ -227,7 +227,7 @@ public void connectionPoolCleared(final ConnectionPoolClearedEvent event) { /** * See - * + * * Monitors sleep at least minHeartbeatFreqencyMS between checks. */ @Test diff --git a/driver-sync/src/test/functional/com/mongodb/client/Socks5ProseTest.java b/driver-sync/src/test/functional/com/mongodb/client/Socks5ProseTest.java index 7beb11ee5f9..20e3a35534d 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/Socks5ProseTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/Socks5ProseTest.java @@ -48,7 +48,7 @@ import static org.mockito.Mockito.atLeast; /** - * See https://github.com/mongodb/specifications/blob/master/source/socks5-support/tests/README.rst#prose-tests + * See https://github.com/mongodb/specifications/blob/master/source/socks5-support/tests/README.md#prose-tests */ @ExtendWith(Socks5ProseTest.SocksProxyPropertyCondition.class) class Socks5ProseTest { diff --git a/driver-sync/src/test/functional/com/mongodb/client/SyncInitialDnsSeedlistDiscoveryTest.java b/driver-sync/src/test/functional/com/mongodb/client/SyncInitialDnsSeedlistDiscoveryTest.java index d3750434ea6..afe31d41d27 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/SyncInitialDnsSeedlistDiscoveryTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/SyncInitialDnsSeedlistDiscoveryTest.java @@ -19,11 +19,10 @@ import com.mongodb.MongoClientSettings; import org.bson.BsonDocument; -import java.nio.file.Path; import java.util.List; public class SyncInitialDnsSeedlistDiscoveryTest extends InitialDnsSeedlistDiscoveryTest { - public SyncInitialDnsSeedlistDiscoveryTest(final String filename, final Path parentDirectory, final String uri, + public SyncInitialDnsSeedlistDiscoveryTest(final String filename, final String parentDirectory, final String uri, final List seeds, final Integer numSeeds, final List hosts, final Integer numHosts, final BsonDocument options, final BsonDocument parsedOptions, final boolean isError, final boolean executePingCommand) { diff --git a/driver-sync/src/test/functional/com/mongodb/client/TransactionProseTest.java b/driver-sync/src/test/functional/com/mongodb/client/TransactionProseTest.java index 5ea180b312d..2eb178026d2 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/TransactionProseTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/TransactionProseTest.java @@ -35,7 +35,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeTrue; -// See https://github.com/mongodb/specifications/blob/master/source/transactions/tests/README.rst#mongos-pinning-prose-tests +// See https://github.com/mongodb/specifications/blob/master/source/transactions/tests/README.md#mongos-pinning-prose-tests public class TransactionProseTest { private MongoClient client; private MongoCollection collection; diff --git a/driver-sync/src/test/functional/com/mongodb/client/WithTransactionProseTest.java b/driver-sync/src/test/functional/com/mongodb/client/WithTransactionProseTest.java index b09edf4ac43..3a8148f8a92 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/WithTransactionProseTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/WithTransactionProseTest.java @@ -40,7 +40,7 @@ import static org.junit.jupiter.api.Assumptions.assumeFalse; import static org.junit.jupiter.api.Assumptions.assumeTrue; -// See https://github.com/mongodb/specifications/tree/master/source/transactions-convenient-api/tests/README.rst#prose-tests +// See https://github.com/mongodb/specifications/blob/master/source/transactions-convenient-api/tests/README.md#prose-tests public class WithTransactionProseTest extends DatabaseTestCase { private static final long START_TIME_MS = 1L; private static final long ERROR_GENERATING_INTERVAL = 121000L; diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/ChangeStreamsTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/ChangeStreamsTest.java index d07429fa479..f631cc461fa 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/ChangeStreamsTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/ChangeStreamsTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class ChangeStreamsTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/change-streams"); + private static Collection data() { + return getTestData("change-streams"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/ClientSideEncryptionTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/ClientSideEncryptionTest.java index bbb232386dd..dabca853dee 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/ClientSideEncryptionTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/ClientSideEncryptionTest.java @@ -18,12 +18,11 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class ClientSideEncryptionTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/client-side-encryption"); + + private static Collection data() { + return getTestData("client-side-encryption/tests/unified"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/CollectionManagementTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/CollectionManagementTest.java index 1830fa24c9d..88a9e1e113c 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/CollectionManagementTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/CollectionManagementTest.java @@ -18,12 +18,11 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class CollectionManagementTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/collection-management"); + + private static Collection data() { + return getTestData("collection-management"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/CommandLoggingTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/CommandLoggingTest.java index 23302ebdd52..39f14de71af 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/CommandLoggingTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/CommandLoggingTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class CommandLoggingTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/command-logging"); + private static Collection data() { + return getTestData("command-logging-and-monitoring/tests/logging"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/CommandMonitoringTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/CommandMonitoringTest.java index c6148aaaef4..e0b576b52d5 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/CommandMonitoringTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/CommandMonitoringTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; public final class CommandMonitoringTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/command-monitoring"); + private static Collection data() { + return getTestData("command-logging-and-monitoring/tests/monitoring"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/ConnectionPoolLoggingTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/ConnectionPoolLoggingTest.java index 6079f1931b7..e9ab1f9d799 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/ConnectionPoolLoggingTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/ConnectionPoolLoggingTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class ConnectionPoolLoggingTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/connection-monitoring-and-pooling/logging"); + private static Collection data() { + return getTestData("connection-monitoring-and-pooling/tests/logging"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java b/driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java index 1890b2e48a3..f1429431690 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/Entities.java @@ -754,6 +754,9 @@ private void initClientEncryption(final BsonDocument entity, final String id, case "kmsProviders": builder.kmsProviders(createKmsProvidersMap(entry.getValue().asDocument())); break; + case "keyExpirationMS": + builder.keyExpiration(entry.getValue().asNumber().longValue(), TimeUnit.MILLISECONDS); + break; default: throw new UnsupportedOperationException("Unsupported client encryption option: " + entry.getKey()); } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/ErrorMatcher.java b/driver-sync/src/test/functional/com/mongodb/client/unified/ErrorMatcher.java index d82e4c6beb1..dce5e06590f 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/ErrorMatcher.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/ErrorMatcher.java @@ -21,6 +21,7 @@ import com.mongodb.MongoClientException; import com.mongodb.MongoCommandException; import com.mongodb.MongoException; +import com.mongodb.MongoGridFSException; import com.mongodb.MongoSecurityException; import com.mongodb.MongoExecutionTimeoutException; import com.mongodb.MongoOperationTimeoutException; @@ -74,11 +75,11 @@ void assertErrorsMatch(final BsonDocument expectedError, final Exception e) { assertTrue(context.getMessage("isError must be true"), expectedError.getBoolean("isError").getValue()); } if (expectedError.containsKey("isClientError")) { - assertEquals(context.getMessage("Exception must be of type MongoClientException or IllegalArgumentException" - + " or IllegalStateException or MongoSocketException or MongoInternalException"), + assertEquals(context.getMessage("Exception must be of type MongoClientException or MongoSocketException" + + " or MongoGridFSException or IllegalArgumentException or IllegalStateException "), expectedError.getBoolean("isClientError").getValue(), - e instanceof MongoClientException || e instanceof IllegalArgumentException || e instanceof IllegalStateException - || e instanceof MongoSocketException); + e instanceof MongoClientException || e instanceof MongoSocketException || e instanceof MongoGridFSException + || e instanceof IllegalArgumentException || e instanceof IllegalStateException); } if (expectedError.containsKey("isTimeoutError")) { diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/IndexManagmentTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/IndexManagementTest.java similarity index 72% rename from driver-sync/src/test/functional/com/mongodb/client/unified/IndexManagmentTest.java rename to driver-sync/src/test/functional/com/mongodb/client/unified/IndexManagementTest.java index 382c5edb3a4..5ff83faf63d 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/IndexManagmentTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/IndexManagementTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; -final class IndexManagmentTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/index-management"); +final class IndexManagementTest extends UnifiedSyncTest { + private static Collection data() { + return getTestData("index-management"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/LoadBalancerTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/LoadBalancerTest.java index eb70f5da4cf..530d10e7f63 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/LoadBalancerTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/LoadBalancerTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class LoadBalancerTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/load-balancers"); + private static Collection data() { + return getTestData("load-balancers"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/ServerSelectionLoggingTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/ServerSelectionLoggingTest.java index 2e932ba975f..4e5e9021877 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/ServerSelectionLoggingTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/ServerSelectionLoggingTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class ServerSelectionLoggingTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/server-selection/logging"); + private static Collection data() { + return getTestData("server-selection/tests/logging"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/SessionsTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/SessionsTest.java index 33d851a38c9..57947cbf075 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/SessionsTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/SessionsTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class SessionsTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/sessions"); + private static Collection data() { + return getTestData("sessions"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedAtlasDataLakeTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedAtlasDataLakeTest.java index 009a78d3d3f..c21f0a4836e 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedAtlasDataLakeTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedAtlasDataLakeTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedAtlasDataLakeTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/atlas-data-lake-testing"); + private static Collection data() { + return getTestData("atlas-data-lake-testing"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedAuthTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedAuthTest.java index 0471a9600c6..56c17a08c4c 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedAuthTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedAuthTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedAuthTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/auth"); + private static Collection data() { + return getTestData("auth"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedClientEncryptionHelper.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedClientEncryptionHelper.java index 8e545841c6a..59f96aa9492 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedClientEncryptionHelper.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedClientEncryptionHelper.java @@ -166,9 +166,10 @@ private static void setKmsProviderProperty(final Map kmsProvider } if (explicitPropertySupplier == null) { - throw new UnsupportedOperationException("Non-placeholder value is not supported for: " + key + " :: " + kmsProviderOptions.toJson()); + kmsProviderMap.put(key, kmsProviderOptions.get(key)); + } else { + kmsProviderMap.put(key, explicitPropertySupplier.get()); } - kmsProviderMap.put(key, explicitPropertySupplier.get()); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java index 735c35dc9ed..2c03bbba051 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudHelper.java @@ -408,6 +408,11 @@ OperationResult executeFind(final BsonDocument operation) { }); } + /** + * There is no explicit {@code findOne()} method in {@link MongoCollection} class. + * Its feature was emulated by {@link FindIterable#first()}, which would close cursor on server + * by setting {@code batchSize} and {@code limit} appropriately. + */ OperationResult executeFindOne(final BsonDocument operation) { return resultOf(() -> createFindIterable(operation).first()); } @@ -633,6 +638,9 @@ OperationResult executeFindOneAndUpdate(final BsonDocument operation) { case "arrayFilters": options.arrayFilters(cur.getValue().asArray().stream().map(BsonValue::asDocument).collect(toList())); break; + case "bypassDocumentValidation": + options.bypassDocumentValidation(cur.getValue().asBoolean().getValue()); + break; default: throw new UnsupportedOperationException("Unsupported argument: " + cur.getKey()); } @@ -709,6 +717,9 @@ OperationResult executeFindOneAndReplace(final BsonDocument operation) { case "collation": options.collation(asCollation(cur.getValue().asDocument())); break; + case "bypassDocumentValidation": + options.bypassDocumentValidation(cur.getValue().asBoolean().getValue()); + break; default: throw new UnsupportedOperationException("Unsupported argument: " + cur.getKey()); } @@ -826,6 +837,9 @@ OperationResult executeAggregate(final BsonDocument operation) { case "maxAwaitTimeMS": iterable.maxAwaitTime(cur.getValue().asNumber().longValue(), TimeUnit.MILLISECONDS); break; + case "bypassDocumentValidation": + iterable.bypassDocumentValidation(cur.getValue().asBoolean().getValue()); + break; default: throw new UnsupportedOperationException("Unsupported argument: " + cur.getKey()); } @@ -976,6 +990,9 @@ OperationResult executeInsertOne(final BsonDocument operation) { case "comment": options.comment(cur.getValue()); break; + case "bypassDocumentValidation": + options.bypassDocumentValidation(cur.getValue().asBoolean().getValue()); + break; default: throw new UnsupportedOperationException("Unsupported argument: " + cur.getKey()); } @@ -1013,6 +1030,9 @@ OperationResult executeInsertMany(final BsonDocument operation) { case "comment": options.comment(cur.getValue()); break; + case "bypassDocumentValidation": + options.bypassDocumentValidation(cur.getValue().asBoolean().getValue()); + break; default: throw new UnsupportedOperationException("Unsupported argument: " + cur.getKey()); } @@ -1057,6 +1077,9 @@ OperationResult executeBulkWrite(final BsonDocument operation) { case "let": options.let(cur.getValue().asDocument()); break; + case "bypassDocumentValidation": + options.bypassDocumentValidation(cur.getValue().asBoolean().getValue()); + break; default: throw new UnsupportedOperationException("Unsupported argument: " + cur.getKey()); } @@ -1187,6 +1210,9 @@ private UpdateOptions getUpdateOptions(final BsonDocument arguments) { case "sort": options.sort(cur.getValue().asDocument()); break; + case "bypassDocumentValidation": + options.bypassDocumentValidation(cur.getValue().asBoolean().getValue()); + break; default: throw new UnsupportedOperationException("Unsupported argument: " + cur.getKey()); } @@ -1224,6 +1250,9 @@ private ReplaceOptions getReplaceOptions(final BsonDocument arguments) { case "sort": options.sort(cur.getValue().asDocument()); break; + case "bypassDocumentValidation": + options.bypassDocumentValidation(cur.getValue().asBoolean().getValue()); + break; default: throw new UnsupportedOperationException("Unsupported argument: " + cur.getKey()); } @@ -1352,10 +1381,10 @@ public OperationResult executeCreateCollection(final BsonDocument operation) { // In Java driver there is a separate method for creating a view, but in the unified test CRUD format // views and collections are both created with the createCollection operation. We use the createView // method if the requisite arguments are present. - if (arguments.containsKey("viewOn") && arguments.containsKey("pipeline")) { + if (arguments.containsKey("viewOn")) { String viewOn = arguments.getString("viewOn").getValue(); List pipeline = - arguments.getArray("pipeline").stream().map(BsonValue::asDocument).collect(toList()); + arguments.getArray("pipeline", new BsonArray()).stream().map(BsonValue::asDocument).collect(toList()); for (Map.Entry cur : arguments.entrySet()) { switch (cur.getKey()) { diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudTest.java index eaf7546bece..4f3a4384ecf 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedCrudTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; public final class UnifiedCrudTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/crud"); + private static Collection data() { + return getTestData("crud"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedGridFSTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedGridFSTest.java index baac34f4959..19ab63cec59 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedGridFSTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedGridFSTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedGridFSTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/gridfs"); + private static Collection data() { + return getTestData("gridfs"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedRetryableReadsTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedRetryableReadsTest.java index 9859bcc782e..7d8239707ad 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedRetryableReadsTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedRetryableReadsTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; public final class UnifiedRetryableReadsTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/retryable-reads"); + private static Collection data() { + return getTestData("retryable-reads"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedRetryableWritesTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedRetryableWritesTest.java index 2397aeb8b0d..871af77b968 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedRetryableWritesTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedRetryableWritesTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; public final class UnifiedRetryableWritesTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/retryable-writes"); + private static Collection data() { + return getTestData("retryable-writes"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedServerDiscoveryAndMonitoringTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedServerDiscoveryAndMonitoringTest.java index a88fe334525..11686d45410 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedServerDiscoveryAndMonitoringTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedServerDiscoveryAndMonitoringTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; public final class UnifiedServerDiscoveryAndMonitoringTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/server-discovery-and-monitoring"); + private static Collection data() { + return getTestData("server-discovery-and-monitoring"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedSyncTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedSyncTest.java index 37db7cfe907..9fc9ef5617f 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedSyncTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedSyncTest.java @@ -25,6 +25,10 @@ import com.mongodb.client.gridfs.GridFSBuckets; import com.mongodb.client.internal.ClientEncryptionImpl; import com.mongodb.client.vault.ClientEncryption; +import com.mongodb.lang.NonNull; +import org.junit.jupiter.params.provider.Arguments; + +import java.util.Collection; public abstract class UnifiedSyncTest extends UnifiedTest { protected UnifiedSyncTest() { @@ -44,4 +48,9 @@ protected GridFSBucket createGridFSBucket(final MongoDatabase database) { protected ClientEncryption createClientEncryption(final MongoClient keyVaultClient, final ClientEncryptionSettings clientEncryptionSettings) { return new ClientEncryptionImpl(keyVaultClient, clientEncryptionSettings); } + + @NonNull + protected static Collection getTestData(final String directory) { + return getTestData(directory, false, Language.JAVA); + } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTest.java index 7ee16484df1..84eb40b4e29 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTest.java @@ -50,7 +50,10 @@ import org.bson.BsonInt32; import org.bson.BsonString; import org.bson.BsonValue; +import org.bson.assertions.Assertions; import org.bson.codecs.BsonDocumentCodec; +import org.bson.diagnostics.Logger; +import org.bson.diagnostics.Loggers; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.extension.ExtendWith; @@ -59,12 +62,12 @@ import org.junit.jupiter.params.provider.MethodSource; import org.opentest4j.TestAbortedException; -import java.io.File; -import java.io.IOException; -import java.net.URISyntaxException; +import java.text.MessageFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.ExecutionException; @@ -81,7 +84,10 @@ import static com.mongodb.client.test.CollectionHelper.getCurrentClusterTime; import static com.mongodb.client.test.CollectionHelper.killAllSessions; import static com.mongodb.client.unified.RunOnRequirementsMatcher.runOnRequirementsMet; +import static com.mongodb.client.unified.UnifiedTestModifications.Modifier; +import static com.mongodb.client.unified.UnifiedTestModifications.applyCustomizations; import static com.mongodb.client.unified.UnifiedTestModifications.testDef; +import static java.lang.String.format; import static java.util.Collections.singletonList; import static java.util.stream.Collectors.toList; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -91,16 +97,27 @@ import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assumptions.abort; import static org.junit.jupiter.api.Assumptions.assumeFalse; import static org.junit.jupiter.api.Assumptions.assumeTrue; -import static util.JsonPoweredTestHelper.getTestDocument; -import static util.JsonPoweredTestHelper.getTestFiles; +import static util.JsonPoweredTestHelper.getSpecTestDocuments; @ExtendWith(AfterBeforeParameterResolver.class) public abstract class UnifiedTest { + private static final Logger LOGGER = Loggers.getLogger("UnifiedTest"); + private static final Set PRESTART_POOL_ASYNC_WORK_MANAGER_FILE_DESCRIPTIONS = Collections.singleton( "wait queue timeout errors include details about checked out connections"); + private static final String MAX_SUPPORTED_SCHEMA_VERSION = "1.22"; + private static final List MAX_SUPPORTED_SCHEMA_VERSION_COMPONENTS = Arrays.stream(MAX_SUPPORTED_SCHEMA_VERSION.split("\\.")) + .map(Integer::parseInt) + .collect(Collectors.toList()); + + public static final int RETRY_ATTEMPTS = 3; + public static final int FORCE_FLAKY_ATTEMPTS = 10; + private static final Set ATTEMPTED_TESTS_TO_HENCEFORTH_IGNORE = new HashSet<>(); + @Nullable private String fileDescription; private String schemaVersion; @@ -156,32 +173,51 @@ public Entities getEntities() { } @NonNull - protected static Collection getTestData(final String directory) throws URISyntaxException, IOException { + protected static Collection getTestData(final String directory, final boolean isReactive, final Language language) { List data = new ArrayList<>(); - for (File file : getTestFiles("/" + directory + "/")) { - BsonDocument fileDocument = getTestDocument(file); + for (BsonDocument fileDocument : getSpecTestDocuments(directory)) { + if (!fileDocument.containsKey("schemaVersion")) { + LOGGER.info("Not a unified test file: " + fileDocument.getString("fileName").getValue()); + continue; + } + String fileDescription = fileDocument.getString("description").getValue(); for (BsonValue cur : fileDocument.getArray("tests")) { - data.add(UnifiedTest.createTestData(directory, fileDocument, cur.asDocument())); + final BsonDocument testDocument = cur.asDocument(); + String testDescription = testDocument.getString("description").getValue(); + TestDef testDef = testDef(directory, fileDescription, testDescription, isReactive, language); + applyCustomizations(testDef); + + boolean forceFlaky = testDef.wasAssignedModifier(Modifier.FORCE_FLAKY); + boolean retry = forceFlaky || testDef.wasAssignedModifier(Modifier.RETRY); + + int attempts; + if (retry) { + attempts = forceFlaky ? FORCE_FLAKY_ATTEMPTS : RETRY_ATTEMPTS; + } else { + attempts = 1; + } + + for (int attempt = 1; attempt <= attempts; attempt++) { + String testName = MessageFormat.format("{0}: {1}", fileDescription, testDescription); + data.add(Arguments.of( + testName, + fileDescription, + testDescription, + directory, + attempt, + attempts, + fileDocument.getString("schemaVersion").getValue(), + fileDocument.getArray("runOnRequirements", null), + fileDocument.getArray("createEntities", new BsonArray()), + fileDocument.getArray("initialData", new BsonArray()), + testDocument.clone())); + } } } return data; } - @NonNull - private static Arguments createTestData( - final String directory, final BsonDocument fileDocument, final BsonDocument testDocument) { - return Arguments.of( - fileDocument.getString("description").getValue(), - testDocument.getString("description").getValue(), - directory, - fileDocument.getString("schemaVersion").getValue(), - fileDocument.getArray("runOnRequirements", null), - fileDocument.getArray("createEntities", new BsonArray()), - fileDocument.getArray("initialData", new BsonArray()), - testDocument); - } - protected BsonDocument getDefinition() { return definition; } @@ -194,9 +230,12 @@ protected BsonDocument getDefinition() { @BeforeEach public void setUp( + final String testName, @Nullable final String fileDescription, @Nullable final String testDescription, @Nullable final String directoryName, + final int attemptNumber, + final int totalAttempts, final String schemaVersion, @Nullable final BsonArray runOnRequirements, final BsonArray entitiesArray, @@ -217,37 +256,16 @@ public void setUp( rootContext.getAssertionContext().push(ContextElement.ofTest(definition)); ignoreExtraEvents = false; if (directoryName != null && fileDescription != null && testDescription != null) { - testDef = testDef(directoryName, fileDescription, testDescription, isReactive()); - UnifiedTestModifications.doSkips(testDef); + testDef = testDef(directoryName, fileDescription, testDescription, isReactive(), getLanguage()); + applyCustomizations(testDef); - boolean skip = testDef.wasAssignedModifier(UnifiedTestModifications.Modifier.SKIP); + boolean skip = testDef.wasAssignedModifier(Modifier.SKIP); assumeFalse(skip, "Skipping test"); } skips(fileDescription, testDescription); - assertTrue( - schemaVersion.equals("1.0") - || schemaVersion.equals("1.1") - || schemaVersion.equals("1.2") - || schemaVersion.equals("1.3") - || schemaVersion.equals("1.4") - || schemaVersion.equals("1.5") - || schemaVersion.equals("1.6") - || schemaVersion.equals("1.7") - || schemaVersion.equals("1.8") - || schemaVersion.equals("1.9") - || schemaVersion.equals("1.10") - || schemaVersion.equals("1.11") - || schemaVersion.equals("1.12") - || schemaVersion.equals("1.13") - || schemaVersion.equals("1.14") - || schemaVersion.equals("1.15") - || schemaVersion.equals("1.16") - || schemaVersion.equals("1.17") - || schemaVersion.equals("1.18") - || schemaVersion.equals("1.19") - || schemaVersion.equals("1.21"), - String.format("Unsupported schema version %s", schemaVersion)); + assumeTrue(isSupportedSchemaVersion(schemaVersion), format("Unsupported schema version %s", schemaVersion)); + if (runOnRequirements != null) { assumeTrue(runOnRequirementsMet(runOnRequirements, getMongoClientSettings(), getServerVersion()), "Run-on requirements not met"); @@ -295,8 +313,9 @@ protected void postCleanUp(final TestDef testDef) { } /** - * This method is called once per {@link #setUp(String, String, String, String, org.bson.BsonArray, org.bson.BsonArray, org.bson.BsonArray, org.bson.BsonDocument)}, - * unless {@link #setUp(String, String, String, String, org.bson.BsonArray, org.bson.BsonArray, org.bson.BsonArray, org.bson.BsonDocument)} fails unexpectedly. + * This method is called once per + * {@link #setUp(String, String, String, String, int, int, String, org.bson.BsonArray, org.bson.BsonArray, org.bson.BsonArray, org.bson.BsonDocument)}, unless + * {@link #setUp(String, String, String, String, int, int, String, org.bson.BsonArray, org.bson.BsonArray, org.bson.BsonArray, org.bson.BsonDocument)} fails unexpectedly. */ protected void skips(final String fileDescription, final String testDescription) { } @@ -305,40 +324,76 @@ protected boolean isReactive() { return false; } - @ParameterizedTest(name = "{0}: {1}") + protected Language getLanguage() { + return Language.JAVA; + } + + @ParameterizedTest(name = "{0}") @MethodSource("data") public void shouldPassAllOutcomes( + final String testName, @Nullable final String fileDescription, @Nullable final String testDescription, @Nullable final String directoryName, + final int attemptNumber, + final int totalAttempts, final String schemaVersion, @Nullable final BsonArray runOnRequirements, final BsonArray entitiesArray, final BsonArray initialData, final BsonDocument definition) { - BsonArray operations = definition.getArray("operations"); - for (int i = 0; i < operations.size(); i++) { - BsonValue cur = operations.get(i); - assertOperation(rootContext, cur.asDocument(), i); + boolean forceFlaky = testDef.wasAssignedModifier(Modifier.FORCE_FLAKY); + if (!forceFlaky) { + boolean ignoreThisTest = ATTEMPTED_TESTS_TO_HENCEFORTH_IGNORE.contains(testName); + assumeFalse(ignoreThisTest, "Skipping a retryable test that already succeeded"); + // The attempt is what counts, since a test may fail with + // something like "ignored", and would not be retried. + // Only failures should trigger another attempt. + ATTEMPTED_TESTS_TO_HENCEFORTH_IGNORE.add(testName); } + try { + BsonArray operations = definition.getArray("operations"); + for (int i = 0; i < operations.size(); i++) { + BsonValue cur = operations.get(i); + assertOperation(rootContext, cur.asDocument(), i); + } - if (definition.containsKey("outcome")) { - assertOutcome(rootContext); - } + if (definition.containsKey("outcome")) { + assertOutcome(rootContext); + } - if (definition.containsKey("expectEvents")) { - compareEvents(rootContext, definition); - } + if (definition.containsKey("expectEvents")) { + compareEvents(rootContext, definition); + } - if (definition.containsKey("expectLogMessages")) { - ArrayList tweaks = new ArrayList<>(singletonList( - // `LogMessage.Entry.Name.OPERATION` is not supported, therefore we skip matching its value - LogMatcher.Tweak.skip(LogMessage.Entry.Name.OPERATION))); - if (getMongoClientSettings().getClusterSettings() - .getHosts().stream().anyMatch(serverAddress -> serverAddress instanceof UnixServerAddress)) { - tweaks.add(LogMatcher.Tweak.skip(LogMessage.Entry.Name.SERVER_PORT)); + if (definition.containsKey("expectLogMessages")) { + ArrayList tweaks = new ArrayList<>(singletonList( + // `LogMessage.Entry.Name.OPERATION` is not supported, therefore we skip matching its value + LogMatcher.Tweak.skip(LogMessage.Entry.Name.OPERATION))); + if (getMongoClientSettings().getClusterSettings() + .getHosts().stream().anyMatch(serverAddress -> serverAddress instanceof UnixServerAddress)) { + tweaks.add(LogMatcher.Tweak.skip(LogMessage.Entry.Name.SERVER_PORT)); + } + compareLogMessages(rootContext, definition, tweaks); + } + } catch (TestAbortedException e) { + // if a test is ignored, we do not retry + throw e; + } catch (Throwable e) { + if (forceFlaky) { + throw e; + } + if (testDef != null && !testDef.matchesThrowable(e)) { + // if the throwable is not matched, test definitions were not intended to apply; rethrow it + throw e; } - compareLogMessages(rootContext, definition, tweaks); + boolean isLastAttempt = attemptNumber == totalAttempts; + if (isLastAttempt) { + throw e; + } + + ATTEMPTED_TESTS_TO_HENCEFORTH_IGNORE.remove(testName); + abort("Ignoring failure and retrying attempt " + attemptNumber); } } @@ -367,6 +422,27 @@ private void compareEvents(final UnifiedTestContext context, final BsonDocument } } + private boolean isSupportedSchemaVersion(final String schemaVersion) { + List schemaVersionComponents = Arrays.stream(schemaVersion.split("\\.")) + .map(Integer::parseInt) + .collect(Collectors.toList()); + + if (schemaVersionComponents.size() != 2) { + Assertions.fail("Unsupported schema version: " + schemaVersion); + } else if (schemaVersionComponents.get(0) < 1) { + Assertions.fail("Unsupported schema version: " + schemaVersion); + } + + for (int i = 0; i < 2; i++){ + int schemaComponent = schemaVersionComponents.get(i); + int maxSupportedComponent = MAX_SUPPORTED_SCHEMA_VERSION_COMPONENTS.get(i); + if (schemaComponent > maxSupportedComponent) { + return false; + } + } + return true; + } + private void compareLogMessages(final UnifiedTestContext rootContext, final BsonDocument definition, final Iterable tweaks) { for (BsonValue cur : definition.getArray("expectLogMessages")) { @@ -1056,4 +1132,8 @@ protected void ignoreExtraCommandEvents(final boolean ignoreExtraEvents) { protected void ignoreExtraEvents() { this.ignoreExtraEvents = true; } + + public enum Language { + JAVA, KOTLIN + } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestFailureValidator.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestFailureValidator.java index 88458f8af8e..2b83bba8d5b 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestFailureValidator.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestFailureValidator.java @@ -24,8 +24,6 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -36,9 +34,12 @@ final class UnifiedTestFailureValidator extends UnifiedSyncTest { @Override @BeforeEach public void setUp( + final String testName, @Nullable final String fileDescription, @Nullable final String testDescription, final String directoryName, + final int attemptNumber, + final int totalAttempts, final String schemaVersion, @Nullable final BsonArray runOnRequirements, final BsonArray entitiesArray, @@ -46,9 +47,12 @@ public void setUp( final BsonDocument definition) { try { super.setUp( + testName, fileDescription, testDescription, directoryName, + attemptNumber, + totalAttempts, schemaVersion, runOnRequirements, entitiesArray, @@ -63,9 +67,12 @@ public void setUp( @ParameterizedTest @MethodSource("data") public void shouldPassAllOutcomes( + final String testName, @Nullable final String fileDescription, @Nullable final String testDescription, @Nullable final String directoryName, + final int attemptNumber, + final int totalAttempts, final String schemaVersion, @Nullable final BsonArray runOnRequirements, final BsonArray entitiesArray, @@ -74,9 +81,12 @@ public void shouldPassAllOutcomes( if (exception == null) { try { super.shouldPassAllOutcomes( + testName, fileDescription, testDescription, directoryName, + attemptNumber, + totalAttempts, schemaVersion, runOnRequirements, entitiesArray, @@ -89,7 +99,7 @@ public void shouldPassAllOutcomes( assertNotNull(exception, "Expected exception but not was thrown"); } - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/valid-fail"); + private static Collection data() { + return getTestData("unified-test-format/tests/valid-fail"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java index 5184fd699be..861c1993d0c 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java @@ -16,11 +16,12 @@ package com.mongodb.client.unified; -import com.mongodb.assertions.Assertions; +import org.opentest4j.AssertionFailedError; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.function.Function; import java.util.function.Supplier; import static com.mongodb.ClusterFixture.isDataLakeTest; @@ -29,14 +30,17 @@ import static com.mongodb.ClusterFixture.isSharded; import static com.mongodb.ClusterFixture.serverVersionLessThan; import static com.mongodb.assertions.Assertions.assertNotNull; +import static com.mongodb.assertions.Assertions.assertTrue; import static com.mongodb.client.unified.UnifiedTestModifications.Modifier.IGNORE_EXTRA_EVENTS; +import static com.mongodb.client.unified.UnifiedTestModifications.Modifier.RETRY; import static com.mongodb.client.unified.UnifiedTestModifications.Modifier.SKIP; import static com.mongodb.client.unified.UnifiedTestModifications.Modifier.SLEEP_AFTER_CURSOR_CLOSE; import static com.mongodb.client.unified.UnifiedTestModifications.Modifier.SLEEP_AFTER_CURSOR_OPEN; import static com.mongodb.client.unified.UnifiedTestModifications.Modifier.WAIT_FOR_BATCH_CURSOR_CREATION; +import static java.lang.String.format; public final class UnifiedTestModifications { - public static void doSkips(final TestDef def) { + public static void applyCustomizations(final TestDef def) { // atlas-data-lake @@ -45,7 +49,7 @@ public static void doSkips(final TestDef def) { .directory("atlas-data-lake-testing"); // change-streams - def.skipNoncompliantReactive("error required from change stream initialization") // TODO reason? + def.skipNoncompliantReactive("error required from change stream initialization") // TODO-JAVA-5711 reason? .test("change-streams", "change-streams", "Test with document comment - pre 4.4"); def.skipNoncompliantReactive("event sensitive tests. We can't guarantee the amount of GetMore commands sent in the reactive driver") .test("change-streams", "change-streams", "Test that comment is set on getMore") @@ -61,35 +65,60 @@ public static void doSkips(final TestDef def) { // client-side-operation-timeout (CSOT) - // TODO + def.skipNoncompliantReactive("No good way to fulfill tryNext() requirement with a Publisher") + .test("client-side-operations-timeout", "timeoutMS behaves correctly for tailable awaitData cursors", + "apply remaining timeoutMS if less than maxAwaitTimeMS"); + + def.skipNoncompliantReactive("No good way to fulfill tryNext() requirement with a Publisher") + .test("client-side-operations-timeout", "timeoutMS behaves correctly for tailable awaitData cursors", + "apply maxAwaitTimeMS if less than remaining timeout"); + + def.skipJira("https://jira.mongodb.org/browse/JAVA-5839") + .test("client-side-operations-timeout", "timeoutMS behaves correctly for GridFS download operations", + "timeoutMS applied to entire download, not individual parts"); + + def.skipJira("https://jira.mongodb.org/browse/JAVA-5815") + .test("client-side-operations-timeout", "WaitQueueTimeoutError does not clear the pool", + "WaitQueueTimeoutError does not clear the pool"); + + // TODO-JAVA-5712 // collection-management - def.skipNoncompliant("") // TODO reason? + def.skipNoncompliant("") // TODO-JAVA-5711 reason? .test("collection-management", "modifyCollection-pre_and_post_images", "modifyCollection to changeStreamPreAndPostImages enabled"); // command-logging-and-monitoring - def.skipNoncompliant("TODO") - .when(() -> !def.isReactive() && isServerlessTest()) // TODO why reactive check? - .directory("command-logging") - .directory("command-monitoring"); + def.skipNoncompliant("") // TODO-JAVA-5711 + .when(() -> !def.isReactive() && isServerlessTest()) // TODO-JAVA-5711 why reactive check? + .directory("command-logging-and-monitoring"); def.skipNoncompliant("The driver has a hack where getLastError command " + "is executed as part of the handshake in order to " + "get a connectionId even when the hello command " + "response doesn't contain it.") - .file("command-monitoring", "pre-42-server-connection-id") - .file("command-logging", "pre-42-server-connection-id"); + .file("command-logging-and-monitoring/tests/logging", "pre-42-server-connection-id") + .file("command-logging-and-monitoring/tests/monitoring", "pre-42-server-connection-id"); + + def.skipNoncompliant("The driver doesn't reduce the batchSize for the getMore") + .test("command-logging-and-monitoring/tests/monitoring", "find", + "A successful find event with a getmore and the server kills the cursor (<= 4.4)"); + + def.skipNoncompliant("The driver doesn't reduce the batchSize for the getMore") + .test("atlas-data-lake-testing", "getMore", "A successful find event with getMore"); // connection-monitoring-and-pooling - // TODO reason, jira + // TODO-JAVA-5711 reason, jira // added as part of https://jira.mongodb.org/browse/JAVA-4976 , but unknown Jira to complete // The implementation of the functionality related to clearing the connection pool before closing the connection // will be carried out once the specification is finalized and ready. def.skipUnknownReason("") - .test("connection-monitoring-and-pooling/logging", "connection-logging", "Connection checkout fails due to error establishing connection"); + .test("connection-monitoring-and-pooling/tests/logging", "connection-logging", "Connection checkout fails due to error establishing connection"); + def.skipUnknownReason("") + .test("connection-monitoring-and-pooling/tests/logging", "connection-pool-options", "waitQueueSize should be included in connection pool created message when specified") + .test("connection-monitoring-and-pooling/tests/logging", "connection-pool-options", "waitQueueMultiple should be included in connection pool created message when specified"); // load-balancers @@ -135,12 +164,24 @@ public static void doSkips(final TestDef def) { .test("crud", "findOneAndDelete-hint-unacknowledged", "Unacknowledged findOneAndDelete with hint string on 4.4+ server") .test("crud", "findOneAndDelete-hint-unacknowledged", "Unacknowledged findOneAndDelete with hint document on 4.4+ server"); + def.skipNoncompliant("https://jira.mongodb.org/browse/JAVA-5838") + .when(() -> def.isReactive() && UnifiedTest.Language.KOTLIN.equals(def.getLanguage())) + .file("crud", "findOne"); + + def.skipNoncompliant("Updates and Replace bulk operations are split in the java driver") + .file("crud", "bulkWrite-comment"); + // gridfs def.skipDeprecated("contentType is deprecated in GridFS spec, and 4.x Java driver no longer supports it") .test("gridfs", "gridfs-upload", "upload when contentType is provided"); def.skipJira("https://jira.mongodb.org/browse/JAVA-4214") .test("gridfs", "gridfs-delete", "delete when files entry does not exist and there are orphaned chunks"); + def.skipJira("https://jira.mongodb.org/browse/JAVA-5677") + .file("gridfs", "gridfs-rename"); + def.skipJira("https://jira.mongodb.org/browse/JAVA-5689") + .file("gridfs", "gridfs-deleteByName") + .file("gridfs", "gridfs-renameByName"); // retryable-reads @@ -167,8 +208,6 @@ public static void doSkips(final TestDef def) { .file("retryable-reads", "listDatabaseObjects-serverErrors") .file("retryable-reads", "listCollectionObjects") .file("retryable-reads", "listCollectionObjects-serverErrors"); - def.skipJira("https://jira.mongodb.org/browse/JAVA-5224") - .test("retryable-reads", "ReadConcernMajorityNotAvailableYet is a retryable read", "Find succeeds on second attempt after ReadConcernMajorityNotAvailableYet"); // retryable-writes @@ -213,6 +252,12 @@ public static void doSkips(final TestDef def) { .test("server-discovery-and-monitoring", "serverMonitoringMode", "poll waits after successful heartbeat"); def.skipJira("https://jira.mongodb.org/browse/JAVA-4536") .file("server-discovery-and-monitoring", "interruptInUse"); + def.skipJira("https://jira.mongodb.org/browse/JAVA-5664") + .file("server-discovery-and-monitoring", "pool-clear-application-error"); + def.skipJira("https://jira.mongodb.org/browse/JAVA-5664") + .file("server-discovery-and-monitoring", "pool-clear-on-error-checkout"); + def.skipJira("https://jira.mongodb.org/browse/JAVA-5664") + .file("server-discovery-and-monitoring", "pool-cleared-on-min-pool-size-population-error"); // transactions @@ -236,35 +281,63 @@ public static void doSkips(final TestDef def) { + "than handle that in code, we skip the test on older " + "server versions.") .when(() -> serverVersionLessThan(4, 4)) - .test("valid-pass", "poc-retryable-writes", "InsertOne fails after multiple retryable writeConcernErrors"); + .test("unified-test-format/tests/valid-pass", "poc-retryable-writes", "InsertOne fails after multiple retryable writeConcernErrors"); + + def.skipNoncompliant("The driver doesn't reduce the batchSize for the getMore") + .test("unified-test-format/tests/valid-pass", "poc-command-monitoring", + "A successful find event with a getmore and the server kills the cursor (<= 4.4)"); + def.skipJira("https://jira.mongodb.org/browse/JAVA-5389") - .file("valid-pass", "expectedEventsForClient-topologyDescriptionChangedEvent"); + .file("unified-test-format/tests/valid-pass", "expectedEventsForClient-topologyDescriptionChangedEvent"); def.skipJira("https://jira.mongodb.org/browse/JAVA-4862") - .file("valid-pass", "entity-commandCursor"); + .file("unified-test-format/tests/valid-pass", "entity-commandCursor"); def.skipJira("https://jira.mongodb.org/browse/JAVA-5631") - .file("valid-pass", "kmsProviders-explicit_kms_credentials") - .file("valid-pass", "kmsProviders-mixed_kms_credential_fields"); + .file("unified-test-format/tests/valid-pass", "kmsProviders-explicit_kms_credentials") + .file("unified-test-format/tests/valid-pass", "kmsProviders-mixed_kms_credential_fields"); + def.skipJira("https://jira.mongodb.org/browse/JAVA-5672") + .file("unified-test-format/tests/valid-pass", "operator-matchAsRoot"); + + // valid fail + + def.skipJira("https://jira.mongodb.org/browse/JAVA-5672") + .file("unified-test-format/tests/valid-fail", "operator-matchAsDocument"); } private UnifiedTestModifications() {} - public static TestDef testDef(final String dir, final String file, final String test, final boolean reactive) { - return new TestDef(dir, file, test, reactive); + public static TestDef testDef(final String dir, final String file, final String test, final boolean reactive, + final UnifiedTest.Language language) { + return new TestDef(dir, file, test, reactive, language); } public static final class TestDef { + private final String dir; private final String file; private final String test; private final boolean reactive; + private final UnifiedTest.Language language; private final List modifiers = new ArrayList<>(); + private Function matchesThrowable; - private TestDef(final String dir, final String file, final String test, final boolean reactive) { + private TestDef(final String dir, final String file, final String test, final boolean reactive, final UnifiedTest.Language language) { this.dir = assertNotNull(dir); this.file = assertNotNull(file); this.test = assertNotNull(test); this.reactive = reactive; + this.language = assertNotNull(language); + } + + @Override + public String toString() { + return "TestDef{" + + "modifiers=" + modifiers + + ", reactive=" + reactive + + ", test='" + test + '\'' + + ", file='" + file + '\'' + + ", dir='" + dir + '\'' + + '}'; } /** @@ -274,7 +347,7 @@ private TestDef(final String dir, final String file, final String test, final bo * @param ticket reason for skipping the test; must start with a Jira URL */ public TestApplicator skipJira(final String ticket) { - Assertions.assertTrue(ticket.startsWith("https://jira.mongodb.org/browse/JAVA-")); + assertTrue(ticket.startsWith("https://jira.mongodb.org/browse/JAVA-")); return new TestApplicator(this, ticket, SKIP); } @@ -322,6 +395,21 @@ public TestApplicator skipUnknownReason(final String reason) { return new TestApplicator(this, reason, SKIP); } + /** + * The test will be retried, for the reason provided + */ + public TestApplicator retry(final String reason) { + return new TestApplicator(this, reason, RETRY); + } + + /** + * The reactive test will be retried, for the reason provided + */ + public TestApplicator retryReactive(final String reason) { + return new TestApplicator(this, reason, RETRY) + .when(this::isReactive); + } + public TestApplicator modify(final Modifier... modifiers) { return new TestApplicator(this, null, modifiers); } @@ -330,9 +418,20 @@ public boolean isReactive() { return reactive; } + public UnifiedTest.Language getLanguage() { + return language; + } + public boolean wasAssignedModifier(final Modifier modifier) { return this.modifiers.contains(modifier); } + + public boolean matchesThrowable(final Throwable e) { + if (matchesThrowable != null) { + return matchesThrowable.apply(e); + } + return false; + } } /** @@ -340,17 +439,19 @@ public boolean wasAssignedModifier(final Modifier modifier) { */ public static final class TestApplicator { private final TestDef testDef; - private final List modifiersToApply; private Supplier precondition; private boolean matchWasPerformed = false; + private final List modifiersToApply; + private Function matchesThrowable; + private TestApplicator( final TestDef testDef, final String reason, final Modifier... modifiersToApply) { this.testDef = testDef; this.modifiersToApply = Arrays.asList(modifiersToApply); - if (this.modifiersToApply.contains(SKIP)) { + if (this.modifiersToApply.contains(SKIP) || this.modifiersToApply.contains(RETRY)) { assertNotNull(reason); } } @@ -362,6 +463,7 @@ private TestApplicator onMatch(final boolean match) { } if (match) { this.testDef.modifiers.addAll(this.modifiersToApply); + this.testDef.matchesThrowable = this.matchesThrowable; } return this; } @@ -372,7 +474,7 @@ private TestApplicator onMatch(final boolean match) { * @return this */ public TestApplicator directory(final String dir) { - boolean match = ("unified-test-format/" + dir).equals(testDef.dir); + boolean match = (dir).equals(testDef.dir); return onMatch(match); } @@ -383,7 +485,7 @@ public TestApplicator directory(final String dir) { * @return this */ public TestApplicator file(final String dir, final String file) { - boolean match = ("unified-test-format/" + dir).equals(testDef.dir) + boolean match = (dir).equals(testDef.dir) && file.equals(testDef.file); return onMatch(match); } @@ -396,7 +498,7 @@ public TestApplicator file(final String dir, final String file) { * @return this */ public TestApplicator test(final String dir, final String file, final String test) { - boolean match = testDef.dir.equals("unified-test-format/" + dir) + boolean match = testDef.dir.equals(dir) && testDef.file.equals(file) && testDef.test.equals(test); return onMatch(match); @@ -409,13 +511,13 @@ public TestApplicator test(final String dir, final String file, final String tes * @return this */ public TestApplicator testContains(final String dir, final String fragment) { - boolean match = ("unified-test-format/" + dir).equals(testDef.dir) + boolean match = (dir).equals(testDef.dir) && testDef.test.contains(fragment); if (match) { System.out.printf( "!!! REPLACE %s WITH: .test(\"%s\", \"%s\", \"%s\")%n", fragment, - testDef.dir.replace("unified-test-format/", ""), + testDef.dir, testDef.file, testDef.test); } @@ -428,7 +530,7 @@ public TestApplicator testContains(final String dir, final String fragment) { * @param test the individual test's "description" field * @return this */ - public TestApplicator test(final String dir, final String test) { + public TestApplicator debug(final String dir, final String test) { boolean match = testDef.test.equals(test); if (match) { System.out.printf( @@ -453,6 +555,27 @@ public TestApplicator when(final Supplier precondition) { this.precondition = precondition; return this; } + + /** + * The modification, if it is a RETRY, will only be applied when the + * failure message contains the provided message fragment. If an + * {@code AssertionFailedError} occurs, and has a cause, the cause's + * message will be checked. Otherwise, the throwable will be checked. + */ + public TestApplicator whenFailureContains(final String messageFragment) { + assertTrue(this.modifiersToApply.contains(RETRY), + format("Modifier %s was not specified before calling whenFailureContains", RETRY)); + this.matchesThrowable = (final Throwable e) -> { + // inspect the cause for failed assertions with a cause + if (e instanceof AssertionFailedError && e.getCause() != null) { + return e.getCause().getMessage().contains(messageFragment); + } else { + return e.getMessage().contains(messageFragment); + } + }; + return this; + } + } public enum Modifier { @@ -478,5 +601,17 @@ public enum Modifier { * Skip the test. */ SKIP, + /** + * Ignore results and retry the test on failure. Will not repeat the + * test if the test succeeds. Multiple copies of the test are used to + * facilitate retries. + */ + RETRY, + /** + * The test will be retried multiple times, without the results being + * ignored. This is a helper that can be used, in patches, to check + * if certain tests are (still) flaky. + */ + FORCE_FLAKY, } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestValidator.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestValidator.java index 414d161677d..bc5177be3e0 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestValidator.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestValidator.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedTestValidator extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/valid-pass"); + private static Collection data() { + return getTestData("unified-test-format/tests/valid-pass"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTransactionsTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTransactionsTest.java index cf95ba9795a..43e9e16452c 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTransactionsTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTransactionsTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedTransactionsTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/transactions"); + private static Collection data() { + return getTestData("transactions"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedWriteConcernTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedWriteConcernTest.java index 4d1a5a2f854..e9d9019b48d 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedWriteConcernTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedWriteConcernTest.java @@ -18,12 +18,11 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class UnifiedWriteConcernTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/write-concern"); + private static Collection data() { + // Note: only the write-concern tests in this directory are in unified test format + return getTestData("read-write-concern"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/ValueMatcher.java b/driver-sync/src/test/functional/com/mongodb/client/unified/ValueMatcher.java index 899769d2d9f..ba887ff0fd5 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/ValueMatcher.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/ValueMatcher.java @@ -24,6 +24,7 @@ import java.util.List; import java.util.stream.Collectors; +import static java.util.Arrays.asList; import static java.util.Collections.singletonList; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -34,6 +35,7 @@ final class ValueMatcher { private final Entities entities; private final AssertionContext context; + private static final List NUMBER_TYPES = asList("int", "long", "double", "decimal"); ValueMatcher(final Entities entities, final AssertionContext context) { this.entities = entities; @@ -158,7 +160,8 @@ private void assertValuesMatch(final BsonValue initialExpected, @Nullable final private void assertExpectedType(final BsonValue actualValue, final BsonValue expectedTypes) { List types; if (expectedTypes.isString()) { - types = singletonList(expectedTypes.asString().getValue()); + String expectedType = expectedTypes.asString().getValue(); + types = expectedType.equals("number") ? NUMBER_TYPES : singletonList(expectedType); } else if (expectedTypes.isArray()) { types = expectedTypes.asArray().stream().map(type -> type.asString().getValue()).collect(Collectors.toList()); } else { diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/VersionedApiTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/VersionedApiTest.java index e9ccd4d1cd4..95b23da9ce7 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/VersionedApiTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/VersionedApiTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class VersionedApiTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { + private static Collection data() { return getTestData("versioned-api"); } } diff --git a/driver-sync/src/test/functional/com/mongodb/client/unified/WithTransactionHelperTransactionsTest.java b/driver-sync/src/test/functional/com/mongodb/client/unified/WithTransactionHelperTransactionsTest.java index d9fb4c9b4df..264e73a7c08 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/unified/WithTransactionHelperTransactionsTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/unified/WithTransactionHelperTransactionsTest.java @@ -18,12 +18,10 @@ import org.junit.jupiter.params.provider.Arguments; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.Collection; final class WithTransactionHelperTransactionsTest extends UnifiedSyncTest { - private static Collection data() throws URISyntaxException, IOException { - return getTestData("unified-test-format/transactions-convenient-api"); + private static Collection data() { + return getTestData("transactions-convenient-api"); } } diff --git a/driver-sync/src/test/unit/com/mongodb/client/MongoClientSpecification.groovy b/driver-sync/src/test/unit/com/mongodb/client/MongoClientSpecification.groovy index a947effd36f..95004ddedf8 100644 --- a/driver-sync/src/test/unit/com/mongodb/client/MongoClientSpecification.groovy +++ b/driver-sync/src/test/unit/com/mongodb/client/MongoClientSpecification.groovy @@ -68,7 +68,7 @@ class MongoClientSpecification extends Specification { .retryWrites(true) .codecRegistry(CODEC_REGISTRY) .build() - def client = new MongoClientImpl(Stub(Cluster), null, settings, new TestOperationExecutor([])) + def client = new MongoClientImpl(Stub(Cluster), null, settings, null, new TestOperationExecutor([])) when: def database = client.getDatabase('name') @@ -85,7 +85,7 @@ class MongoClientSpecification extends Specification { def 'should use ListDatabasesIterableImpl correctly'() { given: def executor = new TestOperationExecutor([null, null]) - def client = new MongoClientImpl(Stub(Cluster), null, MongoClientSettings.builder().build(), executor) + def client = new MongoClientImpl(Stub(Cluster), null, MongoClientSettings.builder().build(), null, executor) def listDatabasesMethod = client.&listDatabases def listDatabasesNamesMethod = client.&listDatabaseNames @@ -130,7 +130,7 @@ class MongoClientSpecification extends Specification { .build() def readPreference = settings.getReadPreference() def readConcern = settings.getReadConcern() - def client = new MongoClientImpl(Stub(Cluster), null, settings, executor) + def client = new MongoClientImpl(Stub(Cluster), null, settings, null, executor) def watchMethod = client.&watch when: @@ -167,7 +167,8 @@ class MongoClientSpecification extends Specification { def 'should validate the ChangeStreamIterable pipeline data correctly'() { given: def executor = new TestOperationExecutor([]) - def client = new MongoClientImpl(Stub(Cluster), null, MongoClientSettings.builder().build(), executor) + def client = new MongoClientImpl(Stub(Cluster), null, MongoClientSettings.builder().build(), null, + executor) when: client.watch((Class) null) @@ -196,7 +197,7 @@ class MongoClientSpecification extends Specification { } } def settings = MongoClientSettings.builder().build() - def client = new MongoClientImpl(cluster, null, settings, new TestOperationExecutor([])) + def client = new MongoClientImpl(cluster, null, settings, null, new TestOperationExecutor([])) expect: client.getClusterDescription() == clusterDescription @@ -211,7 +212,7 @@ class MongoClientSpecification extends Specification { .build() when: - def client = new MongoClientImpl(Stub(Cluster), null, settings, new TestOperationExecutor([])) + def client = new MongoClientImpl(Stub(Cluster), null, settings, null, new TestOperationExecutor([])) then: (client.getCodecRegistry().get(UUID) as UuidCodec).getUuidRepresentation() == C_SHARP_LEGACY diff --git a/driver-workload-executor/build.gradle b/driver-workload-executor/build.gradle deleted file mode 100644 index 7c48e444dc2..00000000000 --- a/driver-workload-executor/build.gradle +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -buildscript { - repositories { - maven { url "https://plugins.gradle.org/m2/" } - } - dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0' - } -} - -apply plugin: 'application' -apply plugin: 'com.github.johnrengelman.shadow' - -mainClassName = "com.mongodb.workload.WorkloadExecutor" - -sourceSets { - main { - java { - srcDir 'src/main' - } - resources { - srcDir 'src/resources' - } - } -} - -dependencies { - implementation project(':driver-sync') - implementation project(':driver-core').sourceSets.test.output - implementation project(':driver-sync').sourceSets.test.output - implementation "ch.qos.logback:logback-classic:$logbackVersion" - implementation(platform("org.junit:junit-bom:$junitBomVersion")) - implementation('org.junit.jupiter:junit-jupiter') - implementation('org.junit.vintage:junit-vintage-engine') -} - -javadoc { - enabled = false -} - -jar { - manifest { - attributes "Main-Class": "com.mongodb.workload.WorkloadExecutor" - } -} diff --git a/driver-workload-executor/build.gradle.kts b/driver-workload-executor/build.gradle.kts new file mode 100644 index 00000000000..2cb5f2e1073 --- /dev/null +++ b/driver-workload-executor/build.gradle.kts @@ -0,0 +1,57 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id("application") + id("java-library") + id("project.base") + id("conventions.test-artifacts") +} + +application { + mainClass = "com.mongodb.workload.WorkloadExecutor" +} + +sourceSets { + main { + java { setSrcDirs(listOf("src/main")) } + resources { setSrcDirs(listOf("src/resources")) } + } +} + +dependencies { + implementation(project(":driver-sync")) + implementation(project(path = ":driver-core", configuration = "testArtifacts")) + implementation(project(path = ":driver-sync", configuration = "testArtifacts")) + implementation(platform(libs.junit.bom)) + implementation(libs.bundles.junit.vintage) +} + +tasks.withType().configureEach { + enabled = false +} + +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} + + +tasks.withType { + manifest { + attributes["Main-Class"] = "com.mongodb.workload.WorkloadExecutor" + } +} diff --git a/driver-workload-executor/src/main/com/mongodb/workload/WorkloadExecutor.java b/driver-workload-executor/src/main/com/mongodb/workload/WorkloadExecutor.java index 0e995cb34fd..7aba736aebc 100644 --- a/driver-workload-executor/src/main/com/mongodb/workload/WorkloadExecutor.java +++ b/driver-workload-executor/src/main/com/mongodb/workload/WorkloadExecutor.java @@ -98,18 +98,24 @@ protected boolean terminateLoop() { BsonArray createEntities = fileDocument.getArray("createEntities", new BsonArray()); BsonArray initialData = fileDocument.getArray("initialData", new BsonArray()); unifiedTest.setUp( + "", null, null, null, + 1, + 1, schemaVersion, runOnRequirements, createEntities, initialData, testDocument); unifiedTest.shouldPassAllOutcomes( + "", null, null, null, + 1, + 1, schemaVersion, runOnRequirements, createEntities, diff --git a/graalvm-native-image-app/build.gradle b/graalvm-native-image-app/build.gradle deleted file mode 100644 index b3d7335f9d9..00000000000 --- a/graalvm-native-image-app/build.gradle +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Note requires a Gradle project flag `-PincludeGraalvm` (see settings.gradle). - -plugins { - id 'application' - id 'org.graalvm.buildtools.native' version '0.9.23' -} - -application { - mainClass = 'com.mongodb.internal.graalvm.NativeImageApp' -} - -def systemPropertiesForRunningNativeApp = System.getProperties().findAll { it.key.toString().startsWith("org.mongodb.") } -tasks.matching { it.name == 'run' }.configureEach { - systemProperties(systemPropertiesForRunningNativeApp) -} - -// see https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html -graalvmNative { - metadataRepository { - enabled = false - } - agent { - // Executing the `run` Gradle task with the tracing agent - // https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/ - // requires running Gradle with GraalVM despite the toolchain for the task already being GraalVM. - // The same is true about executing the `metadataCopy` Gradle task. - // This may be a manifestation of an issue with the `org.graalvm.buildtools.native` plugin. - enabled = false - defaultMode = 'direct' - def taskExecutedWithAgentAttached = 'run' - modes { - direct { - // see https://www.graalvm.org/latest/reference-manual/native-image/metadata/ExperimentalAgentOptions - options.add("config-output-dir=$buildDir/native/agent-output/$taskExecutedWithAgentAttached") - // `experimental-configuration-with-origins` produces - // `graalvm-native-image-app/build/native/agent-output/run/reflect-origins.txt` - // and similar files that explain the origin of each of the reachability metadata piece. - // However, for some reason, the actual reachability metadata is not generated when this option is enabled, - // so enable it manually if you need an explanation for a specific reachability metadata entry, - // and expect the build to fail. - // options.add('experimental-configuration-with-origins') - - // `experimental-class-define-support` does not seem to do what it is supposed to do. - // We need this option to work if we want to support `UnixServerAddress` in native image. - // Unfortunately, the tracing agent neither generates the metadata in - // `graalvm-native-image-app/src/main/resources/META-INF/native-image/proxy-config.json`, - // nor does it extract the bytecode of the generated classes to - // `graalvm-native-image-app/src/main/resources/META-INF/native-image/agent-extracted-predefined-classes`. - options.add('experimental-class-define-support') - } - } - metadataCopy { - inputTaskNames.add(taskExecutedWithAgentAttached) - outputDirectories.add('src/main/resources/META-INF/native-image') - mergeWithExisting = false - } - } - binaries { - configureEach { - buildArgs.add('--strict-image-heap') - buildArgs.add('-H:+UnlockExperimentalVMOptions') - // see class initialization and other reports in `graalvm/build/native/nativeCompile/reports` - buildArgs.add('--diagnostics-mode') - // see the "registerResource" entries in the `native-image` built-time output, - // informing us on the resources included in the native image being built - buildArgs.add('-H:Log=registerResource:5') - } - main { - sharedLibrary = false - def mainClassName = application.mainClass.get() - imageName = mainClassName.substring(mainClassName.lastIndexOf('.') + 1, mainClassName.length()) - runtimeArgs.addAll(systemPropertiesForRunningNativeApp.entrySet() - .stream() - .map {"-D${it.getKey()}=${it.getValue()}" } - .toList()) - quickBuild = true - // See the "Apply" entries in the `native-image` built-time output, informing us on - // the build configuration files (https://www.graalvm.org/latest/reference-manual/native-image/overview/BuildConfiguration/) - // and the reachability metadata files (https://www.graalvm.org/latest/reference-manual/native-image/metadata/) - // which are applied at build time. - verbose = true - } - } -} - -dependencies { - // we intentionally depend here on the driver artifacts instead of depending on compiled classes - implementation project(path:':bson', configuration:'archives') - implementation project(path:':driver-core', configuration:'archives') - implementation project(path:':driver-sync', configuration:'archives') - implementation project(path:':driver-reactive-streams', configuration:'archives') - implementation project(path:':driver-legacy', configuration:'archives') - implementation project(path: ':mongodb-crypt', configuration: 'archives') - implementation project(path: ':mongodb-crypt', configuration: 'runtimeElements') - // note that as a result of these `sourceSets` dependencies, `driver-sync/src/test/resources/logback-test.xml` is used - implementation project(':driver-core').sourceSets.test.output - implementation project(':driver-sync').sourceSets.test.output - implementation project(':driver-legacy').sourceSets.test.output - implementation project(':driver-reactive-streams').sourceSets.test.output - implementation 'org.slf4j:slf4j-api:2.0.12' - implementation "ch.qos.logback:logback-classic:$logbackVersion" - implementation platform("io.projectreactor:reactor-bom:$projectReactorVersion") - implementation 'io.projectreactor:reactor-core' - implementation "org.graalvm.sdk:nativeimage:$graalSdkVersion" -} diff --git a/graalvm-native-image-app/build.gradle.kts b/graalvm-native-image-app/build.gradle.kts new file mode 100644 index 00000000000..464c7711f20 --- /dev/null +++ b/graalvm-native-image-app/build.gradle.kts @@ -0,0 +1,185 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Note requires a Gradle project flag `-PincludeGraalvm` (see settings.gradle.kts). + +plugins { + id("application") + id("java-library") + id("project.base") + id("conventions.test-artifacts") + alias(libs.plugins.graalvm.buildtools) +} + +application { + mainClass = "com.mongodb.internal.graalvm.NativeImageApp" +} + +sourceSets { + main { + java { setSrcDirs(listOf("src/main")) } + resources { setSrcDirs(listOf("src/main/resources")) } + } +} + +dependencies { + // we intentionally depend here on the driver artifacts instead of depending on compiled classes + implementation(project(path = ":bson", configuration = "archives")) + implementation(project(path = ":driver-core", configuration = "archives")) + implementation(project(path = ":driver-sync", configuration = "archives")) + implementation(project(path = ":driver-legacy", configuration = "archives")) + implementation(project(path = ":driver-reactive-streams", configuration = "archives")) + implementation(project(path = ":mongodb-crypt", configuration = "archives")) + implementation(project(path = ":mongodb-crypt", configuration = "runtimeElements")) + + implementation(project(path = ":driver-core", configuration = "testArtifacts")) + implementation(project(path = ":driver-sync", configuration = "testArtifacts")) + implementation(project(path = ":driver-legacy", configuration = "testArtifacts")) + implementation(project(path = ":driver-reactive-streams", configuration = "testArtifacts")) + + implementation(libs.slf4j) + implementation(libs.jna) + implementation(libs.graal.sdk.nativeimage) + implementation(libs.jetbrains.annotations) + implementation(libs.logback.classic) + implementation(platform(libs.project.reactor.bom)) + implementation(libs.project.reactor.core) +} + +tasks.withType().configureEach { + enabled = false +} + + +@Suppress("UNCHECKED_CAST") +val systemPropertiesForRunningNativeApp: Map = (System.getProperties().toMap() as Map) + .filterKeys { it.startsWith("org.mongodb.") } +tasks.named("run") { systemProperties = systemPropertiesForRunningNativeApp } + +// see https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html +graalvmNative { + metadataRepository { + enabled.set(false) + } + agent { + // Executing the `run` Gradle task with the tracing agent + // https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/ + // requires running Gradle with GraalVM despite the toolchain for the task already being GraalVM. + // The same is true about executing the `metadataCopy` Gradle task. + // This may be a manifestation of an issue with the `org.graalvm.buildtools.native` plugin. + enabled.set(false) + defaultMode.set("direct") + val taskExecutedWithAgentAttached = "run" + modes { + direct { + // see https://www.graalvm.org/latest/reference-manual/native-image/metadata/ExperimentalAgentOptions + options.add("config-output-dir=${rootProject.file("build/native/agent-output/$taskExecutedWithAgentAttached").path}") + // `experimental-configuration-with-origins` produces + // `graalvm-native-image-app/build/native/agent-output/run/reflect-origins.txt` + // and similar files that explain the origin of each of the reachability metadata piece. + // However, for some reason, the actual reachability metadata is not generated when this option is enabled, + // so enable it manually if you need an explanation for a specific reachability metadata entry, + // and expect the build to fail. + // options.add("experimental-configuration-with-origins") + + // `experimental-class-define-support` does not seem to do what it is supposed to do. + // We need this option to work if we want to support `UnixServerAddress` in native image. + // Unfortunately, the tracing agent neither generates the metadata in + // `graalvm-native-image-app/src/main/resources/META-INF/native-image/proxy-config.json`, + // nor does it extract the bytecode of the generated classes to + // `graalvm-native-image-app/src/main/resources/META-INF/native-image/agent-extracted-predefined-classes`. + options.add("experimental-class-define-support") + } + } + metadataCopy { + inputTaskNames.add(taskExecutedWithAgentAttached) + outputDirectories.add("src/main/resources/META-INF/native-image") + mergeWithExisting.set(false) + } + } + binaries { + configureEach { + buildArgs.add("--strict-image-heap") + buildArgs.add("-H:+UnlockExperimentalVMOptions") + // see class initialization and other reports in `graalvm/build/native/nativeCompile/reports` + buildArgs.add("--diagnostics-mode") + // see the "registerResource" entries in the `native-image` built-time output, + // informing us on the resources included in the native image being built + buildArgs.add("-H:Log=registerResource:5") + } + named("main") { + val mainClassName = application.mainClass.get() + imageName = mainClassName.substring(mainClassName.lastIndexOf('.') + 1) + sharedLibrary.set(false) + runtimeArgs.addAll(systemPropertiesForRunningNativeApp.entries + .stream() + .map {"-D${it.key}=${it.value}" } + .toList()) + quickBuild.set(true) + // See the "Apply" entries in the `native-image` built-time output, informing us on + // the build configuration files (https://www.graalvm.org/latest/reference-manual/native-image/overview/BuildConfiguration/) + // and the reachability metadata files (https://www.graalvm.org/latest/reference-manual/native-image/metadata/) + // which are applied at build time. + verbose.set(true) + } + } +} + +// By configuring the toolchains for the `org.graalvm.buildtools.native` plugin +// conditionally, we avoid Gradle errors caused by it failing to locate an installed GraalVM +// for Java SE older than 21. One situation when this is relevant is building from an IDE, +// where the `DEFAULT_JDK_VERSION` is likely used. +val minRequiredGraalVMJavaVersion = 21 +val graalJavaVersion: Int = findProperty("javaVersion")?.toString()?.toInt() ?: minRequiredGraalVMJavaVersion +val javaLanguageVersion: JavaLanguageVersion = JavaLanguageVersion.of(graalJavaVersion) + +if (graalJavaVersion >= minRequiredGraalVMJavaVersion) { + // `JvmVendorSpec.GRAAL_VM` matches only GraalVM Community (https://github.com/graalvm/graalvm-ce-builds/releases), + // and does not match any other GraalVM distribution. + // That is, Gradle fails to locate any other installed distribution of GraalVM. + // Furthermore, there is no other way to express via the Gradle toolchain functionality + // that GraalVM must be used. The documentation of the `org.graalvm.buildtools.native` plugin + // says the following about this limitation: + // "be aware that the toolchain detection cannot distinguish between GraalVM JDKs + // and standard JDKs without Native Image support: + // if you have both installed on the machine, Gradle may randomly pick one or the other". + // Fortunately, `JvmVendorSpec.GRAAL_VM` makes things less hideous than that. + // + // The documentation of the `org.graalvm.buildtools.native` plugin mentions + // the environment variable `GRAALVM_HOME` as an alternative to Gradle toolchain functionality. + // I was unable to find a way to stop relying on the toolchain specification requiring `JvmVendorSpec.GRAAL_VM` + // even with `GRAALVM_HOME`. + val graalVendor = JvmVendorSpec.GRAAL_VM + graalvmNative { + agent { + java { + toolchain { + // TODO - errors saying its immutable. + // languageVersion.set(javaLanguageVersion) + // vendor.set(graalVendor) + } + } + } + binaries { + configureEach { + javaLauncher.set(javaToolchains.launcherFor { + languageVersion.set(javaLanguageVersion) + vendor.set(graalVendor) + }) + } + } + } +} diff --git a/graalvm-native-image-app/src/main/com/mongodb/internal/graalvm/NativeImageApp.java b/graalvm-native-image-app/src/main/com/mongodb/internal/graalvm/NativeImageApp.java index 59778d7686f..400a1131108 100644 --- a/graalvm-native-image-app/src/main/com/mongodb/internal/graalvm/NativeImageApp.java +++ b/graalvm-native-image-app/src/main/com/mongodb/internal/graalvm/NativeImageApp.java @@ -18,7 +18,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nullable; +import org.jetbrains.annotations.Nullable; import java.util.Arrays; import java.util.List; import java.util.Objects; diff --git a/graalvm-native-image-app/src/main/resources/META-INF/native-image/resource-config.json b/graalvm-native-image-app/src/main/resources/META-INF/native-image/resource-config.json index d4bf7ea12ff..3727b46aaff 100644 --- a/graalvm-native-image-app/src/main/resources/META-INF/native-image/resource-config.json +++ b/graalvm-native-image-app/src/main/resources/META-INF/native-image/resource-config.json @@ -44,12 +44,6 @@ "pattern":"\\QMETA-INF/services/javax.xml.parsers.SAXParserFactory\\E" }, { "pattern":"\\QMETA-INF/services/org.slf4j.spi.SLF4JServiceProvider\\E" - }, { - "pattern":"\\Qlogback-test.scmo\\E" - }, { - "pattern":"\\Qlogback-test.xml\\E" - }, { - "pattern":"\\Qlogback.scmo\\E" }, { "pattern":"java.base:\\Qjdk/internal/icu/impl/data/icudt72b/nfc.nrm\\E" }]}, diff --git a/gradle.properties b/gradle.properties index d3514e32f68..5504436c80f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,11 +14,13 @@ # limitations under the License. # +version=5.5.0 + org.gradle.daemon=true -org.gradle.jvmargs=-Duser.country=US -Duser.language=en +org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en ## NOTE: This property is also used to generate scala compile versions in BOM. -scalaVersions=2.11.12,2.12.20,2.13.15 -defaultScalaVersions=2.13.15 +supportedScalaVersions=2.13,2.12,2.11 +defaultScalaVersion=2.13 runOnceTasks=clean,release org.gradle.java.installations.auto-download=false org.gradle.java.installations.fromEnv=JDK8,JDK11,JDK17,JDK21,JDK21_GRAALVM diff --git a/gradle/deploy.gradle b/gradle/deploy.gradle deleted file mode 100644 index c34f7bf9b71..00000000000 --- a/gradle/deploy.gradle +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -def utilProjects = project(":util").allprojects -def deployedProjects = subprojects - utilProjects - -configure(deployedProjects) { - - def isScala = project.name.contains('scala') - def hasAllScalaVersions = project.hasProperty('allScalaVersions') - def isInvalidScalaProject = false // isScala && !hasAllScalaVersions // TODO JAVA-3564 - - task publishSnapshots { - group = 'publishing' - description = 'Publishes snapshots to Sonatype' - - if ( version.endsWith('-SNAPSHOT')) { - if (isInvalidScalaProject) { - doFirst { - def cause = """ - | Not publishing all Scala versions: - | ================================= - | - | You must set the -PallScalaVersions flag when publishing - |""".stripMargin() - throw new GradleException(cause) - } - } else { - dependsOn tasks.withType(PublishToMavenRepository) - } - } - } - - task publishArchives { - group = 'publishing' - description = 'Publishes a release and uploads to Sonatype / Maven Central' - - def gitVersionMatch = project.gitVersion == version - - doFirst { - if (!gitVersionMatch) { - def cause = """ - | Version mismatch: - | ================= - | - | $version != $gitVersion - | - | The project version does not match the git tag. - |""".stripMargin() - throw new GradleException(cause) - } else if (isInvalidScalaProject) { - def cause = """ - | Not publishing all Scala versions: - | ================================= - | - | You must set the -PallScalaVersions flag when publishing - |""".stripMargin() - throw new GradleException(cause) - } else { - println("Publishing: ${project.name} : ${project.gitVersion}") - } - } - if (gitVersionMatch && !isInvalidScalaProject) { - dependsOn tasks.withType(PublishToMavenRepository) - } - } -} diff --git a/gradle/javaToolchain.gradle b/gradle/javaToolchain.gradle deleted file mode 100644 index f1c779dab33..00000000000 --- a/gradle/javaToolchain.gradle +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -final Integer DEFAULT_JDK_VERSION = 17 - -def javaMainProjects = subprojects - project(":util:taglets") - -allprojects { - - def javaVersion = (findProperty("javaVersion") ?: DEFAULT_JDK_VERSION.toString()).toInteger() - project.pluginManager.withPlugin("java") { - if (!project.pluginManager.hasPlugin("scala")) { - logger.info("Compiling ${project.name} using JDK${DEFAULT_JDK_VERSION}") - java { - toolchain { - languageVersion = JavaLanguageVersion.of(DEFAULT_JDK_VERSION) - } - } - } - } - project.pluginManager.withPlugin('org.graalvm.buildtools.native') { - def minRequiredGraalVMJavaVersion = 21 - // By configuring the toolchains for the `org.graalvm.buildtools.native` plugin - // conditionally, we avoid Gradle errors caused by it failing to locate an installed GraalVM - // for Java SE older than 21. One situation when this is relevant is building from an IDE, - // where the `DEFAULT_JDK_VERSION` is likely used. - if (javaVersion >= minRequiredGraalVMJavaVersion) { - def javaLanguageVersion = JavaLanguageVersion.of(javaVersion) - // `JvmVendorSpec.GRAAL_VM` matches only GraalVM Community (https://github.com/graalvm/graalvm-ce-builds/releases), - // and does not match any other GraalVM distribution. - // That is, Gradle fails to locate any other installed distribution of GraalVM. - // Furthermore, there is no other way to express via the Gradle toolchain functionality - // that GraalVM must be used. The documentation of the `org.graalvm.buildtools.native` plugin - // says the following about this limitation: - // "be aware that the toolchain detection cannot distinguish between GraalVM JDKs - // and standard JDKs without Native Image support: - // if you have both installed on the machine, Gradle may randomly pick one or the other". - // Fortunately, `JvmVendorSpec.GRAAL_VM` makes things less hideous than that. - // - // The documentation of the `org.graalvm.buildtools.native` plugin mentions - // the environment variable `GRAALVM_HOME` as an alternative to Gradle toolchain functionality. - // I was unable to find a way to stop relying on the toolchain specification requiring `JvmVendorSpec.GRAAL_VM` - // even with `GRAALVM_HOME`. - def graalVendor = JvmVendorSpec.GRAAL_VM - graalvmNative { - agent { - java { - toolchain { - languageVersion = javaLanguageVersion - vendor = graalVendor - } - } - } - binaries { - configureEach { - javaLauncher = javaToolchains.launcherFor { - languageVersion = javaLanguageVersion - vendor = graalVendor - } - } - } - } - } - } - - if (project == project(":bson-record-codec")) { - tasks.withType(JavaCompile) { - options.encoding = "UTF-8" - options.release.set(17) - } - } else if (project.name == 'graalvm-native-image-app') { - tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' - options.release.set(DEFAULT_JDK_VERSION) - } - } else if (project in javaMainProjects) { - tasks.withType(JavaCompile) { - options.encoding = "UTF-8" - options.release.set(8) - } - - // Work around for: https://github.com/gradle/gradle/issues/15703 - tasks.withType(GroovyCompile) { - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - } - } - - tasks.withType(Test) { - javaLauncher.set(javaToolchains.launcherFor { - languageVersion = JavaLanguageVersion.of(javaVersion) - }) - } - -} diff --git a/gradle/javadoc.gradle b/gradle/javadoc.gradle deleted file mode 100644 index b986747c647..00000000000 --- a/gradle/javadoc.gradle +++ /dev/null @@ -1,120 +0,0 @@ -import static org.gradle.util.CollectionUtils.single - -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -def projectNamesThatDoNotPublishJavaDocs =["driver-benchmarks", "driver-lambda", "driver-workload-executor", "graalvm-native-image-app", "util", - "spock", "taglets"] -def javaMainProjects = subprojects.findAll { !projectNamesThatDoNotPublishJavaDocs.contains(it.name) } - -task docs { - dependsOn javaMainProjects.collect { it.tasks.withType(Javadoc) + it.tasks.withType(ScalaDoc) } -} - -def buildDocsUrl(String version, String packageName) { - def docVersion = version.split('-').head() - def (major, minor, patch) = docVersion.split('\\.') - - docVersion = "${major}.${minor}" - if (version.contains("-SNAPSHOT") && patch == 0) { - // If a snapshot of the next minor version, set the version to the previous released version - docVersion = minor > 0 ? "${major}.${minor - 1}" : '4.0' - } - - ["http://mongodb.github.io/mongo-java-driver/$%7BdocVersion%7D/apidocs/$%7BpackageName%7D/", "${rootProject.buildDir.path}/docs/${packageName}"] -} - -def tagletsProject = project(':util:taglets') -subprojects { project -> - if (project in javaMainProjects) { - - tasks.withType(Javadoc) { - dependsOn tagletsProject.compileJava //We need taglets to be compiled - exclude "**/com/mongodb/**/benchmark/**" - exclude "**/com/mongodb/**/assertions/**" - exclude "**/com/mongodb/**/internal/**" - exclude "**/org/bson/**/internal/**" - options { - author = true - version = true - links = ['https://docs.oracle.com/en/java/javase/11/docs/api/', - 'https://www.reactive-streams.org/reactive-streams-1.0.3-javadoc/'] - tagletPath tagletsProject.sourceSets.main.output.classesDirs.head() - taglets 'AtlasManualTaglet' - taglets 'ManualTaglet' - taglets 'DochubTaglet' - taglets 'ServerReleaseTaglet' - encoding = 'UTF-8' - charSet 'UTF-8' - docEncoding 'UTF-8' - addBooleanOption("html5", true) - addBooleanOption("-allow-script-in-comments", true) - header = ''' - | '''.stripMargin() - } - - afterEvaluate { - destinationDir = new File(rootDir, "build/docs/${project.archivesBaseName}") - def version = project.version as String - if (project.name != 'bson') { - options.linksOffline(*buildDocsUrl(version, 'bson')) - if (project.name != 'driver-core') options.linksOffline(*buildDocsUrl(version, 'mongodb-driver-core')) - if (project.name == 'driver-legacy') { - dependsOn javaMainProjects.find({ it.name == 'driver-sync' }).javadoc - options.linksOffline(*buildDocsUrl(version, 'mongodb-driver-sync')) - } - } - } - } - } -} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000000..eab637a8b41 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,214 @@ +# Copyright 2008-present MongoDB, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +[versions] +aws-sdk-v1 = "1.12.782" +aws-sdk-v2 = "2.30.31" +graal-sdk = "24.0.0" +jna = "5.11.0" +jnr-unixsocket = "0.38.17" +netty-bom = "4.1.87.Final" +project-reactor-bom = "2022.0.0" +reactive-streams = "1.0.4" +snappy = "1.1.10.3" +zstd = "1.5.5-3" +jetbrains-annotations = "26.0.2" + +kotlin = "1.8.10" +kotlinx-coroutines-bom = "1.6.4" +kotlinx-datetime = "0.4.0" +kotlinx-serialization = "1.5.0" + +scala-v2-v13 = "2.13.16" +scala-v2-v12 = "2.12.20" +scala-v2-v11 = "2.11.12" + +# Test +assertj = "3.24.2" +aws-lambda-core = "1.2.2" +aws-lambda-events = "3.11.1" +cglib = "2.2.2" +classgraph = "4.8.154" +findbugs-jsr = "1.3.9" +groovy = "3.0.9" +hamcrest = "1.3" +jmh = "1.37" +junit-bom = "5.10.2" +logback = "1.3.14" +mockito = "5.11.0" +mockito-java8 = "4.6.1" +mockito-kotlin = "4.1.0" +objenesis = "1.3" +reflections = "0.9.10" +slf4j = "1.7.6" +spock-bom = "2.1-groovy-3.0" +scala-test = "3.2.18" +scala-test-plus = "3.2.18.0" + +# Plugins +plugin-bnd = "5.1.2" +plugin-build-config = "3.0.3" +plugin-detekt = "1.21.0" +plugin-dokka = "1.8.10" +plugin-download = "5.6.0" +plugin-graalvm = "0.9.23" +plugin-optional-base = "7.0.0" +plugin-shadow = "8.3.6" +plugin-spotbugs = "6.0.15" +plugin-spotless = "6.14.0" +plugin-test-logger = "4.0.0" + +[libraries] +aws-java-sdk-v1-core = { module = "com.amazonaws:aws-java-sdk-core", version.ref = "aws-sdk-v1" } +aws-java-sdk-v1-sts = { module = "com.amazonaws:aws-java-sdk-sts", version.ref = "aws-sdk-v1" } +aws-java-sdk-v2-auth = { module = "software.amazon.awssdk:auth", version.ref = "aws-sdk-v2" } +aws-java-sdk-v2-sts = { module = "software.amazon.awssdk:sts", version.ref = "aws-sdk-v2" } + +jna = { module = "net.java.dev.jna:jna", version.ref = "jna" } +jna-platform = { module = "net.java.dev.jna:jna-platform", version.ref = "jna" } +jnr-unixsocket = { module = "com.github.jnr:jnr-unixsocket", version.ref = "jnr-unixsocket" } +jetbrains-annotations = {module = "org.jetbrains:annotations", version.ref = "jetbrains-annotations" } + +netty-bom = { module = "io.netty:netty-bom", version.ref = "netty-bom" } +netty-buffer = { module = "io.netty:netty-buffer" } +netty-handler = { module = "io.netty:netty-handler" } +netty-transport = { module = "io.netty:netty-transport" } + +project-reactor-bom = { module = "io.projectreactor:reactor-bom", version.ref = "project-reactor-bom" } +project-reactor-core = { module = "io.projectreactor:reactor-core" } +reactive-streams = { module = " org.reactivestreams:reactive-streams", version.ref = "reactive-streams" } + +slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } +snappy-java = { module = "org.xerial.snappy:snappy-java", version.ref = "snappy" } +zstd-jni = { module = "com.github.luben:zstd-jni", version.ref = "zstd" } + +graal-sdk = { module = "org.graalvm.sdk:graal-sdk", version.ref = "graal-sdk" } +graal-sdk-nativeimage = { module = "org.graalvm.sdk:nativeimage", version.ref = "graal-sdk" } + +kotlin-bom = { module = "org.jetbrains.kotlin:kotlin-bom" } +kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" } +kotlinx-coroutines-bom = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-bom", version.ref = "kotlinx-coroutines-bom" } +kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core" } +kotlinx-coroutines-reactive = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-reactive" } +kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect" } +kotlinx-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-bom", version.ref = "kotlinx-serialization" } +kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core" } +kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json" } +kotlinx-serialization-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" } + +scala-library-v2-v13 = { module = "org.scala-lang:scala-library", version.ref = "scala-v2-v13" } +scala-reflect-v2-v13 = { module = "org.scala-lang:scala-reflect", version.ref = "scala-v2-v13" } + +scala-library-v2-v12 = { module = "org.scala-lang:scala-library", version.ref = "scala-v2-v12" } +scala-reflect-v2-v12 = { module = "org.scala-lang:scala-reflect", version.ref = "scala-v2-v12" } + +scala-library-v2-v11 = { module = "org.scala-lang:scala-library", version.ref = "scala-v2-v11" } +scala-reflect-v2-v11 = { module = "org.scala-lang:scala-reflect", version.ref = "scala-v2-v11" } + +# Test +jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "jmh"} +jmh-generator-annprocess = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "jmh"} + +junit-bom = { module = "org.junit:junit-bom", version.ref = "junit-bom" } +junit-jupiter = { module = "org.junit.jupiter:junit-jupiter" } +junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params" } +junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" } +junit-vintage-engine = { module = "org.junit.vintage:junit-vintage-engine" } +junit-kotlin = { module = "org.jetbrains.kotlin:kotlin-test-junit5" } + +spock-bom = { module = "org.spockframework:spock-bom", version.ref = "spock-bom" } +spock-core = { module = "org.spockframework:spock-core" } +spock-junit4 = { module = "org.spockframework:spock-junit4" } + +mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" } +mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" } +mockito-junit-jupiter-java8 = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito-java8" } +mockito-core-java8 = { module = "org.mockito:mockito-core", version.ref = "mockito-java8" } +mockito-inline-java8 = { module = "org.mockito:mockito-inline", version.ref = "mockito-java8" } +mockito-kotlin = { module = "org.mockito.kotlin:mockito-kotlin", version.ref = "mockito-kotlin" } + + +scala-test-flatspec-v2-v13 = { module = "org.scalatest:scalatest-flatspec_2.13", version.ref = "scala-test" } +scala-test-shouldmatchers-v2-v13 = { module = "org.scalatest:scalatest-shouldmatchers_2.13", version.ref = "scala-test" } +scala-test-mockito-v2-v13 = { module = "org.scalatestplus:mockito-4-11_2.13", version.ref = "scala-test-plus" } +scala-test-junit-runner-v2-v13 = { module = "org.scalatestplus:junit-5-10_2.13", version.ref = "scala-test-plus" } + +scala-test-flatspec-v2-v12 = { module = "org.scalatest:scalatest-flatspec_2.12", version.ref = "scala-test" } +scala-test-shouldmatchers-v2-v12 = { module = "org.scalatest:scalatest-shouldmatchers_2.12", version.ref = "scala-test" } +scala-test-mockito-v2-v12 = { module = "org.scalatestplus:mockito-4-11_2.12", version.ref = "scala-test-plus" } +scala-test-junit-runner-v2-v12 = { module = "org.scalatestplus:junit-5-10_2.12", version.ref = "scala-test-plus" } + +scala-test-flatspec-v2-v11 = { module = "org.scalatest:scalatest-flatspec_2.11", version.ref = "scala-test" } +scala-test-shouldmatchers-v2-v11 = { module = "org.scalatest:scalatest-shouldmatchers_2.11", version.ref = "scala-test" } +scala-test-mockito-v2-v11 = { module = "org.scalatestplus:mockito-4-11_2.11", version.ref = "scala-test-plus" } +scala-test-junit-runner-v2-v11 = { module = "org.scalatestplus:junit-5-10_2.11", version.ref = "scala-test-plus" } + +kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test" } + +assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" } +aws-lambda-core = { module = " com.amazonaws:aws-lambda-java-core", version.ref = "aws-lambda-core" } +aws-lambda-events = { module = " com.amazonaws:aws-lambda-java-events", version.ref = "aws-lambda-events" } +cglib = { module = "cglib:cglib-nodep", version.ref = "cglib" } +classgraph = { module = "io.github.classgraph:classgraph", version.ref = "classgraph" } +findbugs-jsr = { module = "com.google.code.findbugs:jsr305", version.ref = "findbugs-jsr" } +groovy = { module = "org.codehaus.groovy:groovy-all", version.ref = "groovy" } +hamcrest-all = { module = "org.hamcrest:hamcrest-all", version.ref = "hamcrest" } +logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } +netty-tcnative-boringssl-static = { module = "io.netty:netty-tcnative-boringssl-static" } +objenesis = { module = "org.objenesis:objenesis", version.ref = "objenesis" } +project-reactor-test = { module = "io.projectreactor:reactor-test" } +reactive-streams-tck = { module = " org.reactivestreams:reactive-streams-tck", version.ref = "reactive-streams" } +reflections = { module = "org.reflections:reflections", version.ref = "reflections" } + + +[bundles] +aws-java-sdk-v1 = ["aws-java-sdk-v1-core", "aws-java-sdk-v1-sts"] +aws-java-sdk-v2 = ["aws-java-sdk-v2-auth", "aws-java-sdk-v2-sts"] +netty = ["netty-buffer", "netty-handler", "netty-transport"] + +scala-v2-v13 = ["scala-library-v2-v13", "scala-reflect-v2-v13"] +scala-v2-v12 = ["scala-library-v2-v12", "scala-reflect-v2-v12"] +scala-v2-v11 = ["scala-library-v2-v11", "scala-reflect-v2-v11"] + +# Test +junit = ["junit-jupiter", "junit-jupiter-params", "junit-jupiter-engine", "logback-classic", "hamcrest-all"] +junit-vintage = ["junit-vintage-engine", "junit-jupiter-params", "junit-jupiter-engine", "logback-classic", "hamcrest-all"] +spock = ["spock-core", "spock-junit4"] + +mockito = ["mockito-junit-jupiter", "mockito-core"] +mockito-java8 = ["mockito-junit-jupiter-java8", "mockito-core-java8", "mockito-inline-java8"] +mockito-kotlin = ["mockito-kotlin", "mockito-junit-jupiter-java8"] + +scala-test-v2-v13 = ["scala-test-flatspec-v2-v13", "scala-test-shouldmatchers-v2-v13", "scala-test-mockito-v2-v13", + "scala-test-junit-runner-v2-v13", "reflections"] +scala-test-v2-v12 = ["scala-test-flatspec-v2-v12", "scala-test-shouldmatchers-v2-v12", "scala-test-mockito-v2-v12", + "scala-test-junit-runner-v2-v12", "reflections"] +scala-test-v2-v11 = ["scala-test-flatspec-v2-v11", "scala-test-shouldmatchers-v2-v11", "scala-test-mockito-v2-v11", + "scala-test-junit-runner-v2-v11", "reflections"] + +[plugins] +kotlin-gradle = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +bnd = { id = "biz.aQute.bnd", version.ref = "plugin-bnd" } +build-config = { id = "com.github.gmazzo.buildconfig", version.ref = "plugin-build-config" } +detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "plugin-detekt" } +dokka = { id = "org.jetbrains.dokka", version.ref = "plugin-dokka" } +download = { id = "de.undercouch.download", version.ref = "plugin-download" } +graalvm-buildtools = { id = "org.graalvm.buildtools.native", version.ref = "plugin-graalvm" } +kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } +optional = { id = "nebula.optional-base", version.ref = "plugin-optional-base" } +shadow = { id = "com.gradleup.shadow", version.ref = "plugin-shadow" } +spotbugs = { id = "com.github.spotbugs", version.ref = "plugin-spotbugs" } +spotless = { id = "com.diffplug.spotless", version.ref = "plugin-spotless" } +test-logger = { id = "com.adarshr.test-logger", version.ref = "plugin-test-logger" } diff --git a/gradle/publish.gradle b/gradle/publish.gradle deleted file mode 100644 index fa56f09f138..00000000000 --- a/gradle/publish.gradle +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Configures publishing of the main java projects - */ - -// Publishing helpers -ext { - configurePom = { project -> - { -> - name = project.hasProperty('pomName') ? project.getProperty('pomName') : project.name - description = project.description - url = project.hasProperty('pomURL') ? project.getProperty('pomURL') : 'https://www.mongodb.com/' - licenses { - license { - name = 'The Apache License, Version 2.0' - url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - scm { - url = 'https://github.com/mongodb/mongo-java-driver' - connection = 'scm:https://github.com/mongodb/mongo-java-driver.git' - developerConnection = 'scm:git@github.com:mongodb/mongo-java-driver.git' - } - developers { - developer { - name = 'Various' - organization = 'MongoDB' - } - } - } - } - configureMavenRepositories = { project -> - { -> - def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' - def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' - maven { - url = project.version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - credentials { - username project.hasProperty('nexusUsername') ? project.getProperty('nexusUsername') : '' - password project.hasProperty('nexusPassword') ? project.getProperty('nexusPassword') : '' - } - } - - maven { - url = "$rootDir/build/repo" - } - } - } - configureJarManifestAttributes = { project -> - { -> - manifest.attributes['-exportcontents'] = "*;-noimport:=true" - manifest.attributes['Build-Version'] = project.gitVersion - manifest.attributes['Bundle-Version'] = project.version - manifest.attributes['Bundle-Name'] = project.archivesBaseName - manifest.attributes['Bundle-SymbolicName'] = project.group + '.' + project.archivesBaseName - } - } -} - - -def projectNamesNotToBePublished = ["driver-benchmarks", "driver-lambda", "driver-workload-executor", "graalvm-native-image-app", "util", - "spock", "taglets"] -def publishedProjects = subprojects.findAll { !projectNamesNotToBePublished.contains(it.name) } -def bomProjects = project(":bom") -def scalaProjects = publishedProjects.findAll { it.name.contains('scala') } - bomProjects -def javaProjects = publishedProjects - scalaProjects - bomProjects -def projectsWithManifest = publishedProjects.findAll {it.name != 'driver-legacy' } - bomProjects - -configure(javaProjects) { project -> - apply plugin: 'maven-publish' - apply plugin: 'signing' - - task sourcesJar(type: Jar) { - from project.sourceSets.main.allJava - classifier = 'sources' - } - - task javadocJar(type: Jar) { - from javadoc - classifier = 'javadoc' - } - - publishing { - publications { - mavenJava(MavenPublication) { - artifactId = project.archivesBaseName - from project.components.java - artifact sourcesJar - artifact javadocJar - - suppressPomMetadataWarningsFor("dateTimeSupportApiElements") - suppressPomMetadataWarningsFor("dateTimeSupportRuntimeElements") - - suppressPomMetadataWarningsFor("jsonSupportApiElements") - suppressPomMetadataWarningsFor("jsonSupportRuntimeElements") - - suppressPomMetadataWarningsFor("mongoCryptSupportApiElements") - suppressPomMetadataWarningsFor("mongoCryptSupportRuntimeElements") - } - } - - repositories configureMavenRepositories(project) - } - - afterEvaluate { - publishing.publications.mavenJava.artifactId = project.archivesBaseName - publishing.publications.mavenJava.pom configurePom(project) - signing { - useInMemoryPgpKeys(findProperty("signingKey"), findProperty("signingPassword")) - sign publishing.publications.mavenJava - } - } -} - -configure(scalaProjects) { project -> - apply plugin: 'maven-publish' - apply plugin: 'signing' - - task sourcesJar(type: Jar) { - from project.sourceSets.main.allScala - classifier = 'sources' - } - - task scaladocJar(type: Jar) { - from scaladoc - classifier = 'javadoc' - } - - publishing { - publications { - mavenJava(MavenPublication) { - artifactId = project.archivesBaseName.contains('bson') ? 'mongo-scala-bson' : 'mongo-scala-driver' - from project.components.java - artifact sourcesJar - artifact scaladocJar - } - } - - repositories configureMavenRepositories(project) - } - - afterEvaluate { - publishing.publications.mavenJava.pom configurePom(project) - signing { - useInMemoryPgpKeys(findProperty("signingKey"), findProperty("signingPassword")) - sign publishing.publications.mavenJava - } - } -} - - -configure(projectsWithManifest) { project -> - apply plugin: 'biz.aQute.bnd.builder' - afterEvaluate { - jar configureJarManifestAttributes(project) - } -} - -configure(bomProjects) { project -> - apply plugin: 'maven-publish' - apply plugin: 'signing' - apply plugin: 'java-platform' - - // Get the Scala versions from the project property. Only major.minor versions. - def scalaVersions = project.findProperty("scalaVersions")?.split(",") - ?.collect { it.split("\\.")[0] + "." + it.split("\\.")[1] } - - assert scalaVersions != null && !scalaVersions.isEmpty() : "Scala versions must be provided as a comma-separated list" + - " in the 'scalaVersions' project property" - - publishing { - publications { - mavenJava(MavenPublication) { - artifactId = "bom".equals(project.archivesBaseName) ? "mongodb-driver-bom" : project.archivesBaseName - from components.javaPlatform - - // Modify the generated POM to add multiple compile versions of driver-scala or bson-scala. - // Scala multi-version support generates only one for BOM. - pom.withXml { - def pomXml = asNode() - - def dependencyManagementNode = pomXml.get("dependencyManagement")?.getAt(0) - assert dependencyManagementNode : " node not found in the generated BOM POM" - - def dependenciesNode = dependencyManagementNode.get("dependencies")?.getAt(0) - assert dependenciesNode : " node not found inside " - - // Check if scala dependencies are present in the BOM. - def existingScalaDeps = dependenciesNode.children().findAll { - it.artifactId.text().contains("scala") - } - - existingScalaDeps.each { existingDep -> - String groupId = existingDep.groupId.text() - String originalArtifactId = existingDep.artifactId.text() - String artifactVersion = existingDep.version.text() - - // Add multiple versions with Scala suffixes for each Scala-related dependency. - scalaVersions.each { scalaVersion -> - // Remove existing Scala version suffix (_2.12, _2.13, etc.) - String baseArtifactId = originalArtifactId.replaceAll("_\\d+\\.\\d+(\\.\\d+)?\$", "") - String newArtifactId = "${baseArtifactId}_${scalaVersion}" - - // Skip if Scala dependency with this scalaVersion already exists in BOM. - if(newArtifactId != originalArtifactId) { - def dependencyNode = dependenciesNode.appendNode("dependency") - dependencyNode.appendNode("groupId", groupId) - dependencyNode.appendNode("artifactId", newArtifactId) - dependencyNode.appendNode("version", artifactVersion) - } - } - } - } - } - } - - repositories configureMavenRepositories(project) - } - - afterEvaluate { - publishing.publications.mavenJava.pom configurePom(project) - signing { - useInMemoryPgpKeys(findProperty("signingKey"), findProperty("signingPassword")) - sign publishing.publications.mavenJava - } - } - - tasks.withType(GenerateModuleMetadata) { - enabled = false - } - - tasks.withType(GenerateMavenPom).configureEach { - doLast { - def xml = file(destination).text - def root = new groovy.xml.XmlSlurper().parseText(xml) - - def dependencies = root.dependencyManagement.dependencies.children() - assert dependencies.children().size() > 1 : "BOM must contain more then one element:\n$destination" - - dependencies.each { dependency -> - def groupId = dependency.groupId.text() - assert groupId.startsWith('org.mongodb') : "BOM must contain only 'org.mongodb' dependencies, but found '$groupId':\n$destination" - /* The and tags should be omitted in BOM dependencies. - This ensures that consuming projects have the flexibility to decide whether a - dependency is optional in their context. The BOM's role is to provide version information, - not to dictate inclusion or exclusion of dependencies. */ - assert dependency.scope.size() == 0 : "BOM must not contain elements in dependency:\n$destination" - assert dependency.optional.size() == 0 : "BOM must not contain elements in dependency:\n$destination" - } - } - } -} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c023e..afba109285a 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e750102e092..9bf7bd33972 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip +networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 4f906e0c811..65dcd68d65c 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,105 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 107acd32c4e..93e3f59f135 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,8 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/mongodb-crypt/build.gradle.kts b/mongodb-crypt/build.gradle.kts index 72d7fd47292..464c32c16a8 100644 --- a/mongodb-crypt/build.gradle.kts +++ b/mongodb-crypt/build.gradle.kts @@ -12,50 +12,44 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ - +import ProjectExtensions.configureJarManifest +import ProjectExtensions.configureMavenPublication import de.undercouch.gradle.tasks.download.Download -buildscript { - repositories { - mavenCentral() - google() - } - dependencies { - "classpath"(group = "net.java.dev.jna", name = "jna", version = "5.11.0") - } -} - plugins { - // Needed to download libmongocrypt from s3. - id("de.undercouch.download") version "5.6.0" -} - -group = "org.mongodb" -base.archivesName.set("mongodb-crypt") -description = "MongoDB client-side crypto support" -ext.set("pomName", "MongoCrypt") - -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + id("project.java") + alias(libs.plugins.download) } dependencies { api(project(path = ":bson", configuration = "default")) - api("net.java.dev.jna:jna:5.11.0") + api(libs.jna) +} - // Tests - testImplementation("org.junit.jupiter:junit-jupiter") +configureMavenPublication { + pom { + name.set("MongoCrypt") + description.set("MongoDB client-side crypto support") + } +} + +configureJarManifest { + attributes["Automatic-Module-Name"] = "com.mongodb.crypt.capi" + attributes["Bundle-Name"] = "MongoCrypt" + attributes["Bundle-SymbolicName"] = "com.mongodb.crypt.capi" + attributes["Import-Package"] = "org.slf4j.*;resolution:=optional,org.bson.*" + attributes["-exportcontents"] = "com.mongodb.*;-noimport:=true" + attributes["Private-Package"] = "" } /* * Jna copy or download resources */ -val jnaDownloadsDir = "$buildDir/jnaLibs/downloads/" -val jnaResourcesDir = "$buildDir/jnaLibs/resources/" -val jnaLibPlatform: String = if (com.sun.jna.Platform.RESOURCE_PREFIX.startsWith("darwin")) "darwin" else com.sun.jna.Platform.RESOURCE_PREFIX +val jnaDownloadsDir = rootProject.file("build/jnaLibs/downloads/").path +val jnaResourcesDir = rootProject.file("build/jnaLibs/resources/").path +val jnaLibPlatform: String = + if (com.sun.jna.Platform.RESOURCE_PREFIX.startsWith("darwin")) "darwin" else com.sun.jna.Platform.RESOURCE_PREFIX val jnaLibsPath: String = System.getProperty("jnaLibsPath", "${jnaResourcesDir}${jnaLibPlatform}") val jnaResources: String = System.getProperty("jna.library.path", jnaLibsPath) @@ -70,26 +64,19 @@ val binariesArchiveName = "libmongocrypt-java.tar.gz" */ val localBinariesArchiveName = "libmongocrypt-java-$downloadRevision.tar.gz" -val downloadUrl: String = "https://mciuploads.s3.amazonaws.com/libmongocrypt/java/$downloadRevision/$binariesArchiveName" - -val jnaMapping: Map = mapOf( - "rhel-62-64-bit" to "linux-x86-64", - "rhel72-zseries-test" to "linux-s390x", - "rhel-71-ppc64el" to "linux-ppc64le", - "ubuntu1604-arm64" to "linux-aarch64", - "windows-test" to "win32-x86-64", - "macos" to "darwin" -) - -sourceSets { - main { - java { - resources { - srcDirs(jnaResourcesDir) - } - } - } -} +val downloadUrl: String = + "https://mciuploads.s3.amazonaws.com/libmongocrypt/java/$downloadRevision/$binariesArchiveName" + +val jnaMapping: Map = + mapOf( + "rhel-62-64-bit" to "linux-x86-64", + "rhel72-zseries-test" to "linux-s390x", + "rhel-71-ppc64el" to "linux-ppc64le", + "ubuntu1604-arm64" to "linux-aarch64", + "windows-test" to "win32-x86-64", + "macos" to "darwin") + +sourceSets { main { java { resources { srcDirs(jnaResourcesDir) } } } } tasks.register("downloadJava") { src(downloadUrl) @@ -101,57 +88,49 @@ tasks.register("downloadJava") { tasks.register("unzipJava") { /* - Clean up the directory first if the task is not UP-TO-DATE. - This can happen if the download revision has been changed and the archive is downloaded again. - */ + Clean up the directory first if the task is not UP-TO-DATE. + This can happen if the download revision has been changed and the archive is downloaded again. + */ doFirst { println("Cleaning up $jnaResourcesDir") delete(jnaResourcesDir) } from(tarTree(resources.gzip("${jnaDownloadsDir}/$localBinariesArchiveName"))) - include(jnaMapping.keys.flatMap { - listOf("${it}/nocrypto/**/libmongocrypt.so", "${it}/lib/**/libmongocrypt.dylib", "${it}/bin/**/mongocrypt.dll" ) - }) - eachFile { - path = "${jnaMapping[path.substringBefore("/")]}/${name}" - } + include( + jnaMapping.keys.flatMap { + listOf( + "${it}/nocrypto/**/libmongocrypt.so", "${it}/lib/**/libmongocrypt.dylib", "${it}/bin/**/mongocrypt.dll") + }) + eachFile { path = "${jnaMapping[path.substringBefore("/")]}/${name}" } into(jnaResourcesDir) dependsOn("downloadJava") - doLast { - println("jna.library.path contents: \n ${fileTree(jnaResourcesDir).files.joinToString(",\n ")}") - } + doLast { println("jna.library.path contents: \n ${fileTree(jnaResourcesDir).files.joinToString(",\n ")}") } } -// The `processResources` task (defined by the `java-library` plug-in) consumes files in the main source set. +// The `processResources` task (defined by the `java-library` plug-in) consumes files in the main +// source set. // Add a dependency on `unzipJava`. `unzipJava` adds libmongocrypt libraries to the main source set. -tasks.processResources { - mustRunAfter(tasks.named("unzipJava")) -} +tasks.processResources { mustRunAfter(tasks.named("unzipJava")) } -tasks.register("downloadJnaLibs") { - dependsOn("downloadJava", "unzipJava") -} +tasks.register("downloadJnaLibs") { dependsOn("downloadJava", "unzipJava") } tasks.test { systemProperty("jna.debug_load", "true") systemProperty("jna.library.path", jnaResources) useJUnitPlatform() - testLogging { - events("passed", "skipped", "failed") - } + testLogging { events("passed", "skipped", "failed") } doFirst { println("jna.library.path contents:") - println(fileTree(jnaResources) { - this.setIncludes(listOf("*.*")) - }.files.joinToString(",\n ", " ")) + println(fileTree(jnaResources) { this.setIncludes(listOf("*.*")) }.files.joinToString(",\n ", " ")) } dependsOn("downloadJnaLibs", "downloadJava", "unzipJava") } tasks.withType { - description = """$description + description = + """$description | System properties: | ================= | @@ -160,28 +139,7 @@ tasks.withType { """.trimMargin() } -tasks.jar { - //NOTE this enables depending on the mongocrypt from driver-core - dependsOn("downloadJnaLibs") -} - -tasks.javadoc { - if (JavaVersion.current().isJava9Compatible) { - (options as StandardJavadocDocletOptions).addBooleanOption("html5", true) - } -} - -afterEvaluate { - tasks.jar { - manifest { - attributes( - "-exportcontents" to "com.mongodb.*;-noimport:=true", - "Automatic-Module-Name" to "com.mongodb.crypt.capi", - "Import-Package" to "org.slf4j.*;resolution:=optional,org.bson.*", - "Bundle-Name" to "MongoCrypt", - "Bundle-SymbolicName" to "com.mongodb.crypt.capi", - "Private-Package" to "" - ) - } - } +tasks.withType { + // NOTE this enables depending on the mongocrypt from driver-core + dependsOn("downloadJnaLibs") } diff --git a/mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/CAPI.java b/mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/CAPI.java index 075bbe15c9c..34a102fbdeb 100644 --- a/mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/CAPI.java +++ b/mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/CAPI.java @@ -486,6 +486,17 @@ public interface mongocrypt_random_fn extends Callback { public static native void mongocrypt_setopt_bypass_query_analysis (mongocrypt_t crypt); + /** + * Set the expiration time for the data encryption key cache. Defaults to 60 seconds if not set. + * + * @param crypt The @ref mongocrypt_t object to update + * @param cache_expiration_ms if 0 the cache never expires + * @return A boolean indicating success. If false, an error status is set. + * @since 5.4 + */ + public static native boolean + mongocrypt_setopt_key_expiration (mongocrypt_t crypt, long cache_expiration_ms); + /** * Opt-into enabling sending multiple collection info documents. * diff --git a/mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/MongoCryptImpl.java b/mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/MongoCryptImpl.java index d365f7f7671..4f131f5d4e9 100644 --- a/mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/MongoCryptImpl.java +++ b/mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/MongoCryptImpl.java @@ -67,6 +67,7 @@ import static com.mongodb.internal.crypt.capi.CAPI.mongocrypt_setopt_crypto_hooks; import static com.mongodb.internal.crypt.capi.CAPI.mongocrypt_setopt_enable_multiple_collinfo; import static com.mongodb.internal.crypt.capi.CAPI.mongocrypt_setopt_encrypted_field_config_map; +import static com.mongodb.internal.crypt.capi.CAPI.mongocrypt_setopt_key_expiration; import static com.mongodb.internal.crypt.capi.CAPI.mongocrypt_setopt_kms_provider_aws; import static com.mongodb.internal.crypt.capi.CAPI.mongocrypt_setopt_kms_provider_local; import static com.mongodb.internal.crypt.capi.CAPI.mongocrypt_setopt_kms_providers; @@ -194,6 +195,11 @@ class MongoCryptImpl implements MongoCrypt { mongocrypt_setopt_bypass_query_analysis(wrapped); } + Long keyExpirationMS = options.getKeyExpirationMS(); + if (keyExpirationMS != null) { + configure(() -> mongocrypt_setopt_key_expiration(wrapped, keyExpirationMS)); + } + if (options.getEncryptedFieldsMap() != null) { BsonDocument localEncryptedFieldsMap = new BsonDocument(); localEncryptedFieldsMap.putAll(options.getEncryptedFieldsMap()); diff --git a/mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/MongoCryptOptions.java b/mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/MongoCryptOptions.java index 46c9898a9a1..782e278e7c8 100644 --- a/mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/MongoCryptOptions.java +++ b/mongodb-crypt/src/main/com/mongodb/internal/crypt/capi/MongoCryptOptions.java @@ -39,6 +39,7 @@ public final class MongoCryptOptions { private final BsonDocument extraOptions; private final boolean bypassQueryAnalysis; private final List searchPaths; + private final Long keyExpirationMS; /** @@ -135,6 +136,19 @@ public List getSearchPaths() { return searchPaths; } + /** + * Returns the cache expiration time for data encryption keys. + * + *

Defaults to {@code null} which defers to libmongocrypt's default which is currently {@code 60000 ms}. + * Set to {@code 0} to disable key expiration.

+ * + * @return the cache expiration time or null if not set. + * @since 5.5 + */ + public Long getKeyExpirationMS() { + return keyExpirationMS; + } + /** * The builder for the options */ @@ -148,6 +162,7 @@ public static final class Builder { private boolean bypassQueryAnalysis; private BsonDocument extraOptions = new BsonDocument(); private List searchPaths = emptyList(); + private Long keyExpirationMS = null; private Builder() { } @@ -258,6 +273,18 @@ public Builder searchPaths(final List searchPaths) { return this; } + /** + * The cache expiration time for data encryption keys. + * + * @param keyExpirationMS the cache expiration time in milliseconds or null to use libmongocrypt's default. + * @return this + * @since 5.5 + */ + public Builder keyExpirationMS(final Long keyExpirationMS) { + this.keyExpirationMS = keyExpirationMS; + return this; + } + /** * Build the options. * @@ -281,5 +308,6 @@ private MongoCryptOptions(final Builder builder) { this.bypassQueryAnalysis = builder.bypassQueryAnalysis; this.extraOptions = builder.extraOptions; this.searchPaths = builder.searchPaths; + this.keyExpirationMS = builder.keyExpirationMS; } } diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index e390791d5d5..00000000000 --- a/settings.gradle +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2008-present MongoDB, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -include ':bson' -include ':bson-record-codec' -include ':driver-benchmarks' -include ':driver-workload-executor' -include ':driver-lambda' -include ':driver-core' -include ':driver-legacy' -include ':driver-sync' -include ':driver-reactive-streams' -include ':bson-kotlin' -include ':bson-kotlinx' -include ':driver-kotlin-extensions' -include ':driver-kotlin-sync' -include ':driver-kotlin-coroutine' -include ':bson-scala' -include ':driver-scala' -include ':mongodb-crypt' -include 'util:spock' -include 'util:taglets' -include ':bom' - -if(hasProperty("includeGraalvm")) { - include ':graalvm-native-image-app' -} diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000000..019d3b8290d --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,49 @@ +/* + * Copyright 2008-present MongoDB, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } +} + +include(":bom") + +include(":bson") +include(":bson-kotlin") +include(":bson-kotlinx") +include(":bson-record-codec") +include(":bson-scala") + +include(":driver-core") +include(":driver-sync") +include(":driver-legacy") +include(":driver-reactive-streams") +include(":mongodb-crypt") + +include(":driver-kotlin-coroutine") +include(":driver-kotlin-extensions") +include(":driver-kotlin-sync") +include(":driver-scala") + +include(":driver-benchmarks") +include(":driver-lambda") +include(":driver-workload-executor") +if (providers.gradleProperty("includeGraalvm").isPresent) { + include(":graalvm-native-image-app") +} diff --git a/util/spock/src/main/util/spock/annotations/Slow.java b/util/spock/src/main/util/spock/annotations/Slow.java deleted file mode 100644 index c3611cbb22b..00000000000 --- a/util/spock/src/main/util/spock/annotations/Slow.java +++ /dev/null @@ -1,11 +0,0 @@ -package util.spock.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD, ElementType.TYPE}) -public @interface Slow { -}