summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
Diffstat (limited to 'jstests')
-rw-r--r--jstests/fle2/libs/encrypted_client_util.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/jstests/fle2/libs/encrypted_client_util.js b/jstests/fle2/libs/encrypted_client_util.js
index 99ddd27ace3..178147a48a6 100644
--- a/jstests/fle2/libs/encrypted_client_util.js
+++ b/jstests/fle2/libs/encrypted_client_util.js
@@ -415,7 +415,7 @@ var EncryptedClient = class {
}
};
-function runEncryptedTest(db, dbName, collName, encryptedFields, runTestsCallback) {
+function runEncryptedTest(db, dbName, collNames, encryptedFields, runTestsCallback) {
const dbTest = db.getSiblingDB(dbName);
dbTest.dropDatabase();
@@ -429,8 +429,14 @@ function runEncryptedTest(db, dbName, collName, encryptedFields, runTestsCallbac
let client = new EncryptedClient(db.getMongo(), dbName);
- assert.commandWorked(
- client.createEncryptionCollection(collName, {encryptedFields: encryptedFields}));
+ if (typeof collNames === "string") {
+ collNames = [collNames];
+ }
+
+ for (collName of collNames) {
+ assert.commandWorked(
+ client.createEncryptionCollection(collName, {encryptedFields: encryptedFields}));
+ }
let edb = client.getDB();
runTestsCallback(edb, client);