@@ -979,6 +979,14 @@ Test cases
979
979
8. Bypass Spawning mongocryptd
980
980
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
981
981
982
+ .. note ::
983
+
984
+ CONSIDER: To reduce the chances of tests interfering with each other,
985
+ drivers MAY use a different port for each test in this group,
986
+ and include it in ``--pidfilepath ``. The interference
987
+ may come from the fact that once spawned by a test,
988
+ ``mongocryptd `` stays up and running for some time.
989
+
982
990
Via loading shared library
983
991
``````````````````````````
984
992
@@ -1021,19 +1029,27 @@ The following tests that loading crypt_shared_ bypasses spawning mongocryptd.
1021
1029
.. note ::
1022
1030
1023
1031
IMPORTANT: If crypt_shared _ is visible to the operating system's library
1024
- search mechanism, the expected server error generated by these
1025
- ``mongocryptdBypassSpawn `` tests will not appear because libmongocrypt will
1032
+ search mechanism, the expected server error generated by the
1033
+ ``Via mongocryptdBypassSpawn ``, ``Via bypassAutoEncryption ``, ``Via bypassQueryAnalysis ``
1034
+ tests will not appear because libmongocrypt will
1026
1035
load the ``crypt_shared `` library instead of consulting mongocryptd. For
1027
1036
the following tests, it is required that libmongocrypt *not * load ``crypt_shared ``.
1028
1037
Refer to the client-side-encryption document for more information on
1029
- "disabling" ``crypt_shared ``.
1038
+ "disabling" ``crypt_shared ``. Take into account that once loaded,
1039
+ for example, by another test,
1040
+ ``crypt_shared `` cannot be unloaded and may be used by ``MongoClient ``,
1041
+ thus making the tests misbehave in unexpected ways.
1030
1042
1031
1043
1032
1044
Via mongocryptdBypassSpawn
1033
1045
``````````````````````````
1034
1046
1035
1047
The following tests that setting ``mongocryptdBypassSpawn=true `` really does bypass spawning mongocryptd.
1036
1048
1049
+ #. Insert the document `external/external-key.json <../external/external-key.json >`_ into ``keyvault.datakeys `` with majority write concern.
1050
+ This step is not required to run this test, and drivers MAY skip it. But if the driver misbehaves,
1051
+ then not having the encryption fully set up may complicate the process of figuring out what is wrong.
1052
+
1037
1053
#. Create a MongoClient configured with auto encryption (referred to as ``client_encrypted ``)
1038
1054
1039
1055
Configure the required options. Use the ``local `` KMS provider as follows:
@@ -2514,7 +2530,7 @@ The following tests that a mongocryptd client is not created when shared library
2514
2530
.. code :: javascript
2515
2531
2516
2532
{
2517
- " mongocryptdURI" : " mongodb://localhost:27021"
2533
+ " mongocryptdURI" : " mongodb://localhost:27021/?serverSelectionTimeoutMS=1000 "
2518
2534
}
2519
2535
2520
2536
#. Use ``client_encrypted `` to insert the document ``{"unencrypted": "test"} `` into ``db.coll ``.
0 commit comments