diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2022-05-09 15:29:29 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-10 18:29:25 +0000 |
commit | 4b8e74e9f93108ef05f7c178ad65b0f382ebaa02 (patch) | |
tree | 74ac567d234ff238bde3adbaaeb38fef01299204 | |
parent | a88f6f47d29603ebf7cbd3ddf65b212528c89b63 (diff) | |
download | mongo-4b8e74e9f93108ef05f7c178ad65b0f382ebaa02.tar.gz |
SERVER-65503 Migrate FLE2 tests to core passthrough suites
(cherry picked from commit 5325fff3f096116b0f2a5054b92f148cb8a6d415)
52 files changed, 191 insertions, 24 deletions
diff --git a/buildscripts/resmokeconfig/suites/causally_consistent_hedged_reads_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/causally_consistent_hedged_reads_jscore_passthrough.yml index beea3ff4cb4..51fc059280b 100644 --- a/buildscripts/resmokeconfig/suites/causally_consistent_hedged_reads_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/causally_consistent_hedged_reads_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Don't run these tests as transactions can only run on primaries. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/causally_consistent_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/causally_consistent_jscore_passthrough.yml index 0222daf309d..bd3c506aac3 100644 --- a/buildscripts/resmokeconfig/suites/causally_consistent_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/causally_consistent_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests are run in causally_consistent_jscore_txns_passthrough.yml. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/causally_consistent_jscore_passthrough_auth.yml b/buildscripts/resmokeconfig/suites/causally_consistent_jscore_passthrough_auth.yml index 31395a17d6e..e7df5e03f43 100644 --- a/buildscripts/resmokeconfig/suites/causally_consistent_jscore_passthrough_auth.yml +++ b/buildscripts/resmokeconfig/suites/causally_consistent_jscore_passthrough_auth.yml @@ -12,6 +12,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: - jstests/core/txns/**/*.js # Skip any tests that run with auth explicitly. diff --git a/buildscripts/resmokeconfig/suites/causally_consistent_read_concern_snapshot_passthrough.yml b/buildscripts/resmokeconfig/suites/causally_consistent_read_concern_snapshot_passthrough.yml index d58f0af77bb..85fde91a162 100644 --- a/buildscripts/resmokeconfig/suites/causally_consistent_read_concern_snapshot_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/causally_consistent_read_concern_snapshot_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Only the first command in a transaction allows readConcern and this suite only tests # non-transaction snapshot reads. diff --git a/buildscripts/resmokeconfig/suites/change_streams_downgrade.yml b/buildscripts/resmokeconfig/suites/change_streams_downgrade.yml index a5e5485e46d..e172efdc0e2 100644 --- a/buildscripts/resmokeconfig/suites/change_streams_downgrade.yml +++ b/buildscripts/resmokeconfig/suites/change_streams_downgrade.yml @@ -4,6 +4,8 @@ test_kind: multi_stmt_txn_passthrough selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests run in the jscore_txn passthrough suites. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/clustered_collection_passthrough.yml b/buildscripts/resmokeconfig/suites/clustered_collection_passthrough.yml index 8cf08476490..cb9f747aebb 100644 --- a/buildscripts/resmokeconfig/suites/clustered_collection_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/clustered_collection_passthrough.yml @@ -5,6 +5,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Assumes the _id index is real. diff --git a/buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml index 23a4531ca12..09b0a6f7ece 100755 --- a/buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml @@ -6,6 +6,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js - jstests/core_standalone/**/*.js exclude_files: # Transactions are not supported on MongoDB standalone nodes, so we do not run these tests in the diff --git a/buildscripts/resmokeconfig/suites/cwrwc_rc_majority_passthrough.yml b/buildscripts/resmokeconfig/suites/cwrwc_rc_majority_passthrough.yml index 0e122cc581d..722dc69aaf8 100644 --- a/buildscripts/resmokeconfig/suites/cwrwc_rc_majority_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/cwrwc_rc_majority_passthrough.yml @@ -6,6 +6,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions only a readConcern argument on the first command. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/logical_session_cache_replication_100ms_refresh_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/logical_session_cache_replication_100ms_refresh_jscore_passthrough.yml index 33c9265d296..0194d0b5a60 100644 --- a/buildscripts/resmokeconfig/suites/logical_session_cache_replication_100ms_refresh_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/logical_session_cache_replication_100ms_refresh_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # The set_param1.js test attempts to compare the response from running the {getParameter: "*"} # command multiple times, which may observe the change to the "transactionLifetimeLimitSeconds" diff --git a/buildscripts/resmokeconfig/suites/logical_session_cache_replication_10sec_refresh_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/logical_session_cache_replication_10sec_refresh_jscore_passthrough.yml index d6b2631c725..47213b4a54c 100644 --- a/buildscripts/resmokeconfig/suites/logical_session_cache_replication_10sec_refresh_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/logical_session_cache_replication_10sec_refresh_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # The set_param1.js test attempts to compare the response from running the {getParameter: "*"} # command multiple times, which may observe the change to the "transactionLifetimeLimitSeconds" diff --git a/buildscripts/resmokeconfig/suites/logical_session_cache_replication_1sec_refresh_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/logical_session_cache_replication_1sec_refresh_jscore_passthrough.yml index 13a791cb06b..348d549df2f 100644 --- a/buildscripts/resmokeconfig/suites/logical_session_cache_replication_1sec_refresh_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/logical_session_cache_replication_1sec_refresh_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # The set_param1.js test attempts to compare the response from running the {getParameter: "*"} # command multiple times, which may observe the change to the "transactionLifetimeLimitSeconds" diff --git a/buildscripts/resmokeconfig/suites/logical_session_cache_replication_default_refresh_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/logical_session_cache_replication_default_refresh_jscore_passthrough.yml index 12d66ccec64..4f1d19d2d48 100644 --- a/buildscripts/resmokeconfig/suites/logical_session_cache_replication_default_refresh_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/logical_session_cache_replication_default_refresh_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # The set_param1.js test attempts to compare the response from running the {getParameter: "*"} # command multiple times, which may observe the change to the "transactionLifetimeLimitSeconds" diff --git a/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_100ms_refresh_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_100ms_refresh_jscore_passthrough.yml index 7c05ae51d90..d633a55e6f7 100644 --- a/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_100ms_refresh_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_100ms_refresh_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests are run in logical_session_cache_sharding_100ms_refresh_jscore_txns_passthrough.yml. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_10sec_refresh_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_10sec_refresh_jscore_passthrough.yml index 63abcae2cf1..887ef290c4c 100644 --- a/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_10sec_refresh_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_10sec_refresh_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests are run in logical_session_cache_sharding_100ms_refresh_jscore_txns_passthrough.yml. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_1sec_refresh_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_1sec_refresh_jscore_passthrough.yml index 6e58c5c47df..b4dae1490eb 100644 --- a/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_1sec_refresh_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_1sec_refresh_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests are run in logical_session_cache_sharding_100ms_refresh_jscore_txns_passthrough.yml. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_default_refresh_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_default_refresh_jscore_passthrough.yml index f0ac45e79ca..495de2e43e8 100644 --- a/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_default_refresh_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/logical_session_cache_sharding_default_refresh_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests are run in logical_session_cache_sharding_100ms_refresh_jscore_txns_passthrough.yml. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_100ms_refresh_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_100ms_refresh_jscore_passthrough.yml index 77ee0700640..c4f20d8b68b 100644 --- a/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_100ms_refresh_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_100ms_refresh_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions are not supported on MongoDB standalone nodes. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_10sec_refresh_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_10sec_refresh_jscore_passthrough.yml index c3ccea25a2d..ea418d46d14 100644 --- a/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_10sec_refresh_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_10sec_refresh_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions are not supported on MongoDB standalone nodes. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_1sec_refresh_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_1sec_refresh_jscore_passthrough.yml index 110804994a4..14cc8930d38 100644 --- a/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_1sec_refresh_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_1sec_refresh_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions are not supported on MongoDB standalone nodes. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_default_refresh_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_default_refresh_jscore_passthrough.yml index 962c41c03f3..6bdad92321f 100644 --- a/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_default_refresh_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/logical_session_cache_standalone_default_refresh_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions are not supported on MongoDB standalone nodes. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/read_concern_majority_passthrough.yml b/buildscripts/resmokeconfig/suites/read_concern_majority_passthrough.yml index 44613905b4c..8c73f20ccc9 100644 --- a/buildscripts/resmokeconfig/suites/read_concern_majority_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/read_concern_majority_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions only a readConcern argument on the first command. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/replica_sets_api_version_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_api_version_jscore_passthrough.yml index ea50e774083..da47a637ff5 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_api_version_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_api_version_jscore_passthrough.yml @@ -5,6 +5,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # This test initiates a txn with API parameters, but runs txn-continuing commands in a separate # Thread object. Since those commands will not have API parameters appended, they will fail due diff --git a/buildscripts/resmokeconfig/suites/replica_sets_fcbis_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_fcbis_jscore_passthrough.yml index 07e35bd9301..1850cb8d4e5 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_fcbis_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_fcbis_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Tests that query the system.profile collection cannot run in this suite since an initial sync # may insert unexpected operations into the profile collection. diff --git a/buildscripts/resmokeconfig/suites/replica_sets_initsync_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_initsync_jscore_passthrough.yml index 1e7dfcc243f..4a6b10bb529 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_initsync_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_initsync_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Tests that query the system.profile collection cannot run in this suite since an initial sync # may insert unexpected operations into the profile collection. diff --git a/buildscripts/resmokeconfig/suites/replica_sets_initsync_static_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_initsync_static_jscore_passthrough.yml index 1295ba29190..bda7edbe723 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_initsync_static_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_initsync_static_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Duplicate namespace may cause cloner to try and clone view instead of collection - jstests/core/views/duplicate_ns.js diff --git a/buildscripts/resmokeconfig/suites/replica_sets_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_jscore_passthrough.yml index cbcd2b1e89a..ad1b5e0f6f2 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests change the transactionLifetimeLimitSeconds server parameter which conflicts with how # the CheckReplDBHashInBackground hook doesn't want transactions to be reaped while it is running. diff --git a/buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_passthrough.yml index a12f9273ee6..2cdb5f6b723 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_passthrough.yml @@ -7,6 +7,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions do not support retryability of individual operations. # TODO: Remove this once it is supported (SERVER-33952). diff --git a/buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_stepdown_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_stepdown_passthrough.yml index ffb5bd02d1c..d292c3ae69d 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_stepdown_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_reconfig_jscore_stepdown_passthrough.yml @@ -7,6 +7,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions do not support retryability of individual operations. # TODO: Remove this once it is supported (SERVER-33952). diff --git a/buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml index be7f0fd585e..1288ffb0a86 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_terminate_primary_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions do not support retryability of individual operations. # TODO: Remove this once it is supported (SERVER-33952). diff --git a/buildscripts/resmokeconfig/suites/replica_sets_update_v1_oplog_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_update_v1_oplog_jscore_passthrough.yml index 386b4d542c8..db98749b965 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_update_v1_oplog_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_update_v1_oplog_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests change the transactionLifetimeLimitSeconds server parameter which conflicts with how # the CheckReplDBHashInBackground hook doesn't want transactions to be reaped while it is running. diff --git a/buildscripts/resmokeconfig/suites/retryable_writes_downgrade.yml b/buildscripts/resmokeconfig/suites/retryable_writes_downgrade.yml index 08ff2a71112..b3d3d510dae 100644 --- a/buildscripts/resmokeconfig/suites/retryable_writes_downgrade.yml +++ b/buildscripts/resmokeconfig/suites/retryable_writes_downgrade.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions do not support retryability of individual operations. # TODO: Remove this once it is supported (SERVER-33952). diff --git a/buildscripts/resmokeconfig/suites/retryable_writes_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/retryable_writes_jscore_passthrough.yml index b0006809d7e..3f8a241c4bc 100644 --- a/buildscripts/resmokeconfig/suites/retryable_writes_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/retryable_writes_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions do not support retryability of individual operations. # TODO: Remove this once it is supported (SERVER-33952). diff --git a/buildscripts/resmokeconfig/suites/retryable_writes_jscore_stepdown_passthrough.yml b/buildscripts/resmokeconfig/suites/retryable_writes_jscore_stepdown_passthrough.yml index ee838cad66f..985f095650d 100644 --- a/buildscripts/resmokeconfig/suites/retryable_writes_jscore_stepdown_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/retryable_writes_jscore_stepdown_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions do not support retryability of individual operations. # TODO: Remove this once it is supported (SERVER-33952). diff --git a/buildscripts/resmokeconfig/suites/sharded_causally_consistent_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/sharded_causally_consistent_jscore_passthrough.yml index c718beb143e..65adab44054 100644 --- a/buildscripts/resmokeconfig/suites/sharded_causally_consistent_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/sharded_causally_consistent_jscore_passthrough.yml @@ -5,6 +5,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests are run in sharded_causally_consistent_jscore_txns_passthrough. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/sharded_causally_consistent_read_concern_snapshot_passthrough.yml b/buildscripts/resmokeconfig/suites/sharded_causally_consistent_read_concern_snapshot_passthrough.yml index 5a1d8541866..e9752e3e32e 100644 --- a/buildscripts/resmokeconfig/suites/sharded_causally_consistent_read_concern_snapshot_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/sharded_causally_consistent_read_concern_snapshot_passthrough.yml @@ -5,6 +5,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests are run in sharded_causally_consistent_jscore_txns_passthrough. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/sharded_collections_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/sharded_collections_jscore_passthrough.yml index 596b44e7ede..951d955c329 100644 --- a/buildscripts/resmokeconfig/suites/sharded_collections_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/sharded_collections_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests run in the jscore_txn passthrough suites. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/sharded_retryable_writes_downgrade.yml b/buildscripts/resmokeconfig/suites/sharded_retryable_writes_downgrade.yml index 71d63097bac..6419782211b 100644 --- a/buildscripts/resmokeconfig/suites/sharded_retryable_writes_downgrade.yml +++ b/buildscripts/resmokeconfig/suites/sharded_retryable_writes_downgrade.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # Transactions do not support retryability of individual operations. # TODO: Remove this once it is supported (SERVER-33952). diff --git a/buildscripts/resmokeconfig/suites/sharding_api_version_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/sharding_api_version_jscore_passthrough.yml index 293e068a97e..6112ea49059 100644 --- a/buildscripts/resmokeconfig/suites/sharding_api_version_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/sharding_api_version_jscore_passthrough.yml @@ -5,6 +5,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # This test initiates a txn with API parameters, but runs txn-continuing commands in a separate diff --git a/buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml index dad06dc8eab..f30916472a0 100644 --- a/buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/sharding_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests are run in sharded_jscore_txns. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/sharding_update_v1_oplog_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/sharding_update_v1_oplog_jscore_passthrough.yml index c5e5854079d..2278a3585bf 100644 --- a/buildscripts/resmokeconfig/suites/sharding_update_v1_oplog_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/sharding_update_v1_oplog_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # These tests are run in sharded_jscore_txns. - jstests/core/txns/**/*.js diff --git a/buildscripts/resmokeconfig/suites/talk_directly_to_shardsvrs_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/talk_directly_to_shardsvrs_jscore_passthrough.yml index e31f260e4f8..140f179077d 100644 --- a/buildscripts/resmokeconfig/suites/talk_directly_to_shardsvrs_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/talk_directly_to_shardsvrs_jscore_passthrough.yml @@ -3,6 +3,8 @@ test_kind: js_test selector: roots: - jstests/core/**/*.js + - jstests/fle2/**/*.js + - src/mongo/db/modules/*/jstests/fle2/*.js exclude_files: # This test expects that the connection (i.e. 'threadName') does not change throughout each test # case. That is not always true when the test driver use a replica set connection string. As this diff --git a/jstests/fle2/convert_encrypted_to_capped.js b/jstests/fle2/convert_encrypted_to_capped.js index ec94ae29cfc..afed1674036 100644 --- a/jstests/fle2/convert_encrypted_to_capped.js +++ b/jstests/fle2/convert_encrypted_to_capped.js @@ -3,6 +3,9 @@ /** * @tags: [ * requires_fcv_60 + * assumes_unsharded_collection, + * requires_non_retryable_commands, + * assumes_against_mongod_not_mongos * ] */ load("jstests/fle2/libs/encrypted_client_util.js"); diff --git a/jstests/fle2/create_encrypted_collection.js b/jstests/fle2/create_encrypted_collection.js index 7db844a9dcd..735013468e2 100644 --- a/jstests/fle2/create_encrypted_collection.js +++ b/jstests/fle2/create_encrypted_collection.js @@ -2,7 +2,8 @@ /** * @tags: [ - * requires_fcv_60 + * requires_fcv_60, + * assumes_unsharded_collection * ] */ load("jstests/fle2/libs/encrypted_client_util.js"); diff --git a/jstests/fle2/create_encrypted_indexes.js b/jstests/fle2/create_encrypted_indexes.js index 83ac4fef0df..295cdc7334b 100644 --- a/jstests/fle2/create_encrypted_indexes.js +++ b/jstests/fle2/create_encrypted_indexes.js @@ -2,7 +2,8 @@ /** * @tags: [ - * requires_fcv_60 + * requires_fcv_60, + * assumes_unsharded_collection * ] */ load("jstests/fle2/libs/encrypted_client_util.js"); diff --git a/jstests/fle2/implicit_schema_validation.js b/jstests/fle2/implicit_schema_validation.js index 7b2642def49..41eabb9a6e7 100644 --- a/jstests/fle2/implicit_schema_validation.js +++ b/jstests/fle2/implicit_schema_validation.js @@ -2,7 +2,9 @@ /** * @tags: [ - * requires_fcv_60 + * requires_fcv_60, + * assumes_unsharded_collection, + * does_not_support_transactions * ] */ (function() { diff --git a/jstests/fle2/libs/encrypted_client_util.js b/jstests/fle2/libs/encrypted_client_util.js index 5b5dbd695d1..e17fd152813 100644 --- a/jstests/fle2/libs/encrypted_client_util.js +++ b/jstests/fle2/libs/encrypted_client_util.js @@ -14,6 +14,10 @@ class EncryptedClient { * @param {string} dbName Name of database to setup key vault in */ constructor(conn, dbName) { + // Detect if jstests/libs/override_methods/implicitly_shard_accessed_collections.js is in + // use + this.useImplicitSharding = !(typeof (ImplicitlyShardAccessCollSettings) === "undefined"); + const localKMS = { key: BinData( 0, @@ -28,9 +32,8 @@ class EncryptedClient { schemaMap: {}, }; - var currentPort = conn.host.split(":")[1]; - var host = "localhost:" + currentPort; - var shell = Mongo(host, clientSideFLEOptions); + let connectionString = conn.host.toString(); + var shell = Mongo(connectionString, clientSideFLEOptions); var edb = shell.getDB(dbName); var keyVault = shell.getKeyVault(); @@ -84,20 +87,67 @@ class EncryptedClient { } } - return this._edb.createEncryptedCollection(name, options); + assert.neq(options, + undefined, + `createEncryptedCollection expected an options object, it is undefined`); + assert( + options.hasOwnProperty("encryptedFields") && typeof options.encryptedFields == "object", + `options must contain an encryptedFields document'`); + + const res = assert.commandWorked(this._edb.createCollection(name, options)); + + const cis = this._edb.getCollectionInfos({"name": name}); + assert.eq(cis.length, 1, `Expected to find one collection named '${name}'`); + + const ci = cis[0]; + assert(ci.hasOwnProperty("options"), `Expected collection '${name}' to have 'options'`); + const storedOptions = ci.options; + assert(options.hasOwnProperty("encryptedFields"), + `Expected collection '${name}' to have 'encryptedFields'`); + const ef = storedOptions.encryptedFields; + + // All our tests use "last" as the key to query on so shard on "last" instead of "_id" + if (this.useImplicitSharding) { + let resShard = this._db.adminCommand({enableSharding: this._db.getName()}); + + // enableSharding may only be called once for a database. + if (resShard.code !== ErrorCodes.AlreadyInitialized) { + assert.commandWorked( + resShard, "enabling sharding on the '" + this._db.getName() + "' db failed"); + } + + let shardCollCmd = { + shardCollection: this._db.getName() + "." + name, + key: {last: "hashed"}, + collation: {locale: "simple"} + }; + + resShard = this._db.adminCommand(shardCollCmd); + + jsTestLog("Sharding: " + tojson(shardCollCmd)); + } + + assert.commandWorked(this._edb.getCollection(name).createIndex({__safeContent__: 1})); + + assert.commandWorked(this._edb.createCollection(ef.escCollection)); + assert.commandWorked(this._edb.createCollection(ef.eccCollection)); + assert.commandWorked(this._edb.createCollection(ef.ecocCollection)); + + return res; } /** * Assert the number of documents in the EDC and state collections is correct. * - * @param {string} name Name of EDC + * @param {object} collection Collection object for EDC * @param {number} edc Number of documents in EDC * @param {number} esc Number of documents in ESC * @param {number} ecc Number of documents in ECC * @param {number} ecoc Number of documents in ECOC */ - assertEncryptedCollectionCounts(name, expectedEdc, expectedEsc, expectedEcc, expectedEcoc) { - const cis = this._edb.getCollectionInfos({"name": name}); + assertEncryptedCollectionCountsByObject( + sessionDB, name, expectedEdc, expectedEsc, expectedEcc, expectedEcoc) { + const cis = this._db.getCollectionInfos({"name": name}); assert.eq(cis.length, 1, `Expected to find one collection named '${name}'`); const ci = cis[0]; @@ -108,28 +158,42 @@ class EncryptedClient { const ef = options.encryptedFields; - const actualEdc = this._edb.getCollection(name).count(); + const actualEdc = sessionDB.getCollection(name).countDocuments({}); assert.eq(actualEdc, expectedEdc, `EDC document count is wrong: Actual ${actualEdc} vs Expected ${expectedEdc}`); - const actualEsc = this._edb.getCollection(ef.escCollection).count(); + const actualEsc = sessionDB.getCollection(ef.escCollection).countDocuments({}); assert.eq(actualEsc, expectedEsc, `ESC document count is wrong: Actual ${actualEsc} vs Expected ${expectedEsc}`); - const actualEcc = this._edb.getCollection(ef.eccCollection).count(); + const actualEcc = sessionDB.getCollection(ef.eccCollection).countDocuments({}); assert.eq(actualEcc, expectedEcc, `ECC document count is wrong: Actual ${actualEcc} vs Expected ${expectedEcc}`); - const actualEcoc = this._edb.getCollection(ef.ecocCollection).count(); + const actualEcoc = sessionDB.getCollection(ef.ecocCollection).countDocuments({}); assert.eq(actualEcoc, expectedEcoc, `ECOC document count is wrong: Actual ${actualEcoc} vs Expected ${expectedEcoc}`); } /** + * Assert the number of documents in the EDC and state collections is correct. + * + * @param {string} name Name of EDC + * @param {number} edc Number of documents in EDC + * @param {number} esc Number of documents in ESC + * @param {number} ecc Number of documents in ECC + * @param {number} ecoc Number of documents in ECOC + */ + assertEncryptedCollectionCounts(name, expectedEdc, expectedEsc, expectedEcc, expectedEcoc) { + this.assertEncryptedCollectionCountsByObject( + this._db, name, expectedEdc, expectedEsc, expectedEcc, expectedEcoc); + } + + /** * Get a single document from the collection with the specified query. Ensure it contains the specified fields when decrypted and that does fields are encrypted. diff --git a/jstests/fle2/modify_encrypted_collection.js b/jstests/fle2/modify_encrypted_collection.js index 79258b03845..6fb3afe2292 100644 --- a/jstests/fle2/modify_encrypted_collection.js +++ b/jstests/fle2/modify_encrypted_collection.js @@ -2,7 +2,8 @@ /** * @tags: [ - * requires_fcv_60 + * requires_fcv_60, + * assumes_unsharded_collection * ] */ load("jstests/fle2/libs/encrypted_client_util.js"); diff --git a/jstests/fle2/rename_encrypted_collection.js b/jstests/fle2/rename_encrypted_collection.js index 74860d54ead..badff5a34f3 100644 --- a/jstests/fle2/rename_encrypted_collection.js +++ b/jstests/fle2/rename_encrypted_collection.js @@ -2,7 +2,8 @@ /** * @tags: [ - * requires_fcv_60 + * requires_fcv_60, + * assumes_unsharded_collection, * ] */ load("jstests/fle2/libs/encrypted_client_util.js"); diff --git a/jstests/fle2/shard_collection.js b/jstests/fle2/shard_collection.js index 0857045fe92..ff2e86452dd 100644 --- a/jstests/fle2/shard_collection.js +++ b/jstests/fle2/shard_collection.js @@ -10,7 +10,8 @@ load("jstests/fle2/libs/encrypted_client_util.js"); (function() { 'use strict'; -if (!isFLE2ShardingEnabled()) { +// Passthrough workaround +if (!isMongos(db)) { return; } diff --git a/jstests/libs/override_methods/implicitly_shard_accessed_collections.js b/jstests/libs/override_methods/implicitly_shard_accessed_collections.js index 338b3d0f02f..8356f0bfb62 100644 --- a/jstests/libs/override_methods/implicitly_shard_accessed_collections.js +++ b/jstests/libs/override_methods/implicitly_shard_accessed_collections.js @@ -55,6 +55,9 @@ var denylistedNamespaces = [ /^admin\./, /^config\./, /\.system\./, + /enxcol_\..*\.esc/, + /enxcol_\..*\.ecc/, + /enxcol_\..*\.ecoc/, ]; const kZoneName = 'moveToHereForMigrationPassthrough'; diff --git a/src/mongo/db/fle_crud.cpp b/src/mongo/db/fle_crud.cpp index c561877aab1..12d7a3be6ca 100644 --- a/src/mongo/db/fle_crud.cpp +++ b/src/mongo/db/fle_crud.cpp @@ -709,6 +709,7 @@ write_ops::DeleteCommandReply processDelete(FLEQueryInterface* queryImpl, auto [deleteReply, deletedDocument] = queryImpl->deleteWithPreimage(edcNss, ei, newDeleteRequest); + checkWriteErrors(deleteReply); // If the delete did not actually delete anything, we are done if (deletedDocument.isEmpty()) { @@ -1233,19 +1234,24 @@ std::pair<write_ops::DeleteCommandReply, BSONObj> FLEQueryInterfaceImpl::deleteW auto response = _txnClient.runCommand(nss.db(), findAndModifyRequest.toBSON({})).get(); auto status = getStatusFromWriteCommandReply(response); - auto reply = - write_ops::FindAndModifyCommandReply::parse(IDLParserErrorContext("reply"), response); - + BSONObj returnObj; write_ops::DeleteCommandReply deleteReply; if (!status.isOK()) { deleteReply.getWriteCommandReplyBase().setN(0); deleteReply.getWriteCommandReplyBase().setWriteErrors(singleStatusToWriteErrors(status)); - } else if (reply.getLastErrorObject().getNumDocs() > 0) { - deleteReply.getWriteCommandReplyBase().setN(1); + } else { + auto reply = + write_ops::FindAndModifyCommandReply::parse(IDLParserErrorContext("reply"), response); + + if (reply.getLastErrorObject().getNumDocs() > 0) { + deleteReply.getWriteCommandReplyBase().setN(1); + } + + returnObj = reply.getValue().value_or(BSONObj()); } - return {deleteReply, reply.getValue().value_or(BSONObj())}; + return {deleteReply, returnObj}; } std::pair<write_ops::UpdateCommandReply, BSONObj> FLEQueryInterfaceImpl::updateWithPreimage( @@ -1337,6 +1343,8 @@ write_ops::FindAndModifyCommandReply FLEQueryInterfaceImpl::findAndModify( auto ei2 = ei; ei2.setCrudProcessed(true); newFindAndModifyRequest.setEncryptionInformation(ei2); + // WriteConcern is set at the transaction level so strip it out + newFindAndModifyRequest.setWriteConcern(boost::none); auto response = _txnClient.runCommand(nss.db(), newFindAndModifyRequest.toBSON({})).get(); auto status = getStatusFromWriteCommandReply(response); diff --git a/src/mongo/shell/db.js b/src/mongo/shell/db.js index 814c0ed19af..d4e95888d87 100644 --- a/src/mongo/shell/db.js +++ b/src/mongo/shell/db.js @@ -185,7 +185,7 @@ DB.prototype.runCommand = function(obj, extra, queryOptions) { // "error doing query: failed". Even though this message is arguably incorrect // for a command failing due to a connection failure, we preserve it for backwards // compatibility. See SERVER-18334 for details. - if (ex.message.indexOf("network error") >= 0) { + if (ex.hasOwnProperty("message") && ex.message.indexOf("network error") >= 0) { throw new Error("error doing query: failed: " + ex.message); } throw ex; |