Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-65404

jstests/fle2/query/find.js non-transaction test case should query against encrypted data

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 6.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • QO 2022-04-18

      Currently, the test uses `runEncryptedTest` which creates a test collection The test then drops the collection and relies on implicit create which means there is no encryption happening.

      Example fix with verification collection is encrypted:

      diff --git a/jstests/fle2/query/find.js b/jstests/fle2/query/find.js
      index 4f834d4c9a..aa76844e44 100644
      --- a/jstests/fle2/query/find.js
      +++ b/jstests/fle2/query/find.js
      @@ -37,19 +37,20 @@ const runTestWithColl = ({insert = [], before = null, query, expected}, testColl
       const {encryptedFields, tests} = matchExpressionFLETestCases;
      
       let collName = jsTestName();
      -runEncryptedTest(db, "find", collName, encryptedFields, (edb) => {
      +runEncryptedTest(db, "find", collName, encryptedFields, (edb, client) => {
           print("non-transaction test cases.");
           const coll = edb[collName];
      -    coll.drop();
      
           let i = 0;
           for (const test of tests) {
               runTestWithColl(test, coll, {index: i++, testData: test, transaction: false});
           }
      +
      +    client.assertEncryptedCollectionCounts(collName, 4,9,1,10);
       });
      

            Assignee:
            davis.haupt@mongodb.com Davis Haupt (Inactive)
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: